X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Futils.cpp;h=5a6bccdaca381e9e4cd066e2c0962489c4c457d1;hb=36f9e78ae75f5e14b132f37d249340ad3480b8ce;hp=baf1333138b82807864df7bb1f04ebc7365e3f33;hpb=f9e0275e476540c1b5d61c03a6a87d521856059b;p=libs%2Fcore.git diff --git a/source/utils.cpp b/source/utils.cpp index baf1333..5a6bccd 100644 --- a/source/utils.cpp +++ b/source/utils.cpp @@ -127,48 +127,6 @@ vector split_fields(const string &str, char sep, int max_split) return split_fields(str, string(1, sep), max_split); } -/** -Splits a string to parts. - -@param str String to be split -@param sep A set of separator characters -@param allow_empty Whether or not to produce empty parts for sequences of - more than one separator character -*/ -vector split(const string &str, const string &sep, bool allow_empty) -{ - vector result; - - unsigned start=0; - if(!allow_empty) - start=str.find_first_not_of(sep); - - while(start split(const string &str, char sep, bool allow_empty) -{ - return split(str, string(1, sep), allow_empty); -} - string strip(const string &s) { string result=s; @@ -301,7 +259,7 @@ string c_escape(const string &str, bool escape_8bit) result+="\\\\"; else if(static_cast(*i)<' ' || (escape_8bit && (*i&0x80))) { - char buf[4]={'\\', '0'+((*i>>6)&7), '0'+((*i>>3)&7), '0'+(*i&7)}; + char buf[4]={'\\', '0'+((*i>>6)&3), '0'+((*i>>3)&7), '0'+(*i&7)}; result.append(buf, 4); } else