(self, the_api)
Annotate a Api with C++ specific elements.
Annotate a Api with C++ specific elements.
Annotate a Api with C ++ specific elements .
def AnnotateApi(self, the_api):
    """Annotate a Api with C++ specific elements."""
    super(CppGenerator, self).AnnotateApi(the_api)
    if the_api.values.get('version') and self._options.get('version_package'):
      the_api.module.SetPath('%s_%s' % (
          the_api.module.package_path, the_api.values.get('versionNoDots')))

    for schema in the_api.TopLevelModelClasses():
      filename = utilities.UnCamelCase(schema.class_name)
      schema.SetTemplateValue('filename', filename)
      schema.SetTemplateValue(
          'include_path',
          self._HeaderFileName(schema.module.path, schema.values['filename']))
      include_guard = '%s_%s_H_' % (the_api.module.name, filename)
      schema.SetTemplateValue('include_guard', include_guard.upper())

    the_api.SetTemplateValue('filename',
                             utilities.UnCamelCase(the_api.class_name))
    the_api.SetTemplateValue(
        'include_path',
        self._HeaderFileName(the_api.module.path, the_api.values['filename']))

    monolithic_source_name = the_api.GetTemplateValue('monolithicSourceName')
    if monolithic_source_name:
      the_api.SetTemplateValue('kitchensink', monolithic_source_name)
    else:
      plain_api_filename = utilities.UnCamelCase(the_api.values['name'])
      the_api.SetTemplateValue('kitchensink', '%s_api' % plain_api_filename)

    authscopes = the_api.values.get('authscopes')
    if authscopes:
      for scope in authscopes:
        self.AnnotateDocumentation(scope)

    self.AnnotateDocumentation(the_api)
def AnnotateApi ( self , the_api ) : super ( CppGenerator , self ) . AnnotateApi ( the_api ) if the_api . values . get ( 'version' ) and self . _options . get ( 'version_package' ) : the_api . module . SetPath ( '%s_%s' % ( the_api . module . package_path , the_api . values . get ( 'versionNoDots' ) ) ) for schema in the_api . TopLevelModelClasses ( ) : filename = utilities . UnCamelCase ( schema . class_name ) schema . SetTemplateValue ( 'filename' , filename ) schema . SetTemplateValue ( 'include_path' , self . _HeaderFileName ( schema . module . path , schema . values [ 'filename' ] ) ) include_guard = '%s_%s_H_' % ( the_api . module . name , filename ) schema . SetTemplateValue ( 'include_guard' , include_guard . upper ( ) ) the_api . SetTemplateValue ( 'filename' , utilities . UnCamelCase ( the_api . class_name ) ) the_api . SetTemplateValue ( 'include_path' , self . _HeaderFileName ( the_api . module . path , the_api . values [ 'filename' ] ) ) monolithic_source_name = the_api . GetTemplateValue ( 'monolithicSourceName' ) if monolithic_source_name : the_api . SetTemplateValue ( 'kitchensink' , monolithic_source_name ) else : plain_api_filename = utilities . UnCamelCase ( the_api . values [ 'name' ] ) the_api . SetTemplateValue ( 'kitchensink' , '%s_api' % plain_api_filename ) authscopes = the_api . values . get ( 'authscopes' ) if authscopes : for scope in authscopes : self . AnnotateDocumentation ( scope ) self . AnnotateDocumentation ( the_api )