00001 /*************************************************************************** 00002 * Copyright (C) 2005 by Benjamin Hadorn (bhadorn@swissinfo.org) * 00003 *************************************************************************** 00004 * Projekt : Zeus 00005 * Module : IString 00006 * Package : System 00007 * Author : Benjamin Hadorn 00008 * Datum : 3.11.06 00009 * Ablage : $File$ 00010 * System : Cell Computing Model 00011 *************************************************************************** 00012 * Licence: * 00013 * This library is free software; you can redistribute it and/or modify * 00014 * it under the terms of the GNU Lesser General Public License as * 00015 * published by the Free Software Foundation; either version * 00016 * 2.1 of the License, or (at your option) any later version. * 00017 * * 00018 * This library is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00021 * GNU Lesser General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU Lesser General Public * 00024 * License along with this library; if not, write to the Free Software * 00025 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * 00026 ***************************************************************************/ 00027 00028 /*************************************************************************** 00029 Changes : 00030 $Log: /Development_F/StuderWIN/dev/Zeus/src/zeusbase/System/Interfaces/IString.hpp $ 00031 ** 00032 ** 30 17.04.08 8:08 Bha 00033 ** Timeval convertion implemented 00034 ** 00035 ** 29 7.02.08 12:08 Mab 00036 ** Method clear() added. 00037 ** 00038 ** 28 6.02.08 14:56 Mab 00039 ** IString::toBool() IString::isBool() and TString constructor for bool 00040 ** added. 00041 ** 00042 ** 27 3.09.07 7:04 bha 00043 ** New Framework using auto pointer and improved lists 00044 ** 00045 ** 26 2.07.07 7:25 bha 00046 ** documentation of interface 00047 ** 00048 ** 22 26.02.07 9:00 bha 00049 ** 17 9.10.06 8:29 bha 00050 ** IString-Methoden mit Referenz statt Pointer 00051 ** 00052 ** 16 5.10.06 6:38 bha 00053 ** Stack types can hide addRef and release methods inside their interfaces 00054 ** 00055 ** 15 27.09.06 17:00 Mabbuehl 00056 ** Elimination Wide String 00057 ** 00058 ** 12 7.09.06 16:00 bha 00059 ** String mit compareTo erweitern 00060 ** 00061 ** 10 4.09.06 14:40 bha 00062 ** StringTool replaced. All methods are available in TString now. 00063 ** 00064 ** 8 28.08.06 12:01 Mabbuehl 00065 ** Conversion to char* redesigned. Retval is not a multi byte string any 00066 ** more, but a single byte string. 00067 ***************************************************************************/ 00068 00069 #ifndef IStringHPP 00070 #define IStringHPP 00071 00072 #include <zeusbase/System/Interfaces/IValueType.hpp> 00073 #include <zeusbase/Config/PlatformDefines.hpp> 00074 00075 BEGIN_NAMESPACE_Zeus 00076 00077 /***************************************************************************/ 00084 /***************************************************************************/ 00085 class IString : public IValueType 00086 { 00087 HIDE_ASSIGNMENT_OPERATOR(IString) 00088 00089 public: 00090 /***********************************************************************/ 00094 /***********************************************************************/ 00095 virtual const wchar_t* MQUALIFIER c_bstr() const = 0; 00096 00097 /***********************************************************************/ 00110 /***********************************************************************/ 00111 virtual const char* MQUALIFIER c_str( BOOL_ERRORRETVAL(pError) ) const = 0; 00112 00113 /**************************************************************************/ 00121 /**************************************************************************/ 00122 virtual Float64 MQUALIFIER toFloat(Float64 dPreDef = 0.0, bool* pbError = NULL) const = 0; 00123 00124 /**************************************************************************/ 00132 /**************************************************************************/ 00133 virtual Int32 MQUALIFIER toInt(Int32 lPreDef = 0, bool* pbError = NULL) const = 0; 00134 00135 /**************************************************************************/ 00143 /**************************************************************************/ 00144 virtual Uint MQUALIFIER toUint(Uint uiPredef = 0, bool* pbError = NULL) const = 0; 00145 00146 /**************************************************************************/ 00155 /**************************************************************************/ 00156 virtual Timeval MQUALIFIER toTimeval(Timeval tmPredef = 0, bool* pbError = NULL) const = 0; 00157 00158 /**************************************************************************/ 00166 /**************************************************************************/ 00167 virtual bool MQUALIFIER toBool(bool bPredef = false, bool* pbError = NULL) const = 0; 00168 00169 /**************************************************************************/ 00174 /**************************************************************************/ 00175 virtual bool MQUALIFIER isFloat() const = 0; 00176 00177 /**************************************************************************/ 00182 /**************************************************************************/ 00183 virtual bool MQUALIFIER isInt() const = 0; 00184 00185 /**************************************************************************/ 00190 /**************************************************************************/ 00191 virtual bool MQUALIFIER isBool() const = 0; 00192 00193 /**************************************************************************/ 00200 /**************************************************************************/ 00201 virtual bool MQUALIFIER equals(const wchar_t* pInbuffer, bool bIgnoreCase = false) const = 0; 00202 00203 /**************************************************************************/ 00210 /**************************************************************************/ 00211 virtual bool MQUALIFIER equalsStr(const IString& rInstr, bool bIgnoreCase = false) const = 0; 00212 00213 /**************************************************************************/ 00217 /**************************************************************************/ 00218 virtual void MQUALIFIER concat(const wchar_t* pInbuffer) = 0; 00219 00220 /**************************************************************************/ 00224 /**************************************************************************/ 00225 virtual void MQUALIFIER concatStr(const IString& rInstr) = 0; 00226 00227 /**************************************************************************/ 00232 /**************************************************************************/ 00233 virtual void MQUALIFIER assign(const wchar_t* pInbuffer)=0; 00234 00235 /**************************************************************************/ 00239 /**************************************************************************/ 00240 virtual void MQUALIFIER assignStr(const IString& rInstr)=0; 00241 00242 /**************************************************************************/ 00246 /**************************************************************************/ 00247 virtual Int MQUALIFIER getSize() const = 0; 00248 00249 /**************************************************************************/ 00255 /**************************************************************************/ 00256 virtual wchar_t MQUALIFIER getChar(Int iIndex) const = 0; 00257 00258 00259 /**************************************************************************/ 00265 /**************************************************************************/ 00266 virtual Int MQUALIFIER getFirstPos(const wchar_t* pSubBuffer)const = 0; 00267 00268 /**************************************************************************/ 00274 /**************************************************************************/ 00275 virtual Int MQUALIFIER getFirstPosStr(const IString& rSubString)const = 0; 00276 00277 /**************************************************************************/ 00283 /**************************************************************************/ 00284 virtual Int MQUALIFIER getLastPos(const wchar_t* pSubBuffer)const = 0; 00285 00286 /**************************************************************************/ 00292 /**************************************************************************/ 00293 virtual Int MQUALIFIER getLastPosStr(const IString& rSubString)const = 0; 00294 00295 /**************************************************************************/ 00298 /**************************************************************************/ 00299 virtual void MQUALIFIER clear() = 0; 00300 00301 /**************************************************************************/ 00307 /**************************************************************************/ 00308 virtual bool MQUALIFIER isEmpty() const = 0; 00309 00310 /**************************************************************************/ 00316 /**************************************************************************/ 00317 virtual bool MQUALIFIER endsWith(const wchar_t* pString) const = 0; 00318 00319 /**************************************************************************/ 00325 /**************************************************************************/ 00326 virtual bool MQUALIFIER endsWithStr(const IString& rString) const = 0; 00327 00328 /**************************************************************************/ 00334 /**************************************************************************/ 00335 virtual bool MQUALIFIER startsWith(const wchar_t* pString) const = 0; 00336 00337 /**************************************************************************/ 00343 /**************************************************************************/ 00344 virtual bool MQUALIFIER startsWithStr(const IString& rString) const = 0; 00345 00346 /**************************************************************************/ 00354 /**************************************************************************/ 00355 virtual Int MQUALIFIER compareTo(const IString& rString) const=0; 00356 00357 /**************************************************************************/ 00363 /**************************************************************************/ 00364 virtual bool MQUALIFIER contains(const wchar_t* pSubString) const=0; 00365 00366 /**************************************************************************/ 00372 /**************************************************************************/ 00373 virtual bool MQUALIFIER containsStr(const IString& rSubString) const=0; 00374 00375 //Friend classes: DO NOT CHANGE 00376 friend class TStringList; 00377 friend class TZVariant; 00378 }; 00379 00380 END_NAMESPACE_Zeus 00381 00382 00383 #endif 00384