Go to the
documentation of this file.
00001 #ifndef __FBSTRING_H__
00002 #define __FBSTRING_H__
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00043 #include <kaydaradef.h>
00044 
00045 #ifndef FBSDK_DLL
00046 
00049   #define FBSDK_DLL K_DLLIMPORT
00050 #endif
00051 
00052 #include <fbsdk/fbtypes.h>
00053 
00054 K_FORWARD( KStringList );
00055 
00056 #ifdef FBSDKUseNamespace
00057     namespace FBSDKNamespace {
00058 #endif
00059 
00061 
00063 
00066 class FBSDK_DLL FBString
00067 {
00068 private:
00069     char* mStr;
00070 
00071 public:
00073     FBString();
00074 
00078     FBString(const char* pStr);
00079 
00083     FBString(const FBString &pStr);
00084 
00089     FBString(const char* p1Str,const char* p2Str);
00090 
00092     ~FBString();
00093 
00095     operator char*() const;
00096     operator const char*() const;
00097 
00102     char  operator[](unsigned int pIndex) const;
00103 
00108     const FBString& operator=( const char* pStr );
00109 
00114     const FBString& operator=( const FBString &pStr );
00115 
00120     bool  operator == ( const FBString& pStr ) const;
00121     bool  operator == ( const char* pStr ) const;
00122     bool  operator == ( char* pStr ) const;
00123 
00128     bool  operator != ( const FBString& pStr ) const;
00129     bool  operator != ( const char* pStr ) const;
00130     bool  operator != ( char* pStr ) const;
00131 
00136     const FBString& operator+=( const char* pStr );
00137 
00142     FBString operator+( const char* pStr );
00143 
00148     FBString Mid( unsigned int pStart, unsigned int pLen ) const;
00149 
00154     FBString Left( unsigned int pLen ) const;
00155 
00160     FBString Right( unsigned int pLen ) const;
00161 
00165     unsigned int GetLen() const;
00166 
00170     bool IsEmpty() const;
00171 
00176     int Find( char pCar ) const;
00177 
00182     int ReverseFind( char pCar ) const;
00183 
00184 private:
00188     void Copy( const char* pStr );
00189 
00193     void Cat( const char* pStr );
00194 
00195     friend FBString operator+( const FBString& p1Str, const char* p2Str );
00196 };
00197 
00198 FBString operator+( const FBString& p1Str, const char* p2Str );
00199 
00201 class FBSDK_DLL FBStringList    
00202 {
00203 protected:
00205     KStringList* mItems;    
00206 public:
00208     FBStringList(); 
00209 
00211     ~FBStringList();
00212 
00213 public:
00215     KStringList*    GetInternal();
00216 
00221     kReference  GetReferenceAt( int pIndex );
00222 
00227     void SetReferenceAt( int pIndex,kReference pRef );
00228 
00233     int Find( kReference pRef );
00234 
00239     int Find( char *S );
00240 
00245     char *GetAt( int pIndex );
00246 
00252     char *operator[](int pIndex);
00253 
00255     void Sort( );
00256 
00260     int GetCount();
00261 
00266     int Remove( char *S );
00267 
00271     char* AsString();
00272 
00276     bool SetString( char *pString );
00277 
00278 public:  
00279 
00285     int  Add( char *S,kReference pRef = 0 );
00286 
00288     void Clear();
00289 
00293     void RemoveAt( int pIndex );
00294     
00299     int IndexOf( char *S );
00300     
00306     void InsertAt( int pIndex, char *S,kReference pRef = 0 );
00307 
00312     bool SetAt( int pIndex,char *pString );
00313 };
00314 
00316 
00318 #ifdef FBSDKUseNamespace
00319     }
00320 #endif
00321 
00322 #endif
00323