Lines Matching defs:String
36 class String : public string
39 static String format(const String& format_, ...);
40 static String format(const String& format_, va_list args_);
41 template<class T> static String toString(const T& value_);
42 static String toBitString(unsigned int value_, unsigned int num_bits_);
43 template<class T> static T fromString(const String& str_);
49 String();
50 String(const string& str_);
51 String(const char* str_, size_t n);
52 String(const char* str_);
53 String(size_t n, char c);
54 String(int value_);
55 String(unsigned int value_);
56 String(long value_);
57 String(unsigned long value_);
58 String(float value_);
59 String(double value_);
60 String(bool value_);
61 ~String();
65 String& trim();
67 String& substitute(const String& str1_, const String& str2_);
68 // Split the String into vector of Strings separated by delimiters_
69 vector<String> split(const char* delimiters_) const;
70 vector<String> split(const String* delimiters_, unsigned int num_delimiters_ = 1) const;
71 vector<String> splitByString(const String& delimiters_) const;
74 bool contain(const String& str_) const;
94 String& operator=(char c_);
97 template<class T> String String::toString(const T& value_)
104 template<> inline String String::toString<bool>(const bool& value_)
116 inline String String::toBitString(unsigned int value_, unsigned int num_bits_)
119 String ret = String(bitSet.to_string());
124 template<class T> T String::fromString(const String& str_)
132 template<> inline String String::fromString<String>(const String& str_)
137 template<> inline bool String::fromString<bool>(const String& str_)
140 if((str_ == String("TRUE")) || (str_ == String("true")))
144 else if((str_ == string("FALSE")) || (str_ == String("false")))
156 template<class T> String arrayToString(
158 const String& delimiters_
164 throw("Invalid index range: start_index = " + (String)start_index_ + ", end_index = " + (String)end_index_);
167 String ret = "[";
170 ret += (String)array_[i] + delimiters_;
172 ret += (String)array_[end_index_-1] + "]";
176 template<class T> String arrayToString(const T* array_, unsigned int num_elements_)
181 template<class T> String arrayToString(const T* array_, unsigned int start_index_, unsigned int end_index_)
186 template<class T> String vectorToString(
188 const String& delimiters_
198 throw("Invalid index range: start_index = " + (String)start_index_ + ", end_index = " + (String)end_index_);
201 String ret = "[";
204 ret += (String)vector_[i] + delimiters_;
206 ret += (String)vector_[end_index_-1] + "]";
210 template<class T> String vectorToString(const vector<T>& vector_)
215 template<class T> String vectorToString(const vector<T>& vector_, unsigned int num_elements_)
220 template<class T> String vectorToString(const vector<T>& vector_, unsigned int start_index_, unsigned int end_index_)
225 template<class T> vector<T> castStringVector(const vector<String>& vector_)
235 std::istream& safeGetline(std::istream& is_, String& str_);