mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
Base content package + ContentLoader
This commit is contained in:
parent
6708e1ef86
commit
c8a283c645
33 changed files with 318 additions and 112 deletions
|
|
@ -190,6 +190,12 @@ void JObject::num(std::string key, double& dst) const {
|
|||
dst = found->second->value.num;
|
||||
}
|
||||
|
||||
void JObject::num(std::string key, ubyte& dst) const {
|
||||
auto found = map.find(key);
|
||||
if (found != map.end())
|
||||
dst = found->second->value.num;
|
||||
}
|
||||
|
||||
void JObject::num(std::string key, float& dst) const {
|
||||
auto found = map.find(key);
|
||||
if (found != map.end())
|
||||
|
|
@ -289,6 +295,10 @@ JObject& JObject::put(string key, bool value){
|
|||
return *this;
|
||||
}
|
||||
|
||||
bool JObject::has(string key) {
|
||||
return map.find(key) != map.end();
|
||||
}
|
||||
|
||||
Value::Value(valtype type, valvalue value) : type(type), value(value) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ namespace json {
|
|||
void num(std::string key, int& dst) const;
|
||||
void num(std::string key, float& dst) const;
|
||||
void num(std::string key, uint& dst) const;
|
||||
void num(std::string key, ubyte& dst) const;
|
||||
void num(std::string key, double& dst) const;
|
||||
JObject* obj(std::string key) const;
|
||||
JArray* arr(std::string key) const;
|
||||
|
|
@ -86,6 +87,8 @@ namespace json {
|
|||
JObject& put(std::string key, JObject* value);
|
||||
JObject& put(std::string key, JArray* value);
|
||||
JObject& put(std::string key, bool value);
|
||||
|
||||
bool has(std::string key);
|
||||
};
|
||||
|
||||
class Parser : public BasicParser {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue