Code::Blocks  SVN r11506
id.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
3  * http://www.gnu.org/licenses/lgpl-3.0.html
4  */
5 
6 #ifndef ID_H
7 #define ID_H
8 #undef new
9 
10 #include <wx/string.h>
11 
12 /*
13 * Base class for providing a string ID
14 */
15 class ID
16 {
18 
19 public:
20  ID(){};
21  ID(const wxString& id) : p__id(id){};
22  explicit ID(const ID& cpy) : p__id(cpy.id()){};
23 
24  wxString id() const
25  {
26  return p__id;
27  };
28 
29  void set_id(const wxString& s)
30  {
31  p__id.assign(s);
32  };
33 
34  bool operator==(const ID& other) const
35  {
36  return id().IsSameAs(other.id());
37  };
38 
39  bool operator==(const wxString& other) const
40  {
41  return id().IsSameAs(other);
42  };
43 };
44 
45 #endif
wxString p__id
Definition: id.h:17
bool operator==(const ID &other) const
Definition: id.h:34
void set_id(const wxString &s)
Definition: id.h:29
wxString id() const
Definition: id.h:24
bool IsSameAs(const wxString &s, bool caseSensitive=true) const
ID(const wxString &id)
Definition: id.h:21
wxString & assign(const wxString &str, size_t pos, size_t n)
ID(const ID &cpy)
Definition: id.h:22
Definition: id.h:15
ID()
Definition: id.h:20
bool operator==(const wxString &other) const
Definition: id.h:39