49 #ifndef __CU_JSON_READER_H__
50 #define __CU_JSON_READER_H__
51 #include <cugl/io/CUTextReader.h>
52 #include <cugl/assets/CUJsonValue.h>
73 #pragma mark Static Constructors
90 static std::shared_ptr<JsonReader>
alloc(
const std::string& file) {
91 std::shared_ptr<JsonReader> result = std::make_shared<JsonReader>();
92 return (result->init(file) ? result :
nullptr);
110 static std::shared_ptr<JsonReader>
alloc(
const char* file) {
111 std::shared_ptr<JsonReader> result = std::make_shared<JsonReader>();
112 return (result->init(file) ? result :
nullptr);
131 std::shared_ptr<JsonReader> result = std::make_shared<JsonReader>();
132 return (result->init(file) ? result :
nullptr);
148 static std::shared_ptr<JsonReader>
alloc(
const std::string& file,
unsigned int capacity) {
149 std::shared_ptr<JsonReader> result = std::make_shared<JsonReader>();
150 return (result->init(file,capacity) ? result :
nullptr);
166 static std::shared_ptr<JsonReader>
alloc(
const char* file,
unsigned int capacity) {
167 std::shared_ptr<JsonReader> result = std::make_shared<JsonReader>();
168 return (result->init(file,capacity) ? result :
nullptr);
184 static std::shared_ptr<JsonReader>
alloc(
const Pathname& file,
unsigned int capacity) {
185 std::shared_ptr<JsonReader> result = std::make_shared<JsonReader>();
186 return (result->init(file,capacity) ? result :
nullptr);
204 std::shared_ptr<JsonReader> result = std::make_shared<JsonReader>();
205 return (result->initWithAsset(file) ? result :
nullptr);
223 std::shared_ptr<JsonReader> result = std::make_shared<JsonReader>();
224 return (result->initWithAsset(file) ? result :
nullptr);
240 static std::shared_ptr<JsonReader>
allocWithAsset(
const std::string& file,
unsigned int capacity) {
241 std::shared_ptr<JsonReader> result = std::make_shared<JsonReader>();
242 return (result->initWithAsset(file,capacity) ? result :
nullptr);
258 static std::shared_ptr<JsonReader>
allocWithAsset(
const char* file,
unsigned int capacity) {
259 std::shared_ptr<JsonReader> result = std::make_shared<JsonReader>();
260 return (result->initWithAsset(file,capacity) ? result :
nullptr);
265 #pragma mark Read Methods
293 std::shared_ptr<JsonValue>
readJson();
Definition: CUTextReader.h:74
std::shared_ptr< JsonValue > readJson()
static std::shared_ptr< JsonReader > alloc(const char *file)
Definition: CUJsonReader.h:110
static std::shared_ptr< JsonReader > alloc(const char *file, unsigned int capacity)
Definition: CUJsonReader.h:166
static std::shared_ptr< JsonReader > alloc(const std::string &file)
Definition: CUJsonReader.h:90
static std::shared_ptr< JsonReader > alloc(const Pathname &file, unsigned int capacity)
Definition: CUJsonReader.h:184
std::string readJsonString()
static std::shared_ptr< JsonReader > alloc(const std::string &file, unsigned int capacity)
Definition: CUJsonReader.h:148
static std::shared_ptr< JsonReader > allocWithAsset(const char *file)
Definition: CUJsonReader.h:222
Definition: CUJsonReader.h:70
static std::shared_ptr< JsonReader > allocWithAsset(const char *file, unsigned int capacity)
Definition: CUJsonReader.h:258
static std::shared_ptr< JsonReader > allocWithAsset(const std::string &file, unsigned int capacity)
Definition: CUJsonReader.h:240
Definition: CUAnimationNode.h:52
Definition: CUPathname.h:85
static std::shared_ptr< JsonReader > alloc(const Pathname &file)
Definition: CUJsonReader.h:130
static std::shared_ptr< JsonReader > allocWithAsset(const std::string &file)
Definition: CUJsonReader.h:203