| 12 | #include <boost/algorithm/string/split.hpp> |
| 13 | |
| 14 | void CAssetsDir::Set(const CAsset& asset, const AssetMetadata& metadata) |
| 15 | { |
| 16 | // No asset or label repetition |
| 17 | if (GetLabel(asset) != "") |
| 18 | throw std::runtime_error(strprintf("duplicated asset '%s'", asset.GetHex())); |
| 19 | if (GetAsset(metadata.GetLabel()) != CAsset()) |
| 20 | throw std::runtime_error(strprintf("duplicated label '%s'", metadata.GetLabel())); |
| 21 | |
| 22 | mapAssetMetadata[asset] = metadata; |
| 23 | mapAssets[metadata.GetLabel()] = asset; |
| 24 | } |
| 25 | |
| 26 | void CAssetsDir::SetHex(const std::string& assetHex, const std::string& label) |
| 27 | { |