summaryrefslogtreecommitdiffstats
path: root/chromium/tools/json_schema_compiler/cpp_util.py
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2014-03-18 13:16:26 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-03-20 15:55:39 +0100
commit3f0f86b0caed75241fa71c95a5d73bc0164348c5 (patch)
tree92b9fb00f2e9e90b0be2262093876d4f43b6cd13 /chromium/tools/json_schema_compiler/cpp_util.py
parente90d7c4b152c56919d963987e2503f9909a666d2 (diff)
Update to new stable branch 1750
This also includes an updated ninja and chromium dependencies needed on Windows. Change-Id: Icd597d80ed3fa4425933c9f1334c3c2e31291c42 Reviewed-by: Zoltan Arvai <zarvai@inf.u-szeged.hu> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'chromium/tools/json_schema_compiler/cpp_util.py')
-rw-r--r--chromium/tools/json_schema_compiler/cpp_util.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/chromium/tools/json_schema_compiler/cpp_util.py b/chromium/tools/json_schema_compiler/cpp_util.py
index 2d493439344..1e7c3707883 100644
--- a/chromium/tools/json_schema_compiler/cpp_util.py
+++ b/chromium/tools/json_schema_compiler/cpp_util.py
@@ -24,6 +24,10 @@ GENERATED_BUNDLE_FILE_MESSAGE = """// GENERATED FROM THE API DEFINITIONS IN
// %s
// DO NOT EDIT.
"""
+GENERATED_FEATURE_MESSAGE = """// GENERATED FROM THE FEATURE DEFINITIONS IN
+// %s
+// DO NOT EDIT.
+"""
def Classname(s):
"""Translates a namespace name or function name into something more
@@ -118,3 +122,18 @@ def CloseNamespace(namespace):
for component in reversed(namespace.split('::')):
c.Append('} // namespace %s' % component)
return c
+
+
+def ConstantName(feature_name):
+ """Returns a kName for a feature's name.
+ """
+ return ('k' + ''.join(word[0].upper() + word[1:]
+ for word in feature_name.replace('.', ' ').split()))
+
+
+def CamelCase(unix_name):
+ return ''.join(word.capitalize() for word in unix_name.split('_'))
+
+
+def ClassName(filepath):
+ return CamelCase(os.path.split(filepath)[1])