iFun Engine API  1.0.0-b6053
Great Technology for Great Games
argument_map.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2020 iFunFactory Inc. All Rights Reserved.
2 //
3 // This work is confidential and proprietary to iFunFactory Inc. and
4 // must not be used, disclosed, copied, or distributed without the prior
5 // consent of iFunFactory Inc.
6 
9 #ifndef INCLUDE_FUNAPI_FRAMEWORK_ARGUMENT_MAP_H_
10 #define INCLUDE_FUNAPI_FRAMEWORK_ARGUMENT_MAP_H_
11 
12 #include <funapi/common/json.h>
13 #include <funapi/types.h>
14 
15 #include <map>
16 #include <vector>
17 
18 
19 namespace fun {
20 
23 class FUNAPI_DLL_VISIBILITY ArgumentMap {
24  public:
26  typedef std::vector<Json> OverrideHistory;
27 
29  typedef std::map<string, OverrideHistory> Container;
30 
33  static bool IsValidArgumentType(const Json::Type &value_type);
34 
42  bool AddArgument(const string &key, const Json &value);
43 
52  bool OverrideArgument(const string &key, const Json &value);
53 
58  const Json &FindArgument(const string &key) const;
59 
64  const OverrideHistory &FindArgumentOverrideHistory(const string &key) const;
65 
70  string FindStringArgument(const string &key) const;
71 
76  int64_t FindIntegerArgument(const string &key) const;
77 
82  double FindDoubleArgument(const string &key) const;
83 
88  bool FindBooleanArgument(const string &key) const;
89 
94  const Json &FindArrayArgument(const string &key) const;
95 
101  const Json &FindObjectArgument(const string &key) const;
102 
106  const Container &GetArgumentsAll() const;
107 
108  private:
109  Container arguments_;
110 };
111 
112 } // namespace fun
113 
114 #endif // INCLUDE_FUNAPI_FRAMEWORK_ARGUMENT_MAP_H_
std::vector< Json > OverrideHistory
Internal implementation of argument&#39;s override history.
Definition: argument_map.h:26
ArgumentMap class manages application-specific run-time arguments.
Definition: argument_map.h:23
std::map< string, OverrideHistory > Container
Internal implementation of ArgumentMap class.
Definition: argument_map.h:29
Definition: json.h:18
Definition: json.h:27