Add a version field for compression type.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
This commit is contained in:
brian m. carlson 2014-02-12 03:06:32 +00:00
parent 24f1e7728b
commit faa606e6e9
No known key found for this signature in database
GPG key ID: BF535D811F52F68B

View file

@ -24,6 +24,12 @@ class DatabaseVersion(int):
def version_version(self):
"""The version for the meaning of the bits in this integer."""
return (int(self) & 0xff000000) >> 24
def compression_version(self):
"""The value indicating the format in which the data is compressed."""
return (int(self) & 0xff0000) >> 16
def compression(self):
"""A string indicating the format in which the data is compressed."""
return ("none", "xz")[self.compression_version()]
def serialization_version(self):
"""The value indicating the format in which the data is serialized."""
return (int(self) & 0xff00) >> 8