2016-09-07 18:43:49 -07:00
|
|
|
#include <string>
|
2017-10-09 11:21:40 -07:00
|
|
|
#include <vector>
|
2016-09-07 18:43:49 -07:00
|
|
|
|
|
|
|
namespace android {
|
2017-10-09 11:21:40 -07:00
|
|
|
namespace stream_proto {
|
2016-09-07 18:43:49 -07:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
2017-10-20 16:17:58 -07:00
|
|
|
// Indent
|
|
|
|
const string INDENT = " ";
|
|
|
|
|
2016-09-07 18:43:49 -07:00
|
|
|
/**
|
|
|
|
* Capitalizes the string, removes underscores and makes the next letter
|
|
|
|
* capitalized, and makes the letter following numbers capitalized.
|
|
|
|
*/
|
|
|
|
string to_camel_case(const string& str);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Capitalize and insert underscores for CamelCase.
|
|
|
|
*/
|
|
|
|
string make_constant_name(const string& str);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the part of a file name that isn't a path and isn't a type suffix.
|
|
|
|
*/
|
|
|
|
string file_base_name(const string& str);
|
|
|
|
|
|
|
|
/**
|
2017-11-01 17:08:27 -07:00
|
|
|
* Replaces all occurances of 'replace' with 'with'.
|
2016-09-07 18:43:49 -07:00
|
|
|
*/
|
|
|
|
string replace_string(const string& str, const char replace, const char with);
|
|
|
|
|
2017-10-09 11:21:40 -07:00
|
|
|
/**
|
2017-11-01 17:08:27 -07:00
|
|
|
* Splits a string to parts by delimiter.
|
2017-10-09 11:21:40 -07:00
|
|
|
*/
|
|
|
|
vector<string> split(const string& str, const char delimiter);
|
2016-09-07 18:43:49 -07:00
|
|
|
|
2017-11-01 17:08:27 -07:00
|
|
|
/**
|
|
|
|
* Returns the rest of str if it has prefix, otherwise return all.
|
|
|
|
*/
|
|
|
|
string stripPrefix(const string& str, const string& prefix);
|
|
|
|
|
2017-10-09 11:21:40 -07:00
|
|
|
} // namespace stream_proto
|
2016-09-07 18:43:49 -07:00
|
|
|
} // namespace android
|
|
|
|
|