Browse Source

Add 'hasFeature' method for convenience

Ivan Savenko 1 year ago
parent
commit
5b182c31df
2 changed files with 10 additions and 0 deletions
  1. 5 0
      lib/serializer/BinaryDeserializer.h
  2. 5 0
      lib/serializer/BinarySerializer.h

+ 5 - 0
lib/serializer/BinaryDeserializer.h

@@ -162,6 +162,11 @@ public:
 	bool smartPointerSerialization;
 	bool saving;
 
+	bool hasFeature(Version what)
+	{
+		return version >= what;
+	};
+
 	BinaryDeserializer(IBinaryReader * r);
 
 	template<class T>

+ 5 - 0
lib/serializer/BinarySerializer.h

@@ -119,6 +119,11 @@ public:
 	bool smartPointerSerialization;
 	bool saving;
 
+	bool hasFeature(Version what)
+	{
+		return version >= what;
+	};
+
 	BinarySerializer(IBinaryWriter * w);
 
 	template<typename Base, typename Derived>