blob: 315b27531afd66750bbef7fe6c4ed2dcf16aeea7 [file] [log] [blame]
Joe Onorato6c9547d2016-09-07 18:43:49 -07001#include <string>
Yi Jin0473f88b2017-10-09 11:21:40 -07002#include <vector>
Joe Onorato6c9547d2016-09-07 18:43:49 -07003
4namespace android {
Yi Jin0473f88b2017-10-09 11:21:40 -07005namespace stream_proto {
Joe Onorato6c9547d2016-09-07 18:43:49 -07006
7using namespace std;
8
Yi Jinf9ed04b2017-10-20 16:17:58 -07009// Indent
10const string INDENT = " ";
11
Joe Onorato6c9547d2016-09-07 18:43:49 -070012/**
13 * Capitalizes the string, removes underscores and makes the next letter
14 * capitalized, and makes the letter following numbers capitalized.
15 */
16string to_camel_case(const string& str);
17
18/**
19 * Capitalize and insert underscores for CamelCase.
20 */
21string make_constant_name(const string& str);
22
23/**
24 * Returns the part of a file name that isn't a path and isn't a type suffix.
25 */
26string file_base_name(const string& str);
27
28/**
Yi Jine2f7f792017-11-01 17:08:27 -070029 * Replaces all occurances of 'replace' with 'with'.
Joe Onorato6c9547d2016-09-07 18:43:49 -070030 */
31string replace_string(const string& str, const char replace, const char with);
32
Yi Jin0473f88b2017-10-09 11:21:40 -070033/**
Yi Jine2f7f792017-11-01 17:08:27 -070034 * Splits a string to parts by delimiter.
Yi Jin0473f88b2017-10-09 11:21:40 -070035 */
36vector<string> split(const string& str, const char delimiter);
Joe Onorato6c9547d2016-09-07 18:43:49 -070037
Yi Jine2f7f792017-11-01 17:08:27 -070038/**
39 * Returns the rest of str if it has prefix, otherwise return all.
40 */
41string stripPrefix(const string& str, const string& prefix);
42
Yi Jin0473f88b2017-10-09 11:21:40 -070043} // namespace stream_proto
Joe Onorato6c9547d2016-09-07 18:43:49 -070044} // namespace android
45