Package google :: Package protobuf :: Module text_format
[frames] | no frames]

Module text_format

source code

Contains routines for printing protocol messages in text format.


Author: kenton@google.com (Kenton Varda)

Functions
 
MessageToString(message, as_utf8=False, as_one_line=False) source code
 
PrintMessage(message, out, indent=0, as_utf8=False, as_one_line=False) source code
 
PrintField(field, value, out, indent=0, as_utf8=False, as_one_line=False)
Print a single field name/value pair.
source code
 
PrintFieldValue(field, value, out, indent=0, as_utf8=False, as_one_line=False)
Print a single field value (not including name).
source code
 
Merge(text, message)
Merges an ASCII representation of a protocol message into a message.
source code
Function Details

PrintField(field, value, out, indent=0, as_utf8=False, as_one_line=False)

source code 

Print a single field name/value pair. For repeated fields, the value should be a single element.

PrintFieldValue(field, value, out, indent=0, as_utf8=False, as_one_line=False)

source code 

Print a single field value (not including name). For repeated fields, the value should be a single element.

Merge(text, message)

source code 
Merges an ASCII representation of a protocol message into a message.

Args:
  text: Message ASCII representation.
  message: A protocol buffer message to merge into.

Raises:
  ParseError: On ASCII parsing problems.