QString AssetCache::StoreAsset(const u8 *data, size_t numBytes, const QString &assetName) { QString absolutePath = GetDiskSourceByRef(assetName); bool success = SaveAssetFromMemoryToFile(data, numBytes, absolutePath); if (success) return absolutePath; return ""; }
bool IAsset::SaveToFile(const QString &filename, const QString &serializationParameters) const { std::vector<u8> data; bool success = SerializeTo(data, serializationParameters); if (!success || data.size() == 0) { LogError("IAsset::SaveToFile: SerializeTo returned no data for asset \"" + ToString() + "\"!"); return false; } return SaveAssetFromMemoryToFile(&data[0], data.size(), filename); }