Page MenuHome

Asset Catalog Path class
ClosedPublic

Authored by Sybren A. Stüvel (sybren) on Sep 30 2021, 2:38 PM.

Details

Summary

So far we have used std::string for asset catalog paths. Some operations
are better described on a dedicated class for this, though.

Diff Detail

Repository
rB Blender
Branch
temp-asset-catalog-path (branched from master)
Build Status
Buildable 17466
Build 17466: arc lint + arc unit

Event Timeline

Sybren A. Stüvel (sybren) requested review of this revision.Sep 30 2021, 2:38 PM
Sybren A. Stüvel (sybren) created this revision.
source/blender/blenkernel/BKE_asset_catalog_path.hh
48

Maybe comment on how encoding is handled? Which is I guess the same as std::string (just a byte buffer with no specified encoding), but still good to be explicit about.

source/blender/blenkernel/intern/asset_catalog_path_test.cc
68

Looks weird to compare this to itself. At first I thought this was a mistake, so maybe comment on it?

93

Shouldn't this test for empty paths/components? E.g. "" / "something" shouldn't result in "/something", and vice versa.

Sybren A. Stüvel (sybren) marked 3 inline comments as done.
  • Various updates after feedback, including defining SEPARATOR in AssetCatalogPath in a way that can be used by other code. Actually moving the other code to AssetCatalogPath is out of scope for this patch, though.
  • Add more documentation, and also replace : with - when cleaning up the path.
This revision is now accepted and ready to land.Sep 30 2021, 3:21 PM