00001 /***************************************************************************** 00002 * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch) 00003 ***************************************************************************** 00004 * Project : Zeus Base Library 00005 * Module : Property 00006 * Package : Zeus.ZeusBase.System 00007 * Author : Benjamin Hadorn 00008 * Date : 27.12.2011 00009 * System : Zeus-Framework 00010 ***************************************************************************** 00011 * Licence: * 00012 * This library is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU Lesser General Public License as * 00014 * published by the Free Software Foundation; either version * 00015 * 2.1 of the License, or (at your option) any later version. * 00016 * * 00017 * This library is distributed in the hope that it will be useful, * 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00020 * GNU Lesser General Public License for more details. * 00021 * * 00022 * You should have received a copy of the GNU Lesser General Public * 00023 * License along with this library; if not, write to the Free Software * 00024 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * 00025 *****************************************************************************/ 00026 00027 /***************************************************************************** 00028 * Changes: 00029 * 27.12.2011 bha: created zeus 2.0 00030 *****************************************************************************/ 00031 00032 #ifndef PropertyH 00033 #define PropertyH 00034 00035 #include <zeusbase/System/ZObject.h> 00036 #include <zeusbase/System/Interfaces/IProperty.hpp> 00037 00038 BEGIN_NAMESPACE_Zeus 00039 00040 /*****************************************************************************/ 00043 /*****************************************************************************/ 00044 zeusbase_class TProperty : public IProperty 00045 { 00046 public: 00047 TProperty(); 00048 TProperty(const IString& rValue1, const IString& rValue2); 00049 TProperty(const IProperty& rValue); 00050 00051 virtual ~TProperty(); 00052 00054 virtual void MQUALIFIER assign(const IProperty& rPair); 00055 virtual bool MQUALIFIER equals(const IProperty& rPair) const; 00056 virtual bool MQUALIFIER equalsFirst(const IString& rInPar) const; 00057 virtual bool MQUALIFIER equalsSecond(const IString& rInPar) const; 00058 virtual IString& MQUALIFIER getFirst(); 00059 virtual const IString& MQUALIFIER getFirstConst() const; 00060 virtual IString& MQUALIFIER getSecond(); 00061 virtual const IString& MQUALIFIER getSecondConst() const; 00062 virtual void MQUALIFIER setFirst(const IString& rInPar); 00063 virtual void MQUALIFIER setSecond(const IString& rInPar); 00064 virtual void MQUALIFIER setPair(const IString& rInPar1, const IString& rInPar2); 00065 00066 protected: 00068 TString m_strValue1; 00070 TString m_strValue2; 00071 00072 private: 00073 }; 00074 00075 //INLINE METHODS 00076 /****************************************************************************/ 00079 /****************************************************************************/ 00080 inline void MQUALIFIER TProperty::assign(const IProperty& rPair) 00081 { 00082 m_strValue1 = rPair.getFirstConst(); 00083 m_strValue2 = rPair.getSecondConst(); 00084 } 00085 00086 /****************************************************************************/ 00089 /****************************************************************************/ 00090 inline bool MQUALIFIER TProperty::equals(const IProperty& rPair) const 00091 { 00092 return (m_strValue1 == rPair.getFirstConst() && 00093 m_strValue2 == rPair.getSecondConst()); 00094 } 00095 00096 /****************************************************************************/ 00099 /****************************************************************************/ 00100 inline bool MQUALIFIER TProperty::equalsFirst(const IString& rInPar) const 00101 { 00102 return (m_strValue1 == rInPar); 00103 } 00104 00105 /****************************************************************************/ 00108 /****************************************************************************/ 00109 inline bool MQUALIFIER TProperty::equalsSecond(const IString& rInPar) const 00110 { 00111 return (m_strValue2 == rInPar); 00112 } 00113 00114 /****************************************************************************/ 00117 /****************************************************************************/ 00118 inline IString& MQUALIFIER TProperty::getFirst() 00119 { 00120 return m_strValue1; 00121 } 00122 00123 /****************************************************************************/ 00126 /****************************************************************************/ 00127 inline const IString& MQUALIFIER TProperty::getFirstConst() const 00128 { 00129 return m_strValue1; 00130 } 00131 00132 /****************************************************************************/ 00135 /****************************************************************************/ 00136 inline IString& MQUALIFIER TProperty::getSecond() 00137 { 00138 return m_strValue2; 00139 } 00140 00141 /****************************************************************************/ 00144 /****************************************************************************/ 00145 inline const IString& MQUALIFIER TProperty::getSecondConst() const 00146 { 00147 return m_strValue2; 00148 } 00149 00150 /****************************************************************************/ 00153 /****************************************************************************/ 00154 inline void MQUALIFIER TProperty::setFirst(const IString& rInPar) 00155 { 00156 m_strValue1 = rInPar; 00157 } 00158 00159 /****************************************************************************/ 00162 /****************************************************************************/ 00163 inline void MQUALIFIER TProperty::setSecond(const IString& rInPar) 00164 { 00165 m_strValue2 = rInPar; 00166 } 00167 00168 /****************************************************************************/ 00171 /****************************************************************************/ 00172 inline void MQUALIFIER TProperty::setPair(const IString& rInPar1, const IString& rInPar2) 00173 { 00174 m_strValue1 = rInPar1; 00175 m_strValue2 = rInPar2; 00176 } 00177 00178 END_NAMESPACE_Zeus 00179 00180 //--------------------------------------------------------------------------- 00181 #endif