Helper class to load Requirement.
More...
#include <RequirementLoader.h>
Helper class to load Requirement.
Definition at line 38 of file RequirementLoader.h.
◆ LoadExtended()
std::unique_ptr< Requirement > Json::RequirementLoader::LoadExtended |
( |
const Value & |
json | ) |
|
Extended Requirement loader.
- Parameters
-
- Returns
- Unique pointer to the Requirement.
Definition at line 77 of file RequirementLoader.cpp.
79 std::unique_ptr<Requirement> item =
nullptr;
80 if(json.isObject() && json.isMember(
"allOf") && json[
"allOf"].isArray())
81 item = std::unique_ptr<Requirement>(
new AllOfRequirement());
82 else if(json.isObject() && json.isMember(
"anyOf") && json[
"anyOf"].isArray())
83 item = std::unique_ptr<Requirement>(
new AnyOfRequirement());
84 else if(json.isObject() && json.isMember(
"oneOf") && json[
"oneOf"].isArray())
85 item = std::unique_ptr<Requirement>(
new OneOfRequirement());
Referenced by Json::ObjectRequirement::Parse().
◆ LoadRequirement() [1/2]
std::unique_ptr< Requirement > Json::RequirementLoader::LoadRequirement |
( |
const Value & |
json | ) |
|
Load specific requirement.
- Parameters
-
- Returns
- Unique pointer to the Requirement.
Definition at line 42 of file RequirementLoader.cpp.
44 std::unique_ptr<Requirement> item =
nullptr;
46 if(json[
"type"].asString() ==
"string")
47 item = std::unique_ptr<Requirement>(
new StringRequirement());
48 else if(json[
"type"].asString() ==
"integer")
49 item = std::unique_ptr<Requirement>(
new IntegerRequirement());
50 else if(json[
"type"].asString() ==
"number")
51 item = std::unique_ptr<Requirement>(
new NumberRequirement());
52 else if(json[
"type"].asString() ==
"object")
53 item = std::unique_ptr<Requirement>(
new ObjectRequirement());
54 else if(json[
"type"].asString() ==
"array")
55 item = std::unique_ptr<Requirement>(
new ArrayRequirement());
56 else if(json[
"type"].asString() ==
"boolean")
57 item = std::unique_ptr<Requirement>(
new BooleanRequirement());
58 else if(json[
"type"].asString() ==
"null")
59 item = std::unique_ptr<Requirement>(
new NullRequirement());
60 else if(json[
"allOf"].isArray())
61 item = std::unique_ptr<Requirement>(
new AllOfRequirement());
62 else if(json[
"anyOf"].isArray())
63 item = std::unique_ptr<Requirement>(
new AnyOfRequirement());
64 else if(json[
"oneOf"].isArray())
65 item = std::unique_ptr<Requirement>(
new OneOfRequirement());
66 else if(json[
"enum"].isArray())
67 item = std::unique_ptr<Requirement>(
new EnumRequirement());
68 else if(json[
"not"].isObject())
69 item = std::unique_ptr<Requirement>(
new NotRequirement());
71 else if(json.isObject())
72 item = std::unique_ptr<Requirement>(
new ObjectRequirement());
Referenced by Json::AllOfRequirement::Parse(), Json::AnyOfRequirement::Parse(), Json::ArrayRequirement::Parse(), Json::NotRequirement::Parse(), Json::ObjectRequirement::Parse(), and Json::OneOfRequirement::Parse().
◆ LoadRequirement() [2/2]
std::unique_ptr< Requirement > Json::RequirementLoader::LoadRequirement |
( |
const ValueType & |
type | ) |
|
Load Requirement based on Value Type.
- Parameters
-
- Returns
- Unique pointer to the Requirement.
Return a Requirement based on the given Value Type.
Definition at line 90 of file RequirementLoader.cpp.
92 std::unique_ptr<Requirement> item =
nullptr;
97 item = std::unique_ptr<Requirement>(
new NullRequirement());
100 item = std::unique_ptr<Requirement>(
new IntegerRequirement());
103 item = std::unique_ptr<Requirement>(
new NumberRequirement());
106 item = std::unique_ptr<Requirement>(
new StringRequirement());
109 item = std::unique_ptr<Requirement>(
new BooleanRequirement());
112 item = std::unique_ptr<Requirement>(
new ArrayRequirement());
115 item = std::unique_ptr<Requirement>(
new ObjectRequirement());
The documentation for this class was generated from the following files: