18 #ifndef ION_BASE_ZIPASSETMANAGER_H_
19 #define ION_BASE_ZIPASSETMANAGER_H_
28 #include "base/macros.h"
56 static bool RegisterAssetData(
const void* data,
size_t data_size);
59 static bool ContainsFile(
const std::string& filename);
64 static bool IsFileCached(
const std::string& filename);
67 static std::vector<std::string> GetRegisteredFileNames();
73 static std::shared_ptr<const std::string> GetFileDataPtr(
74 const std::string& filename);
79 static const std::string& GetFileData(
const std::string& filename);
83 static bool GetFileDataNoCache(
const std::string& filename, std::string* out);
91 static bool UpdateFileIfChanged(
92 const std::string& filename,
93 std::chrono::system_clock::time_point* timestamp);
99 static bool SetFileData(
const std::string& filename,
100 const std::string& source);
108 static bool SaveFileData(
const std::string& filename);
122 std::chrono::system_clock::time_point timestamp;
125 std::shared_ptr<std::string> data_ptr;
127 std::string original_name;
129 typedef std::map<std::string, FileInfo> FileCache;
139 const std::string& GetFileDataLocked(
const std::string& filename,
144 bool ContainsFileLocked(
const std::string& filename);
151 static bool FileIsCached(
const FileInfo& info);
154 FileCache file_cache_;
156 std::set<void*> zipfiles_;
167 #endif // ION_BASE_ZIPASSETMANAGER_H_
ZipAssetManager manages all zipfile assets in Ion.
port::Mutex mutex_
Protects shared access to the Allocator and FT_Library.
A Mutex is used to ensure that only one thread or process can access a block of code at one time...