Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1305)

Unified Diff: tools/json_schema_compiler/cpp_util.py

Issue 23594008: Initial code generation for features. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Adding tests for real. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/json_schema_compiler/cpp_util.py
diff --git a/tools/json_schema_compiler/cpp_util.py b/tools/json_schema_compiler/cpp_util.py
index 2d4934393443e25ebcfb29986c9b2d49a265e18a..96e338593cf96dbcdb248f3c0c1f762278e09541 100644
--- a/tools/json_schema_compiler/cpp_util.py
+++ b/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,10 @@ 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()))

Powered by Google App Engine
This is Rietveld 408576698