14GX_CORE_NAMESPACE_BEGIN()
33 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
63 GxJsonObject(rapidjson::Document* pDocument, TYPE type) : _pDocument(pDocument), _value(
static_cast<rapidjson::Type
>(type)) {}
72 void addObject(GxJsonObject* pObject, GX_CSTR name);
74 void addS32(s32 value, GX_CSTR name);
76 void addU32(u32 value, GX_CSTR name);
78 void addS64(s64 value, GX_CSTR name);
80 void addU64(u64 value, GX_CSTR name);
82 void addF32(f32 value, GX_CSTR name);
84 void addF64(f64 value, GX_CSTR name);
86 void addB32(
b32 value, GX_CSTR name);
88 void addSTR(GX_CSTR value, GX_CSTR name);
97 rapidjson::Document* _pDocument;
98 rapidjson::Value _value;
128 GxJsonNode(rapidjson::Value& value) : _value(value) {}
141 GX_FORCE_INLINE
b32 hasMember(GX_CSTR name)
const {
return _value.HasMember(name); }
143 GX_FORCE_INLINE
b32 isArray(
void)
const {
return _value.IsArray(); }
147 GX_FORCE_INLINE
b32 isS32(
void)
const {
return _value.IsInt(); }
149 GX_FORCE_INLINE s32
getS32(
void)
const { GX_ASSERT(
isS32(),
"is not s32!");
return _value.GetInt(); }
151 s32
getS32(GX_CSTR name, s32 defaultValue, s32 index = -1)
const;
153 GX_FORCE_INLINE
b32 isU32(
void)
const {
return _value.IsUint(); }
155 GX_FORCE_INLINE u32
getU32(
void)
const { GX_ASSERT(
isU32(),
"is not u32!");
return _value.GetUint(); }
157 u32
getU32(GX_CSTR name, u32 defaultValue, s32 index = -1)
const;
159 GX_FORCE_INLINE
b32 isS64(
void)
const {
return _value.IsInt64(); }
161 GX_FORCE_INLINE s64
getS64(
void)
const { GX_ASSERT(
isS64(),
"is not s64!");
return _value.GetInt64(); }
163 s64
getS64(GX_CSTR name, s64 defaultValue, s32 index = -1)
const;
165 GX_FORCE_INLINE
b32 isU64(
void)
const {
return _value.IsUint64(); }
167 GX_FORCE_INLINE u64
getU64(
void)
const { GX_ASSERT(
isU64(),
"is not u64!");
return _value.GetUint64(); }
169 u64
getU64(GX_CSTR name, u64 defaultValue, s32 index = -1)
const;
171 GX_FORCE_INLINE
b32 isF32(
void)
const {
return _value.IsFloat(); }
173 GX_FORCE_INLINE f32
getF32(
void)
const { GX_ASSERT(
isF32(),
"is not f32!");
return _value.GetFloat(); }
175 f32
getF32(GX_CSTR name, f32 defaultValue, s32 index = -1)
const;
177 GX_FORCE_INLINE
b32 isF64(
void)
const {
return _value.IsDouble(); }
179 GX_FORCE_INLINE f64
getF64(
void)
const { GX_ASSERT(
isF64(),
"is not f64!");
return _value.GetDouble(); }
181 f64
getF64(GX_CSTR name, f64 defaultValue, s32 index = -1)
const;
183 GX_FORCE_INLINE
b32 isB32(
void)
const {
return _value.IsBool(); }
185 GX_FORCE_INLINE
b32 getB32(
void)
const { GX_ASSERT(
isB32(),
"is not b32!");
return _value.GetBool(); }
187 b32 getB32(GX_CSTR name,
b32 defaultValue, s32 index = -1)
const;
189 GX_FORCE_INLINE
b32 isString(
void)
const {
return _value.IsString(); }
191 GX_FORCE_INLINE GX_CSTR
getString(
void)
const { GX_ASSERT(
isString(),
"is not string!");
return _value.GetString(); }
193 GX_CSTR
getString(GX_CSTR name, GX_CSTR defaultValue, s32 index = -1)
const;
197 GX_FORCE_INLINE
b32 isObject(
void)
const {
return _value.IsObject(); }
199 GX_FORCE_INLINE
b32 isNumber(
void)
const {
return _value.IsNumber(); }
201 GX_FORCE_INLINE
b32 isNull(
void)
const {
return _value.IsNull(); }
221 rapidjson::Value& _value;
233 GxJson(u32 memorySize = 0);
246 GX_FORCE_INLINE
b32 hasMember(GX_CSTR name)
const {
return _pDocument->HasMember(name); }
249 GxJsonObject* createObject(GxJsonObject::TYPE type);
251 void addObject(GxJsonObject* pObject, GX_CSTR name);
255 void writeJson(
GxStream& stream,
b32 isCompress =
false);
258 GX_FORCE_INLINE void parse(GX_CHAR* pBuffer) { _pDocument->Parse(pBuffer); }
266 rapidjson::Document* _pDocument;
275GX_CORE_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE(__CLASS__)
GxClassBase継承の禁止宣言
Definition GxBase.h:240
配列クラス
Definition GxArray.h:18
オブジェクト基底クラス
Definition GxBase.h:88
JSON解析用ノード
Definition GxJson.h:108
GX_FORCE_INLINE f32 getF32(void) const
F32値を取得
Definition GxJson.h:173
GX_FORCE_INLINE b32 isArray(void) const
配列か判定
Definition GxJson.h:143
GX_FORCE_INLINE b32 hasMember(GX_CSTR name) const
メンバ保持判定
Definition GxJson.h:141
GX_FORCE_INLINE GX_CSTR getString(void) const
文字列を取得
Definition GxJson.h:191
GX_FORCE_INLINE b32 isNull(void) const
Nullか判定
Definition GxJson.h:201
GX_FORCE_INLINE b32 isU64(void) const
U64か判定
Definition GxJson.h:165
GxColor getColor(GX_CSTR name, const GxColor &defaultValue, s32 index=-1) const
GxColorを取得
Definition GxJson.cpp:537
GX_FORCE_INLINE b32 isF64(void) const
F64か判定
Definition GxJson.h:177
GX_FORCE_INLINE u64 getU64(void) const
U64値を取得
Definition GxJson.h:167
GX_FORCE_INLINE const GxJsonNode operator[](GX_CSTR name) const
文字列指定
Definition GxJson.h:137
GxJsonNode(const GxJsonNode &node)
コピーコンストラクタ
Definition GxJson.h:123
GX_FORCE_INLINE s64 getS64(void) const
S64値を取得
Definition GxJson.h:161
GX_FORCE_INLINE b32 isString(void) const
文字列か判定
Definition GxJson.h:189
GX_FORCE_INLINE b32 isU32(void) const
U32か判定
Definition GxJson.h:153
GX_FORCE_INLINE u32 getU32(void) const
U32値を取得
Definition GxJson.h:155
GX_FORCE_INLINE u32 getArrayCount(void) const
配列要素数を取得
Definition GxJson.h:145
GxFlag32Base getFlag32Base(GX_CSTR name, const GxFlag32Base &defaultValue, s32 index=-1) const
GxFlag32Baseを取得
Definition GxJson.cpp:619
GX_FORCE_INLINE s32 getS32(void) const
S32値を取得
Definition GxJson.h:149
GX_FORCE_INLINE b32 isS32(void) const
S32か判定
Definition GxJson.h:147
GX_FORCE_INLINE const GxJsonNode operator[](u32 i) const
インデックス指定
Definition GxJson.h:139
GX_FORCE_INLINE b32 isNumber(void) const
数値か判定
Definition GxJson.h:199
GX_FORCE_INLINE f64 getF64(void) const
F64値を取得
Definition GxJson.h:179
GX_FORCE_INLINE b32 isF32(void) const
F32か判定
Definition GxJson.h:171
GX_FORCE_INLINE b32 isS64(void) const
S64か判定
Definition GxJson.h:159
GxRect getRect(GX_CSTR name, const GxRect &defaultValue, s32 index=-1) const
GxRectを取得
Definition GxJson.cpp:505
GX_FORCE_INLINE u32 getStringLength(void) const
文字列の長さを取得
Definition GxJson.h:195
GxSize getSize(GX_CSTR name, const GxSize &defaultValue, s32 index=-1) const
GxSizeを取得
Definition GxJson.cpp:477
GxVector2 getVector2(GX_CSTR name, const GxVector2 &defaultValue, s32 index=-1) const
GxVector2を取得
Definition GxJson.cpp:563
GX_FORCE_INLINE b32 isB32(void) const
B32か判定
Definition GxJson.h:183
GX_FORCE_INLINE b32 isObject(void) const
オブジェクトか判定
Definition GxJson.h:197
GX_FORCE_INLINE b32 getB32(void) const
B32値を取得
Definition GxJson.h:185
GxPoint2 getPoint2(GX_CSTR name, const GxPoint2 &defaultValue, s32 index=-1) const
GxPoint2を取得
Definition GxJson.cpp:591
JSONパーサ
Definition GxJson.h:20
GX_FORCE_INLINE const GxJsonNode operator[](GX_CSTR name) const
文字列指定
Definition GxJson.h:244
GX_FORCE_INLINE b32 hasMember(GX_CSTR name) const
メンバ保持判定
Definition GxJson.h:246
GxJson(u32 memorySize=0)
コンストラクタ
Definition GxJson.cpp:29
virtual ~GxJson(void)
デストラクタ
Definition GxJson.cpp:53
ストリーム基礎クラス
Definition GxStream.h:20
フラグ
Definition GxStruct.h:1243
座標
Definition GxStruct.h:867
矩形
Definition GxStruct.h:951
サイズ
Definition GxStruct.h:730
2次元ベクトル
Definition GxVector.h:34
32bitブーリアン
Definition GxDefine.h:173