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

Side by Side Diff: tools/json_schema_compiler/cc_generator.py

Issue 10272021: Files generated by the JSON schema compiler are named incorrectly (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Minor changes Created 8 years, 7 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 unified diff | Download patch
« no previous file with comments | « chrome/common/extensions_api_resources.grd ('k') | tools/json_schema_compiler/compiler.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from code import Code 5 from code import Code
6 from model import PropertyType 6 from model import PropertyType
7 import any_helper 7 import any_helper
8 import cpp_util 8 import cpp_util
9 import model 9 import model
10 import schema_util 10 import schema_util
(...skipping 15 matching lines...) Expand all
26 def Generate(self): 26 def Generate(self):
27 """Generates a Code object with the .cc for a single namespace. 27 """Generates a Code object with the .cc for a single namespace.
28 """ 28 """
29 c = Code() 29 c = Code()
30 (c.Append(cpp_util.CHROMIUM_LICENSE) 30 (c.Append(cpp_util.CHROMIUM_LICENSE)
31 .Append() 31 .Append()
32 .Append(cpp_util.GENERATED_FILE_MESSAGE % self._namespace.source_file) 32 .Append(cpp_util.GENERATED_FILE_MESSAGE % self._namespace.source_file)
33 .Append() 33 .Append()
34 .Append(self._util_cc_helper.GetIncludePath()) 34 .Append(self._util_cc_helper.GetIncludePath())
35 .Append('#include "%s/%s.h"' % 35 .Append('#include "%s/%s.h"' %
36 (self._namespace.source_file_dir, self._namespace.name)) 36 (self._namespace.source_file_dir, self._namespace.unix_name))
37 ) 37 )
38 includes = self._cpp_type_generator.GenerateIncludes() 38 includes = self._cpp_type_generator.GenerateIncludes()
39 if not includes.IsEmpty(): 39 if not includes.IsEmpty():
40 (c.Concat(includes) 40 (c.Concat(includes)
41 .Append() 41 .Append()
42 ) 42 )
43 43
44 (c.Append() 44 (c.Append()
45 .Append('using base::Value;') 45 .Append('using base::Value;')
46 .Append('using base::DictionaryValue;') 46 .Append('using base::DictionaryValue;')
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 """ 660 """
661 return (self._cpp_type_generator.GetReferencedProperty(prop).type_ == 661 return (self._cpp_type_generator.GetReferencedProperty(prop).type_ ==
662 PropertyType.ARRAY) 662 PropertyType.ARRAY)
663 663
664 def _IsFundamentalOrFundamentalRef(self, prop): 664 def _IsFundamentalOrFundamentalRef(self, prop):
665 """Determines if this property is a Fundamental type or is a ref to a 665 """Determines if this property is a Fundamental type or is a ref to a
666 Fundamental type. 666 Fundamental type.
667 """ 667 """
668 return (self._cpp_type_generator.GetReferencedProperty(prop).type_. 668 return (self._cpp_type_generator.GetReferencedProperty(prop).type_.
669 is_fundamental) 669 is_fundamental)
OLDNEW
« no previous file with comments | « chrome/common/extensions_api_resources.grd ('k') | tools/json_schema_compiler/compiler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698