Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2021-09-23 17:06:25 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-09-23 17:06:25 +0300
commit490425d56e7bc48c6ebf8440e3463ff6a3a5a954 (patch)
tree2216bbc069ea392c5eaa94f7dcfac2862b29563c /source/blender/blenkernel/BKE_asset_catalog.hh
parentaa2493e2e7e6be645d352f53d30a1e018b8a677a (diff)
Asset Catalogs: explicit version number in catalog definition files
Declare the current format used for asset catalog definition files as version 1, and write that to the files. Files without that version number will be rejected. This makes it much easier to move to different versions later, with the opportunity to do versioning on file load. The version is not associated with any version of Blender, but a separate integer that's simply incremented when a non-backward-compatible change happens.
Diffstat (limited to 'source/blender/blenkernel/BKE_asset_catalog.hh')
-rw-r--r--source/blender/blenkernel/BKE_asset_catalog.hh6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_asset_catalog.hh b/source/blender/blenkernel/BKE_asset_catalog.hh
index 2bbaa4b4222..0401fae7126 100644
--- a/source/blender/blenkernel/BKE_asset_catalog.hh
+++ b/source/blender/blenkernel/BKE_asset_catalog.hh
@@ -172,6 +172,11 @@ class AssetCatalogTree {
* class is shorter than that of the #`AssetCatalog`s themselves. */
class AssetCatalogDefinitionFile {
public:
+ /* For now this is the only version of the catalog definition files that is supported.
+ * Later versioning code may be added to handle older files. */
+ const static int SUPPORTED_VERSION;
+ const static std::string VERSION_MARKER;
+
CatalogFilePath file_path;
AssetCatalogDefinitionFile() = default;
@@ -203,6 +208,7 @@ class AssetCatalogDefinitionFile {
* catalog is already known, without having to find the corresponding `AssetCatalog*`. */
Map<CatalogID, AssetCatalog *> catalogs_;
+ bool parse_version_line(StringRef line);
std::unique_ptr<AssetCatalog> parse_catalog_line(StringRef line);
/**