parent
d7053a3e81
commit
bce0459ed3
12 changed files with 84 additions and 53 deletions
@ -0,0 +1,17 @@ |
|||||||
|
#include "tools.h" |
||||||
|
|
||||||
|
namespace Bk::Json
|
||||||
|
{ |
||||||
|
Pointer find_key(std::string name, Object obj) |
||||||
|
{ |
||||||
|
Pointer node(new Node()); |
||||||
|
if (obj.find(name) != obj.end()) node = obj[name]; |
||||||
|
else node->set_null(); |
||||||
|
return node; |
||||||
|
} |
||||||
|
|
||||||
|
bool as_key(std::string name, Object obj) |
||||||
|
{ |
||||||
|
return obj.find(name) != obj.end(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,10 @@ |
|||||||
|
#pragma once |
||||||
|
|
||||||
|
#include <bakatoolspch.h> |
||||||
|
#include "node.h" |
||||||
|
|
||||||
|
namespace Bk::Json
|
||||||
|
{ |
||||||
|
Pointer find_key(std::string name, Object obj); |
||||||
|
bool as_key(std::string name, Object obj); |
||||||
|
} |
Loading…
Reference in New Issue