Yi Jin e2f7f79d02 Implement Cpu Info Section
Support carriage return in Read class, and add a new way to parse lines
which is not able to split purly by delimiters

Bug: 65642861
Test: unit test and on device test
Change-Id: Ib82dd4e458bb7d2fa33462b23fbe11b828325916
2017-11-10 17:34:07 -08:00

46 lines
1017 B
C++

#include <string>
#include <vector>
namespace android {
namespace stream_proto {
using namespace std;
// Indent
const string INDENT = " ";
/**
* 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);
/**
* Replaces all occurances of 'replace' with 'with'.
*/
string replace_string(const string& str, const char replace, const char with);
/**
* Splits a string to parts by delimiter.
*/
vector<string> split(const string& str, const char delimiter);
/**
* Returns the rest of str if it has prefix, otherwise return all.
*/
string stripPrefix(const string& str, const string& prefix);
} // namespace stream_proto
} // namespace android