diff options
author | Vitaly Buka <vitalybuka@chromium.org> | 2015-03-10 19:33:33 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-03-13 11:31:13 +0000 |
commit | 1b6aa986ce3143dd2fe9c9ccc180f8ea9afba1e5 (patch) | |
tree | 35f51f61e8b950ef23c8a7e982558329862a74b7 | |
parent | 1485624e77ed53a3beba5ab6433b26f31f3607a2 (diff) | |
download | dbus-binding-generator-1b6aa986ce3143dd2fe9c9ccc180f8ea9afba1e5.tar.gz |
libchromeos: Replace char with std::string in string_utils API
std::string version of functions is enough to cover char use cases.
C library was replaced with STL in Split and SplitAtFirst implementations.
Added support of splitting by empty string. Uses but reasonable implementation
is simple.
BUG=none
TEST=unittests
Change-Id: I0778722d31a7b06eea2227b4d94991ab194195cb
Reviewed-on: https://chromium-review.googlesource.com/258640
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
Tested-by: Vitaly Buka <vitalybuka@chromium.org>
-rw-r--r-- | chromeos-dbus-bindings/indented_text.cc | 2 | ||||
-rw-r--r-- | chromeos-dbus-bindings/name_parser.cc | 2 | ||||
-rw-r--r-- | chromeos-dbus-bindings/xml_interface_parser.cc | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/chromeos-dbus-bindings/indented_text.cc b/chromeos-dbus-bindings/indented_text.cc index a261fb4..97e1875 100644 --- a/chromeos-dbus-bindings/indented_text.cc +++ b/chromeos-dbus-bindings/indented_text.cc @@ -61,7 +61,7 @@ void IndentedText::AddComments(const std::string& doc_string) { // For all subsequent lines, remove the same whitespace prefix as found // at the first line of the comment but keep any additional spaces to // maintain the comment layout. - auto lines = chromeos::string_utils::Split(doc_string, '\n', false, false); + auto lines = chromeos::string_utils::Split(doc_string, "\n", false, false); vector<string> lines_out; lines_out.reserve(lines.size()); bool first_nonempty_found = false; diff --git a/chromeos-dbus-bindings/name_parser.cc b/chromeos-dbus-bindings/name_parser.cc index f920c04..35cbb61 100644 --- a/chromeos-dbus-bindings/name_parser.cc +++ b/chromeos-dbus-bindings/name_parser.cc @@ -27,7 +27,7 @@ void AddCloseNamespace(IndentedText *text, const std::string& name) { } // anonymous namespace NameParser::NameParser(const std::string& name) - : namespaces{chromeos::string_utils::Split(name, '.')} { + : namespaces{chromeos::string_utils::Split(name, ".")} { CHECK(!namespaces.empty()) << "Empty name specified"; type_name = namespaces.back(); namespaces.pop_back(); diff --git a/chromeos-dbus-bindings/xml_interface_parser.cc b/chromeos-dbus-bindings/xml_interface_parser.cc index 3fb71a3..cb07e31 100644 --- a/chromeos-dbus-bindings/xml_interface_parser.cc +++ b/chromeos-dbus-bindings/xml_interface_parser.cc @@ -53,7 +53,7 @@ const char XmlInterfaceParser::kMethodKindRaw[] = "raw"; namespace { string GetElementPath(const vector<string>& path) { - return chromeos::string_utils::Join('/', path); + return chromeos::string_utils::Join("/", path); } } // anonymous namespace |