Beispiel #1
0
  def __init__(self, trans, strictRead=False, strictWrite=True):
    TProtocolBase.__init__(self, trans)
    sandesh_logger = SandeshLogger('TXMLProtocol')
    self._logger = sandesh_logger.logger()
    self._field_typename_dict = {
      TType.BOOL : self._XML_TYPENAME_BOOL,
      TType.BYTE : self._XML_TYPENAME_BYTE,
      TType.I16 : self._XML_TYPENAME_I16,
      TType.I32 : self._XML_TYPENAME_I32,
      TType.I64 : self._XML_TYPENAME_I64,
      TType.U16 : self._XML_TYPENAME_U16,
      TType.U32 : self._XML_TYPENAME_U32,
      TType.U64 : self._XML_TYPENAME_U64,
      TType.IPV4 : self._XML_TYPENAME_IPV4,
      TType.DOUBLE : self._XML_TYPENAME_DOUBLE,
      TType.STRING : self._XML_TYPENAME_STRING,
      TType.STRUCT : self._XML_TYPENAME_STRUCT,
      TType.MAP : self._XML_TYPENAME_MAP,
      TType.SET : self._XML_TYPENAME_SET,
      TType.LIST : self._XML_TYPENAME_LIST,
      TType.SANDESH : self._XML_TYPENAME_SANDESH,
      TType.XML : self._XML_TYPENAME_XML,
      TType.UUID : self._XML_TYPENAME_UUID,
    }

    self._field_type_dict = {}
    # Now, interchange key and value
    for key, value in self._field_typename_dict.iteritems():
      self._field_type_dict[value] = key

    self._xml_tag = []
Beispiel #2
0
 def __init__(self, trans):
   self._trans = trans
   sandesh_logger = SandeshLogger('XMLReader')
   self._logger = sandesh_logger.logger()
   self._read_buf = self._trans.getvalue()
   assert self._read_buf, 'XMLReader: No data to read'