TBTK
Need a break? Support the development by playing Polarity Puzzles
Argument.h
Go to the documentation of this file.
1 /* Copyright 2019 Kristofer Björnson
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
23 #ifndef COM_DAFER45_TBTK_VISUALIZATION_MAT_PLOT_LIB_ARGUMENT
24 #define COM_DAFER45_TBTK_VISUALIZATION_MAT_PLOT_LIB_ARGUMENT
25 
26 #include <string>
27 #include <map>
28 
29 namespace TBTK{
30 namespace Visualization{
31 namespace MatPlotLib{
32 
59 class Argument{
60 public:
62  Argument();
63 
67  Argument(const char *argument);
68 
72  Argument(const std::string &argument);
73 
75  Argument(
76  const std::initializer_list<std::pair<std::string, std::string>> &argument
77  );
78 
80  const std::string& getArgumentString() const;
81 
83  const std::map<std::string, std::string>& getArgumentMap() const;
84 private:
85  std::string argumentString;
86  std::map<std::string, std::string> argumentMap;
87 };
88 
90 }
91 
92 inline Argument::Argument(const char *argument) : argumentString(argument){
93 }
94 
95 inline Argument::Argument(const std::string &argument){
96  argumentString = argument;
97 }
98 
100  const std::initializer_list<std::pair<std::string, std::string>> &argument
101 ){
102  for(auto element : argument)
103  argumentMap[element.first] = element.second;
104 }
105 
106 inline const std::string& Argument::getArgumentString() const{
107  return argumentString;
108 }
109 
110 inline const std::map<std::string, std::string>& Argument::getArgumentMap(
111 ) const{
112  return argumentMap;
113 }
114 
115 }; //End namespace MatPlotLib
116 }; //End namespace Visualization
117 }; //End namespace TBTK
118 
119 #endif
const std::map< std::string, std::string > & getArgumentMap() const
Definition: Argument.h:110
const std::string & getArgumentString() const
Definition: Argument.h:106
Argument()
Definition: Argument.h:89
Argument to matplotlib.
Definition: Argument.h:59
Definition: Boolean.h:32