*/
#include <iostream>
#include <sstream>
-#include <boost/algorithm/string/replace.hpp>
#include "zypp/base/Gettext.h"
#include "zypp/base/Logger.h"
else
{
string s = attrName;
- boost::replace_all( s,"_",":" );
+ str::replace_all( s,"_",":" );
SolvAttr a(s);
addAttribute(a,attrValue);
}
for_( it, attributes().begin(), attributes().end() )
{
string s = it->first.asString();
- boost::replace_all(s,":","_");
+ str::replace_all(s,":","_");
for_( it2,it->second.begin(),it->second.end() )
{
str << s <<": "<< *it2 << delim;
*/
#include <iostream>
-#include <boost/algorithm/string/replace.hpp>
-
//#include "zypp/base/Logger.h"
#include "zypp/base/String.h"
_id = what[5];
_name = what[10];
//replace all escaped semicolon with real
- boost::replace_all(_name,"\\x3a",":");
+ str::replace_all(_name,"\\x3a",":");
_created = createDate(what[6]);
_expires = createDate(what[7]);
#include <string>
#include <string.h>
-#include <boost/algorithm/string/replace.hpp>
-
#include "zypp/base/PtrTypes.h"
///////////////////////////////////////////////////////////////////
{ return( default_r ? strToFalse( str ) : strToTrue( str ) ); }
//@}
+ /**
+ * \short Looks for text in a string and replaces it.
+ *
+ * \note It only perform substtution in one pass
+ */
+ std::string gsub( const std::string& sData, const std::string& sFrom, const std::string& sTo);
+
+ /**
+ * \short Looks for text in string and replaces it in place
+ *
+ *
+ * \note It only perform substtution in one pass
+ * \note use only if you replace same lenght strings, otherwise use gsub
+ */
+ std::string& replace_all( std::string & str, const std::string & from, const std::string & to);
+
///////////////////////////////////////////////////////////////////
/** \name Split. */
//@{
std::string s( beg+1, cur-beg-2 ); //without quotes
//transform escaped escape
- boost::replace_all( s, "\\\\", "\\" );
+ replace_all( s, "\\\\", "\\" );
//transform escaped quotes (only same as open
char tmpn[2] = { closeChar, 0 };
char tmpo[3] = { '\\', closeChar, 0 };
- boost::replace_all( s, tmpo, tmpn );
+ replace_all( s, tmpo, tmpn );
*result_r = s;
}
// build string
std::string s( beg, cur-beg );
//transform escaped escape
- boost::replace_all( s, "\\\\", "\\" );
+ replace_all( s, "\\\\", "\\" );
const char *delimeter = sepchars_r;
while ( *delimeter )
const char tmp[2] = { *delimeter, '\0' };
std::string del(tmp);
ds+= del;
- boost::replace_all( s, ds, del );
+ replace_all( s, ds, del );
++delimeter;
}
inline bool endsWith(const std::string& s, const char* str) { return s.find(str) == s.size() - strlen(str); }
inline bool contains(const std::string& s, const char* str) { return s.find(str) != std::string::npos; }
- /**
- * \short Looks for text in a string and replaces it.
- *
- * \note It only perform substtution in one pass
- */
- std::string gsub( const std::string& sData, const std::string& sFrom, const std::string& sTo);
-
-
///////////////////////////////////////////////////////////////////
/** \name String prefix handling.