00001 /***************************************************************************** 00002 * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch) 00003 ***************************************************************************** 00004 * Project : Zeus Base Library 00005 * Module : IString 00006 * Package : Zeus.ZeusBase.System.Interfaces 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 IStringHPP 00033 #define IStringHPP 00034 00035 #include <zeusbase/System/Interfaces/IValueType.hpp> 00036 #include <zeusbase/Config/PlatformDefines.hpp> 00037 00038 BEGIN_NAMESPACE_Zeus 00039 00040 /***************************************************************************/ 00047 /***************************************************************************/ 00048 class IString : public IValueType 00049 { 00050 HIDE_ASSIGNMENT_OPERATOR(IString) 00051 00052 public: 00053 /***********************************************************************/ 00057 /***********************************************************************/ 00058 virtual const wchar_t* MQUALIFIER c_bstr() const = 0; 00059 00060 /***********************************************************************/ 00073 /***********************************************************************/ 00074 virtual const char* MQUALIFIER c_str( BOOL_ERRORRETVAL(pError) ) const = 0; 00075 00076 /**************************************************************************/ 00084 /**************************************************************************/ 00085 virtual Float64 MQUALIFIER toFloat(Float64 dPreDef = 0.0, bool* pbError = NULL) const = 0; 00086 00087 /**************************************************************************/ 00095 /**************************************************************************/ 00096 virtual Int32 MQUALIFIER toInt(Int32 lPreDef = 0, bool* pbError = NULL) const = 0; 00097 00098 /**************************************************************************/ 00106 /**************************************************************************/ 00107 virtual Uint MQUALIFIER toUint(Uint uiPredef = 0, bool* pbError = NULL) const = 0; 00108 00109 /**************************************************************************/ 00118 /**************************************************************************/ 00119 virtual Timeval MQUALIFIER toTimeval(Timeval tmPredef = 0, bool* pbError = NULL) const = 0; 00120 00121 /**************************************************************************/ 00129 /**************************************************************************/ 00130 virtual bool MQUALIFIER toBool(bool bPredef = false, bool* pbError = NULL) const = 0; 00131 00132 /**************************************************************************/ 00137 /**************************************************************************/ 00138 virtual bool MQUALIFIER isFloat() const = 0; 00139 00140 /**************************************************************************/ 00145 /**************************************************************************/ 00146 virtual bool MQUALIFIER isInt() const = 0; 00147 00148 /**************************************************************************/ 00153 /**************************************************************************/ 00154 virtual bool MQUALIFIER isBool() const = 0; 00155 00156 /**************************************************************************/ 00163 /**************************************************************************/ 00164 virtual bool MQUALIFIER equals(const wchar_t* pInbuffer, bool bIgnoreCase = false) const = 0; 00165 00166 /**************************************************************************/ 00173 /**************************************************************************/ 00174 virtual bool MQUALIFIER equalsStr(const IString& rInstr, bool bIgnoreCase = false) const = 0; 00175 00176 /**************************************************************************/ 00180 /**************************************************************************/ 00181 virtual void MQUALIFIER concat(const wchar_t* pInbuffer) = 0; 00182 00183 /**************************************************************************/ 00187 /**************************************************************************/ 00188 virtual void MQUALIFIER concatStr(const IString& rInstr) = 0; 00189 00190 /**************************************************************************/ 00195 /**************************************************************************/ 00196 virtual void MQUALIFIER assign(const wchar_t* pInbuffer)=0; 00197 00198 /**************************************************************************/ 00202 /**************************************************************************/ 00203 virtual void MQUALIFIER assignStr(const IString& rInstr)=0; 00204 00205 /**************************************************************************/ 00209 /**************************************************************************/ 00210 virtual Int MQUALIFIER getSize() const = 0; 00211 00212 /**************************************************************************/ 00218 /**************************************************************************/ 00219 virtual wchar_t MQUALIFIER getChar(Int iIndex) const = 0; 00220 00221 00222 /**************************************************************************/ 00228 /**************************************************************************/ 00229 virtual Int MQUALIFIER getFirstPos(const wchar_t* pSubBuffer)const = 0; 00230 00231 /**************************************************************************/ 00237 /**************************************************************************/ 00238 virtual Int MQUALIFIER getFirstPosStr(const IString& rSubString)const = 0; 00239 00240 /**************************************************************************/ 00246 /**************************************************************************/ 00247 virtual Int MQUALIFIER getLastPos(const wchar_t* pSubBuffer)const = 0; 00248 00249 /**************************************************************************/ 00255 /**************************************************************************/ 00256 virtual Int MQUALIFIER getLastPosStr(const IString& rSubString)const = 0; 00257 00258 /**************************************************************************/ 00261 /**************************************************************************/ 00262 virtual void MQUALIFIER clear() = 0; 00263 00264 /**************************************************************************/ 00270 /**************************************************************************/ 00271 virtual bool MQUALIFIER isEmpty() const = 0; 00272 00273 /**************************************************************************/ 00279 /**************************************************************************/ 00280 virtual bool MQUALIFIER endsWith(const wchar_t* pString) const = 0; 00281 00282 /**************************************************************************/ 00288 /**************************************************************************/ 00289 virtual bool MQUALIFIER endsWithStr(const IString& rString) const = 0; 00290 00291 /**************************************************************************/ 00297 /**************************************************************************/ 00298 virtual bool MQUALIFIER startsWith(const wchar_t* pString) const = 0; 00299 00300 /**************************************************************************/ 00306 /**************************************************************************/ 00307 virtual bool MQUALIFIER startsWithStr(const IString& rString) const = 0; 00308 00309 /**************************************************************************/ 00317 /**************************************************************************/ 00318 virtual Int MQUALIFIER compareTo(const IString& rString) const=0; 00319 00320 /**************************************************************************/ 00326 /**************************************************************************/ 00327 virtual bool MQUALIFIER contains(const wchar_t* pSubString) const=0; 00328 00329 /**************************************************************************/ 00335 /**************************************************************************/ 00336 virtual bool MQUALIFIER containsStr(const IString& rSubString) const=0; 00337 00338 /**************************************************************************/ 00345 /**************************************************************************/ 00346 virtual Int MQUALIFIER getPos(Int iStartIndex, const wchar_t* pSubBuffer) const = 0; 00347 00348 /**************************************************************************/ 00355 /**************************************************************************/ 00356 virtual Int MQUALIFIER getPosOfStr(Int iStartIndex, const IString& rSubString) const = 0; 00357 00358 //Friend classes: DO NOT CHANGE 00359 friend class TStringList; 00360 friend class TZVariant; 00361 }; 00362 00363 END_NAMESPACE_Zeus 00364 00365 00366 #endif 00367