webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
Public Member Functions | |
def | __init__ (self, out, indent=0, as_utf8=False, as_one_line=False, pointy_brackets=False, use_index_order=False, float_format=None, use_field_number=False) |
def | PrintMessage (self, message) |
def | PrintField (self, field, value) |
def | PrintFieldValue (self, field, value) |
Public Attributes | |
out | |
indent | |
as_utf8 | |
as_one_line | |
pointy_brackets | |
use_index_order | |
float_format | |
use_field_number | |
Text format printer for protocol message.
def google.protobuf.text_format._Printer.__init__ | ( | self, | |
out, | |||
indent = 0 , |
|||
as_utf8 = False , |
|||
as_one_line = False , |
|||
pointy_brackets = False , |
|||
use_index_order = False , |
|||
float_format = None , |
|||
use_field_number = False |
|||
) |
Initialize the Printer. Floating point values can be formatted compactly with 15 digits of precision (which is the most that IEEE 754 "double" can guarantee) using float_format='.15g'. To ensure that converting to text and back to a proto will result in an identical value, float_format='.17g' should be used. Args: out: To record the text format result. indent: The indent level for pretty print. as_utf8: Produce text output in UTF8 format. as_one_line: Don't introduce newlines between fields. pointy_brackets: If True, use angle brackets instead of curly braces for nesting. use_index_order: If True, print fields of a proto message using the order defined in source code instead of the field number. By default, use the field number order. float_format: If set, use this to specify floating point number formatting (per the "Format Specification Mini-Language"); otherwise, str() is used. use_field_number: If True, print field numbers instead of names.
def google.protobuf.text_format._Printer.PrintField | ( | self, | |
field, | |||
value | |||
) |
Print a single field name/value pair.
def google.protobuf.text_format._Printer.PrintFieldValue | ( | self, | |
field, | |||
value | |||
) |
Print a single field value (not including name). For repeated fields, the value should be a single element. Args: field: The descriptor of the field to be printed. value: The value of the field.
def google.protobuf.text_format._Printer.PrintMessage | ( | self, | |
message | |||
) |
Convert protobuf message to text format. Args: message: The protocol buffers message.
google.protobuf.text_format._Printer.as_one_line |
google.protobuf.text_format._Printer.as_utf8 |
google.protobuf.text_format._Printer.float_format |
google.protobuf.text_format._Printer.indent |
google.protobuf.text_format._Printer.out |
google.protobuf.text_format._Printer.pointy_brackets |
google.protobuf.text_format._Printer.use_field_number |
google.protobuf.text_format._Printer.use_index_order |