tools/json_to_struct/element_generator.py
def _GenerateStruct(element_name, field_info, content, lines, indent,
                    field_name_count):
  """Generates a struct to be included in a static structure initializer. If
  content is not specified, uses {0}.
  """
  if content is None:
    lines.append(indent + '{0},')
    return

  fields = field_info['fields']
  lines.append(indent + '{')
  for field in fields:
    subcontent = content.get(field['field'])
    GenerateFieldContent(element_name, field, subcontent, lines, '  ' + indent,
                         field_name_count)
  lines.append(indent + '},')
Generates a struct to be included in a static structure initializer. If
  content is not specified, uses {0}.
  
Generates a struct to be included in a static structure initializer. If
content is not specified, uses {0}.
Generates a struct to be included in a static structure initializer . If content is not specified uses { 0 } .
def _GenerateStruct(element_name, field_info, content, lines, indent,
                    field_name_count):
  if content is None:
    lines.append(indent + '{0},')
    return
  fields = field_info['fields']
  lines.append(indent + '{')
  for field in fields:
    subcontent = content.get(field['field'])
    GenerateFieldContent(element_name, field, subcontent, lines, '  ' + indent,
                         field_name_count)
  lines.append(indent + '},')
def _GenerateStruct ( element_name , field_info , content , lines , indent , field_name_count ) : if content is None : lines . append ( indent + '{0},' ) return fields = field_info [ 'fields' ] lines . append ( indent + '{' ) for field in fields : subcontent = content . get ( field [ 'field' ] ) GenerateFieldContent ( element_name , field , subcontent , lines , '  ' + indent , field_name_count ) lines . append ( indent + '},' )
Generates a struct to be included in a static structure initializer.
Generates a struct to be included in a static structure initializer .
"""Generates a struct to be included in a static structure initializer. If
  content is not specified, uses {0}.
  """
element_name
field_info
content
lines
indent
field_name_count