MCPcopy Create free account
hub / github.com/ElementsProject/elements / CAssetsDir

Class CAssetsDir

src/assetsdir.h:22–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20};
21
22class CAssetsDir
23{
24 std::map<CAsset, AssetMetadata> mapAssetMetadata;
25 std::map<std::string, CAsset> mapAssets;
26
27 void Set(const CAsset& asset, const AssetMetadata& metadata);
28 void SetHex(const std::string& assetHex, const std::string& label);
29public:
30 void InitFromStrings(const std::vector<std::string>& assetsToInit, const std::string& pegged_asset_name);
31
32 /**
33 * @param label A label string
34 * @return asset id corresponding to the asset label
35 */
36 CAsset GetAsset(const std::string& label) const;
37
38 AssetMetadata GetMetadata(const CAsset& asset) const;
39
40 /** @return the label associated to the asset id */
41 std::string GetLabel(const CAsset& asset) const;
42
43 /** @return the label associated to the asset id, or some other identifier */
44 std::string GetIdentifier(const CAsset& asset) const;
45
46 std::vector<CAsset> GetKnownAssets() const;
47};
48
49/**
50 * Returns asset id corresponding to the given asset expression, which is either an asset label or a hex value.

Callers 1

ClearGlobalAssetDirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected