メインページ | ネームスペース一覧 | クラス階層 | 構成 | Directories | ファイル一覧 | ネームスペースメンバ | 構成メンバ | ファイルメンバ

StringUtil.h

説明を見る。
00001 // -*- C++ -*-
00019 /*
00020  * $Log: StringUtil.h,v $
00021  * Revision 1.7  2006/11/27 10:00:15  n-ando
00022  * otos() function that converts object to string was added.
00023  * flatten() function that flattens string vector was added.
00024  *
00025  * Revision 1.6  2006/10/24 06:24:45  n-ando
00026  * Now StringUtil was devided into definition and implementation.
00027  *
00028  * Revision 1.5  2006/10/23 07:41:20  n-ando
00029  * Kanji-code was changed from JIS to EUC.
00030  *
00031  * Revision 1.4  2006/10/23 07:37:42  n-ando
00032  * Bug fix for split(). The problems that split() does not return empty
00033  * string as list of results string.
00034  * Reference manuals for functions were described.
00035  *
00036  * Revision 1.3  2006/10/17 10:11:09  n-ando
00037  * Some escape/unescape related bugs are fixed.
00038  * The following some functions were added.
00039  * - eraseHeadBlank(), eraseTailBlank(), replaceString()
00040  *
00041  * Revision 1.2  2006/10/13 03:51:37  n-ando
00042  * The "escape" and "unescape" functions were added.
00043  *
00044  * Revision 1.1  2006/09/20 08:49:08  n-ando
00045  * The first commit.
00046  *
00047  *
00048  */
00049 
00050 #ifndef StringUtil_h
00051 #define StringUtil_h
00052 
00053 #include <string>
00054 #include <vector>
00055 #include <sstream>
00056 
00079 bool isEscaped(const std::string& str, std::string::size_type pos);
00080 
00081 
00106 std::string escape(const std::string str);
00107 
00108 
00135 std::string unescape(const std::string str);
00136 
00137 
00145 void eraseHeadBlank(std::string& str);
00146 
00147 
00155 void eraseTailBlank(std::string& str);
00156 
00157 
00165 void replaceString(std::string& str, const std::string from,
00166                    const std::string to);
00167 
00168 
00176 std::vector<std::string> split(const std::string& input,
00177                                const std::string& delimiter);
00178 
00179 
00187 bool toBool(std::string str, std::string yes, std::string no, 
00188             bool default_value = true);
00189 
00190 
00198 bool isAbsolutePath(const std::string& str);
00199 
00200 
00208 bool isURL(const std::string& str);
00209 
00210 
00218 template <class Printable>
00219 std::string otos(Printable n)
00220 {
00221   std::stringstream str_stream;
00222   str_stream << n;
00223   return str_stream.str();
00224 };
00225 
00226 std::vector<std::string> unique_sv(std::vector<std::string> sv);
00227 
00228 std::string flatten(std::vector<std::string> sv);
00229 
00230 #endif // StringUtil_h

OpenRTMに対してMon Jan 15 12:14:45 2007に生成されました。  doxygen 1.4.1