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-28 18:47:16 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-09-28 18:47:34 +0300
commit10d926cd4aae8b74e0b85d00d899643a0ff113cb (patch)
tree4665f30e954e8b6348859794096557cbbca90152 /source/blender/blenkernel/intern/asset_catalog.cc
parent3acf3e9e2ff5bb8a93fcad2df925058d3e7ee748 (diff)
Cleanup: asset catalogs, move file header definition to constant
Define the standard catalog definition file header in a constant, separating it from the function that writes the entire file. No functional changes.
Diffstat (limited to 'source/blender/blenkernel/intern/asset_catalog.cc')
-rw-r--r--source/blender/blenkernel/intern/asset_catalog.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/asset_catalog.cc b/source/blender/blenkernel/intern/asset_catalog.cc
index d98d83c477f..e16537fcb7f 100644
--- a/source/blender/blenkernel/intern/asset_catalog.cc
+++ b/source/blender/blenkernel/intern/asset_catalog.cc
@@ -48,6 +48,13 @@ const int AssetCatalogDefinitionFile::SUPPORTED_VERSION = 1;
* that starts with "VERSION". */
const std::string AssetCatalogDefinitionFile::VERSION_MARKER = "VERSION ";
+const std::string AssetCatalogDefinitionFile::HEADER =
+ "# This is an Asset Catalog Definition file for Blender.\n"
+ "#\n"
+ "# Empty lines and lines starting with `#` will be ignored.\n"
+ "# The first non-ignored line should be the version indicator.\n"
+ "# Other lines are of the format \"UUID:catalog/path/for/assets:simple catalog name\"\n";
+
AssetCatalogService::AssetCatalogService(const CatalogFilePath &asset_library_root)
: asset_library_root_(asset_library_root)
{
@@ -652,13 +659,7 @@ bool AssetCatalogDefinitionFile::write_to_disk_unsafe(const CatalogFilePath &des
// the file again.
// Write the header.
- // TODO(@sybren): move the header definition to some other place.
- output << "# This is an Asset Catalog Definition file for Blender." << std::endl;
- output << "#" << std::endl;
- output << "# Empty lines and lines starting with `#` will be ignored." << std::endl;
- output << "# The first non-ignored line should be the version indicator." << std::endl;
- output << "# Other lines are of the format \"UUID:catalog/path/for/assets:simple catalog name\""
- << std::endl;
+ output << HEADER;
output << "" << std::endl;
output << VERSION_MARKER << SUPPORTED_VERSION << std::endl;
output << "" << std::endl;