| 20 | }; |
| 21 | |
| 22 | class 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); |
| 29 | public: |
| 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. |
no outgoing calls
no test coverage detected