OpenAssetIO / OpenAssetIO-MediaCreation

OpenAssetIO extensions for use in the Media Creation industry.
Apache License 2.0
12 stars 10 forks source link

Substitution constants in trait views. #96

Open elliotcmorris opened 3 months ago

elliotcmorris commented 3 months ago

As a result of discussion about this : https://github.com/OpenAssetIO/OpenAssetIO-MediaCreation/issues/70

Add constants to generated traits that support substitution (primarily locatableContent) to be used with substitution functions as the "keys"

For example

std::string resolvedPath = "/image_{frame}.png";
openassetio::utils::substitute(resolvedPath, {LocatableContent::FRAME_TOKEN, 123});

See how FRAME_TOKEN is provided, rather than just having to type out "frame" or whatever...

elliotcmorris commented 2 months ago

This has more implications that you'd think. Currently what the substitution variables are are just docced in the IsTemplated property, when really they should/need to be data that can be generated from.