00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef IXLIB_STRING
00011 #define IXLIB_STRING
00012
00013
00014
00015
00016 #include <string>
00017 #include <ixlib_base.hh>
00018 #include <ixlib_exgen.hh>
00019
00020
00021
00022
00023 namespace ixion {
00024 template<class InputIterator>
00025 inline std::string concat(InputIterator first,InputIterator last,std::string const &sep = " ") {
00026 std::string str;
00027 while (first != last) {
00028 if (str.size()) str += sep;
00029 str += *first++;
00030 }
00031 return str;
00032 }
00033
00034
00035
00036
00037 std::string findReplace(std::string const &target,std::string const &src,std::string const &dest);
00038 std::string findReplace(std::string const &target,char* src,char *dest);
00039 std::string findReplace(std::string const &target,char src,char dest);
00040 std::string upper(std::string const &original);
00041 std::string lower(std::string const &original);
00042 std::string removeLeading(std::string const &original,char ch = ' ');
00043 std::string removeTrailing(std::string const &original,char ch = ' ');
00044 std::string removeLeadingTrailing(std::string const &original,char ch = ' ');
00045 std::string parseCEscapes(std::string const &original);
00046
00047 TSize getMaxBase64DecodedSize(TSize encoded);
00048
00049
00050 TSize base64decode(TByte *data,std::string const &base64);
00051 void base64encode(std::string &base64,TByte const *data,TSize size);
00052
00053
00054
00055
00056 class string_hash {
00057 public:
00058 unsigned long operator()(std::string const &str) const;
00059 };
00060 }
00061
00062
00063
00064 #endif