Lines Matching refs:in
39 std::string StringHelper::Uppercase(const std::string &in) { in Uppercase() argument
40 std::string out{in}; in Uppercase()
49 std::string StringHelper::Lowercase(const std::string &in) { in Lowercase() argument
50 std::string out{in}; in Lowercase()
59 std::string StringHelper::Capitalize(const std::string &in) { in Capitalize() argument
60 std::string out{in}; in Capitalize()
94 void StringHelper::Tokenize(const std::string& in, std::vector<std::string>* vec) { in Tokenize() argument
96 if (in.empty()) return; in Tokenize()
98 if (in.find('_') != std::string::npos) { in Tokenize()
100 SplitString(in, '_', &snakeCaseComponents); in Tokenize()
112 std::string copy(in); in Tokenize()
129 LOG(WARNING) << "Could not stylize \"" << in << "\""; in Tokenize()
138 std::string StringHelper::ToCamelCase(const std::string &in) { in ToCamelCase() argument
140 Tokenize(in, &components); in ToCamelCase()
142 if (!in.empty()) in ToCamelCase()
143 LOG(WARNING) << "Could not stylize \"" << in << "\""; in ToCamelCase()
144 return in; in ToCamelCase()
153 std::string StringHelper::ToPascalCase(const std::string &in) { in ToPascalCase() argument
155 Tokenize(in, &components); in ToPascalCase()
162 std::string StringHelper::ToUpperSnakeCase(const std::string &in) { in ToUpperSnakeCase() argument
164 Tokenize(in, &components); in ToUpperSnakeCase()
171 std::string StringHelper::ToLowerSnakeCase(const std::string &in) { in ToLowerSnakeCase() argument
173 Tokenize(in, &components); in ToLowerSnakeCase()
180 std::string StringHelper::ToCase(StringHelper::Case c, const std::string &in) { in ToCase() argument
183 return ToCamelCase(in); in ToCase()
185 return ToPascalCase(in); in ToCase()
187 return ToUpperSnakeCase(in); in ToCase()
189 return ToLowerSnakeCase(in); in ToCase()
191 return in; in ToCase()
194 return in; in ToCase()
197 bool StringHelper::EndsWith(const std::string &in, const std::string &suffix) { in EndsWith() argument
198 return in.size() >= suffix.size() && in EndsWith()
199 in.substr(in.size() - suffix.size()) == suffix; in EndsWith()
202 bool StringHelper::StartsWith(const std::string &in, const std::string &prefix) { in StartsWith() argument
203 return in.size() >= prefix.size() && in StartsWith()
204 in.substr(0, prefix.size()) == prefix; in StartsWith()
207 std::string StringHelper::RTrim(const std::string &in, const std::string &suffix) { in RTrim() argument
208 if (EndsWith(in, suffix)) { in RTrim()
209 return in.substr(0, in.size() - suffix.size()); in RTrim()
212 return in; in RTrim()
215 std::string StringHelper::LTrim(const std::string &in, const std::string &prefix) { in LTrim() argument
216 if (StartsWith(in, prefix)) { in LTrim()
217 return in.substr(prefix.size()); in LTrim()
220 return in; in LTrim()
223 std::string StringHelper::RTrimAll(const std::string &in, const std::string &suffix) { in RTrimAll() argument
225 return in; in RTrimAll()
228 std::string copy(in); in RTrimAll()
236 std::string StringHelper::LTrimAll(const std::string &in, const std::string &prefix) { in LTrimAll() argument
238 return in; in LTrimAll()
241 std::string copy(in); in LTrimAll()