tools/json_schema_compiler/cpp_util.py
def GetAsFundamentalValue(type_, src):
  """Returns the C++ code for retrieving a fundamental type from a
  Value into a variable.

  src: Value
  """
  if type_.property_type == PropertyType.BOOLEAN:
    s = '%s.GetIfBool()'
  elif type_.property_type == PropertyType.DOUBLE:
    s = '%s.GetIfDouble()'
  elif type_.property_type == PropertyType.INTEGER:
    s = '%s.GetIfInt()'
  elif (type_.property_type == PropertyType.STRING or
      (type_.property_type == PropertyType.FUNCTION and
           type_.is_serializable_function)):
    s = '%s.GetIfString()'
  else:
    raise ValueError('Type %s is not a fundamental value' % type_.name)

  return s % src
Returns the C++ code for retrieving a fundamental type from a
  Value into a variable.

  src: Value
  
Returns the C++ code for retrieving a fundamental type from a
Value into a variable.

Value
Returns the C ++ code for retrieving a fundamental type from a Value into a variable . Value
def GetAsFundamentalValue(type_, src):
  if type_.property_type == PropertyType.BOOLEAN:
    s = '%s.GetIfBool()'
  elif type_.property_type == PropertyType.DOUBLE:
    s = '%s.GetIfDouble()'
  elif type_.property_type == PropertyType.INTEGER:
    s = '%s.GetIfInt()'
  elif (type_.property_type == PropertyType.STRING or
      (type_.property_type == PropertyType.FUNCTION and
           type_.is_serializable_function)):
    s = '%s.GetIfString()'
  else:
    raise ValueError('Type %s is not a fundamental value' % type_.name)
  return s % src
def GetAsFundamentalValue ( type_ , src ) : if type_ . property_type == PropertyType . BOOLEAN : s = '%s.GetIfBool()' elif type_ . property_type == PropertyType . DOUBLE : s = '%s.GetIfDouble()' elif type_ . property_type == PropertyType . INTEGER : s = '%s.GetIfInt()' elif ( type_ . property_type == PropertyType . STRING or ( type_ . property_type == PropertyType . FUNCTION and type_ . is_serializable_function ) ) : s = '%s.GetIfString()' else : raise ValueError ( 'Type %s is not a fundamental value' % type_ . name ) return s % src
Returns the C++ code for retrieving a fundamental type from a
Value into a variable.
Returns the C ++ code for retrieving a fundamental type from a Value into a variable .
"""Returns the C++ code for retrieving a fundamental type from a
  Value into a variable.

  src: Value
  """
type_
src