Esempio n. 1
0
 def __inflated(self):
     if self.__inflated_doc is None:
         # We already validated the object's size when this document was
         # created, so no need to do that again.
         self.__inflated_doc = dict(
             element for element in _iterate_elements(
                 self.__raw, 4, _UNPACK_INT(self.__raw[:4])[0] - 1,
                 self.__codec_options))
     return self.__inflated_doc
Esempio n. 2
0
 def __inflated(self):
     if self.__inflated_doc is None:
         # We already validated the object's size when this document was
         # created, so no need to do that again.
         self.__inflated_doc = dict(
             element for element in _iterate_elements(
                 self.__raw, 4,
                 _UNPACK_INT(self.__raw[:4])[0] - 1, self.__codec_options))
     return self.__inflated_doc
Esempio n. 3
0
 def __inflated(self):
     if self.__inflated_doc is None:
         # We already validated the object's size when this document was
         # created, so no need to do that again. We still need to check the
         # size of all the elements and compare to the document size.
         object_size = _UNPACK_INT(self.__raw[:4])[0] - 1
         position = 0
         self.__inflated_doc = {}
         for key, value, position in _iterate_elements(
                 self.__raw, 4, object_size, self.__codec_options):
             self.__inflated_doc[key] = value
         if position != object_size:
             raise InvalidBSON('bad object or element length')
     return self.__inflated_doc
Esempio n. 4
0
 def __inflated(self):
     if self.__inflated_doc is None:
         # We already validated the object's size when this document was
         # created, so no need to do that again. We still need to check the
         # size of all the elements and compare to the document size.
         object_size = _UNPACK_INT(self.__raw[:4])[0] - 1
         position = 0
         self.__inflated_doc = {}
         for key, value, position in _iterate_elements(
                 self.__raw, 4, object_size, self.__codec_options):
             self.__inflated_doc[key] = value
         if position != object_size:
             raise InvalidBSON('bad object or element length')
     return self.__inflated_doc