45 #ifndef __CU_JSON_LOADER_H__
46 #define __CU_JSON_LOADER_H__
47 #include <cugl/assets/CULoader.h>
48 #include <cugl/assets/CUJsonValue.h>
82 void materialize(
const std::string& key,
const std::shared_ptr<JsonValue>& json,
83 LoaderCallback callback);
102 virtual bool read(
const std::string& key,
const std::string& source,
103 LoaderCallback callback,
bool async)
override;
125 virtual bool read(
const std::shared_ptr<JsonValue>& json,
126 LoaderCallback callback,
bool async)
override;
130 #pragma mark Constructors
165 static std::shared_ptr<JsonLoader>
alloc() {
166 std::shared_ptr<JsonLoader> result = std::make_shared<JsonLoader>();
167 return (result->init() ? result :
nullptr);
183 static std::shared_ptr<JsonLoader>
alloc(
const std::shared_ptr<ThreadPool>& threads) {
184 std::shared_ptr<JsonLoader> result = std::make_shared<JsonLoader>();
185 return (result->init(threads) ? result :
nullptr);