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 { 17 wxString p__id; 18 19 public: ID()20 ID(){}; ID(const wxString & id)21 ID(const wxString& id) : p__id(id){}; ID(const ID & cpy)22 explicit ID(const ID& cpy) : p__id(cpy.id()){}; 23 id()24 wxString id() const 25 { 26 return p__id; 27 }; 28 set_id(const wxString & s)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 46