From faa606e6e93b237202d74741c739e22dfd254903 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Wed, 12 Feb 2014 03:06:32 +0000 Subject: [PATCH] Add a version field for compression type. Signed-off-by: brian m. carlson --- lib/newfol/database.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/newfol/database.py b/lib/newfol/database.py index 062f94b..1ffb0f3 100644 --- a/lib/newfol/database.py +++ b/lib/newfol/database.py @@ -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