values_properties.h
1 /*
2 * <one line to give the program's name and a brief idea of what it does.>
3 * Copyright (C) 2021 <copyright holder> <email>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef NAF_EXTRAS_VALUESPROPERTIES
20 #define NAF_EXTRAS_VALUESPROPERTIES
21 
22 
23 #include <string>
24 #include <map>
25 #include <vector>
26 
27 namespace NAF
28 {
29  namespace Extras
30  {
31  class ValuesProperties;
32  }
33 }
34 
36 {
37  public:
39  ValuesProperties(std::string value, bool quotes = true);
41 
42  friend bool operator==(ValuesProperties& a, ValuesProperties& b)
43  {
44  if(a.GetFinalValue() == b.get_value())
45  return true;
46  else
47  return false;
48  }
49 
50  friend bool operator!=(ValuesProperties& a, ValuesProperties& b)
51  {
52  if(a.GetFinalValue() != b.GetFinalValue())
53  return true;
54  else
55  return false;
56  }
57  friend bool operator==(const ValuesProperties& a, const ValuesProperties& b)
58  {
59  if(a.GetFinalValue() == b.get_value())
60  return true;
61  else
62  return false;
63  }
64 
65  friend bool operator!=(const ValuesProperties& a, const ValuesProperties& b)
66  {
67  if(a.GetFinalValue() != b.GetFinalValue())
68  return true;
69  else
70  return false;
71  }
72 
73  std::string& get_value()
74  {
75  auto& var = value_;
76  return var;
77  }
78  std::string get_value() const {return value_;}
79  bool get_quotes() const {return quotes_;}
80 
81  void set_value(std::string value) {value_ = value;}
82  void set_quotes(bool quote) {quotes_ = quote;}
83 
84  std::string GetFinalValue();
85  std::string GetFinalValue() const;
86 
87  private:
88  std::string value_;
89  bool quotes_;
90 };
91 
92 #endif // NAF_EXTRAS_VALUESPROPERTIES
Definition: values_properties.h:36