19 #ifndef ATOMPROBE_STRINGFUNCS_H 20 #define ATOMPROBE_STRINGFUNCS_H 32 template<
class T1,
class T2>
bool stream_cast(T1 &result,
const T2 &obj)
51 unsigned char b,
unsigned char a, std::string &s);
54 unsigned char b, std::string &s);
58 unsigned char &r,
unsigned char &g,
unsigned char &b,
unsigned char &a);
62 std::string
digitString(
unsigned int thisDigit,
unsigned int maxDigit);
65 std::string
stripWhite(
const std::string &str);
67 std::string
stripChars(
const std::string &Str,
const char *chars);
77 std::string
stripWhite(
const std::string &str);
80 void splitStrsRef(
const char *cpStr,
const char delim,std::vector<std::string> &v );
83 void splitStrsRef(
const char *cpStr,
const char *delim,std::vector<std::string> &v );
89 std::string
onlyDir(
const std::string& path );
99 inline std::string
tabs(
unsigned int nTabs)
103 std::fill(s.begin(),s.end(),
'\t');
110 std::string temp(s.length(),
' ');
111 std::copy(s.begin(), s.end(), temp.begin());
117 std::wstring temp(s.length(),L
' ');
118 std::copy(s.begin(), s.end(), temp.begin());
std::string convertFileStringToCanonical(const std::string &s)
Convert a path format into a unix path from native format.
std::string uppercase(std::string s)
Return a uppercase version for a given string.
std::string onlyDir(const std::string &path)
Return only the directory name component of the full path.
std::string tabs(unsigned int nTabs)
std::string onlyFilename(const std::string &path)
Return only the filename component.
std::string stripWhite(const std::string &str)
Strip whitespace, (eg tab,space) from either side of a string.
void nullifyMarker(char *buffer, char marker)
std::string digitString(unsigned int thisDigit, unsigned int maxDigit)
Generate a string with leading digits up to maxDigit (eg, if maxDigit is 424, and thisDigit is 1...
std::string convertFileStringToNative(const std::string &s)
Convert a path format into a native path from unix format.
void genColString(unsigned char r, unsigned char g, unsigned char b, unsigned char a, std::string &s)
void splitStrsRef(const char *cpStr, const char delim, std::vector< std::string > &v)
Split string references using a single delimiter.
std::string stlWStrToStlStr(const std::wstring &s)
std::wstring stlStrToStlWStr(const std::string &s)
std::string lowercase(std::string s)
Return a lowercase version for a given string.
bool parseColString(const std::string &str, unsigned char &r, unsigned char &g, unsigned char &b, unsigned char &a)
Parse a colour string containing rgb[a]; hex for with leading #.
bool stream_cast(T1 &result, const T2 &obj)
Template function to cast and object to another by the stringstream.
void stripZeroEntries(std::vector< std::string > &s)
void strAppend(std::string s, const T &a)
std::string stripChars(const std::string &Str, const char *chars)