summaryrefslogtreecommitdiff
path: root/chromeos-dbus-bindings/header_generator.h
diff options
context:
space:
mode:
authorAlex Vakulenko <avakulenko@chromium.org>2014-12-01 12:51:07 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-12-03 05:02:58 +0000
commit355d7ceb80c699ecfa0bfe7d08f134801037ac9d (patch)
treed9562dae254d46f629695386d55d83ee02d9bc9a /chromeos-dbus-bindings/header_generator.h
parent0a86514094bf9ed17f7cd576a41edf723d4a7b30 (diff)
downloaddbus-binding-generator-355d7ceb80c699ecfa0bfe7d08f134801037ac9d.tar.gz
chromeos-dbus-bindings: Extract common code into functions
Moved common code used to parse D-Bus object/interface names such as "org.chromium.TestInterface" into a class, NameParser. This allows it to be used to extract the nested namespaces, produce properly-formed variable names and so on. Did the same with generating const references for non-integral types. BUG=chromium:431737 TEST=FEATURES=test emerge-link chromeos-dbus-bindings Change-Id: I011639b9c7c355fd0e693b200840811a6e3c33ca Reviewed-on: https://chromium-review.googlesource.com/232404 Reviewed-by: Vitaly Buka <vitalybuka@chromium.org> Tested-by: Alex Vakulenko <avakulenko@chromium.org> Reviewed-by: Christopher Wiley <wiley@chromium.org> Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Diffstat (limited to 'chromeos-dbus-bindings/header_generator.h')
-rw-r--r--chromeos-dbus-bindings/header_generator.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/chromeos-dbus-bindings/header_generator.h b/chromeos-dbus-bindings/header_generator.h
index 938e93b..55b1265 100644
--- a/chromeos-dbus-bindings/header_generator.h
+++ b/chromeos-dbus-bindings/header_generator.h
@@ -30,19 +30,12 @@ class HeaderGenerator {
// Create a unique header guard string to protect multiple includes of header.
static std::string GenerateHeaderGuard(const base::FilePath& output_file);
- // Returns a vector of nesting namespaces.
- static bool GetNamespacesAndClassName(const std::string& interface_name,
- std::vector<std::string>* namespaces,
- std::string* class_name);
-
- // Returns a fully-qualified class name like "ns1::ns2::class_name".
- static std::string GetFullClassName(
- const std::vector<std::string>& namespaces,
- const std::string& class_name);
-
// Used to decide whether the argument should be a const reference.
static bool IsIntegralType(const std::string& type);
+ // If |type| is a non-integral type, converts it into a const reference.
+ static void MakeConstReferenceIfNeeded(std::string* type);
+
// Writes indented text to a file.
static bool WriteTextToFile(const base::FilePath& output_file,
const IndentedText& text);