tools/json_schema_compiler/features_h_generator.py
def Generate(self):
    """Generates a Code object for features.
    """
    c = Code()
    (c.Append(cpp_util.CHROMIUM_LICENSE)
      .Append()
      .Append(cpp_util.GENERATED_FEATURE_MESSAGE %
              cpp_util.ToPosixPath(self._source_file))
      .Append()
    )

    # Hack: for the purpose of gyp the header file will always be the source
    # file with its file extension replaced by '.h'. Assume so.
    output_file = os.path.splitext(self._namespace.source_file)[0] + '.h'
    ifndef_name = cpp_util.GenerateIfndefName(output_file)

    (c.Append('#ifndef %s' % ifndef_name)
      .Append('#define %s' % ifndef_name)
      .Append()
    )

    (c.Append('#include <map>')
      .Append('#include <string>')
      .Append()
      .Concat(cpp_util.OpenNamespace(self._namespace))
      .Append()
    )

    (c.Append('class %s {' % self._class_name)
      .Append(' public:')
      .Sblock()
      .Concat(self._GeneratePublicBody())
      .Eblock()
      .Append(' private:')
      .Sblock()
      .Concat(self._GeneratePrivateBody())
      .Eblock('};')
      .Append()
      .Cblock(cpp_util.CloseNamespace(self._namespace))
    )
    (c.Append('#endif  // %s' % ifndef_name)
      .Append()
    )
    return c
Generates a Code object for features.
    
Generates a Code object for features.
Generates a Code object for features .
def Generate(self):
    c = Code()
    (c.Append(cpp_util.CHROMIUM_LICENSE)
      .Append()
      .Append(cpp_util.GENERATED_FEATURE_MESSAGE %
              cpp_util.ToPosixPath(self._source_file))
      .Append()
    )
    output_file = os.path.splitext(self._namespace.source_file)[0] + '.h'
    ifndef_name = cpp_util.GenerateIfndefName(output_file)
    (c.Append('#ifndef %s' % ifndef_name)
      .Append('#define %s' % ifndef_name)
      .Append()
    )
    (c.Append('#include <map>')
      .Append('#include <string>')
      .Append()
      .Concat(cpp_util.OpenNamespace(self._namespace))
      .Append()
    )
    (c.Append('class %s {' % self._class_name)
      .Append(' public:')
      .Sblock()
      .Concat(self._GeneratePublicBody())
      .Eblock()
      .Append(' private:')
      .Sblock()
      .Concat(self._GeneratePrivateBody())
      .Eblock('};')
      .Append()
      .Cblock(cpp_util.CloseNamespace(self._namespace))
    )
    (c.Append('#endif  // %s' % ifndef_name)
      .Append()
    )
    return c
def Generate ( self ) : c = Code ( ) ( c . Append ( cpp_util . CHROMIUM_LICENSE ) . Append ( ) . Append ( cpp_util . GENERATED_FEATURE_MESSAGE % cpp_util . ToPosixPath ( self . _source_file ) ) . Append ( ) ) output_file = os . path . splitext ( self . _namespace . source_file ) [ 0 ] + '.h' ifndef_name = cpp_util . GenerateIfndefName ( output_file ) ( c . Append ( '#ifndef %s' % ifndef_name ) . Append ( '#define %s' % ifndef_name ) . Append ( ) ) ( c . Append ( '#include <map>' ) . Append ( '#include <string>' ) . Append ( ) . Concat ( cpp_util . OpenNamespace ( self . _namespace ) ) . Append ( ) ) ( c . Append ( 'class %s {' % self . _class_name ) . Append ( ' public:' ) . Sblock ( ) . Concat ( self . _GeneratePublicBody ( ) ) . Eblock ( ) . Append ( ' private:' ) . Sblock ( ) . Concat ( self . _GeneratePrivateBody ( ) ) . Eblock ( '};' ) . Append ( ) . Cblock ( cpp_util . CloseNamespace ( self . _namespace ) ) ) ( c . Append ( '#endif  // %s' % ifndef_name ) . Append ( ) ) return c
Generates a Code object for features.
Generates a Code object for features .
"""Generates a Code object for features.
    """ # Hack: for the purpose of gyp the header file will always be the source # file with its file extension replaced by '.h'. Assume so.
self