fbsdk/fbstring.h Source File

fbstring.h
Go to the documentation of this file.
1 #ifndef __FBSTRING_H__
2 #define __FBSTRING_H__
3 /**************************************************************************
4  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
5  All Rights Reserved.
6 
7  The coded instructions, statements, computer programs, and/or related
8  material (collectively the "Data") in these files contain unpublished
9  information proprietary to Autodesk, Inc. and/or its licensors, which is
10  protected by Canada and United States of America federal copyright law
11  and by international treaties.
12 
13  The Data may not be disclosed or distributed to third parties, in whole
14  or in part, without the prior written consent of Autodesk, Inc.
15  ("Autodesk").
16 
17  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24  FREE.
25 
26  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
36 
37 **************************************************************************/
38 
43 #include <kaydaradef.h>
44 
45 #ifndef FBSDK_DLL
46 
49  #define FBSDK_DLL K_DLLIMPORT
50 #endif
51 
52 #include <fbsdk/fbtypes.h>
53 
54 K_FORWARD( KStringList );
55 
56 #ifdef FBSDKUseNamespace
57  namespace FBSDKNamespace {
58 #endif
59 
61 // FBString
63 
67 {
68 private:
69  char* mStr;
70 
71 public:
73  FBString();
74 
78  FBString(const char* pStr);
79 
83  FBString(const FBString &pStr);
84 
89  FBString(const char* p1Str,const char* p2Str);
90 
92  ~FBString();
93 
95  operator char*() const;
96  operator const char*() const;
97 
102  char operator[](unsigned int pIndex) const;
103 
108  const FBString& operator=( const char* pStr );
109 
114  const FBString& operator=( const FBString &pStr );
115 
120  bool operator == ( const FBString& pStr ) const;
121  bool operator == ( const char* pStr ) const;
122  bool operator == ( char* pStr ) const;
123 
128  bool operator != ( const FBString& pStr ) const;
129  bool operator != ( const char* pStr ) const;
130  bool operator != ( char* pStr ) const;
131 
136  const FBString& operator+=( const char* pStr );
137 
142  FBString operator+( const char* pStr );
143 
148  FBString Mid( unsigned int pStart, unsigned int pLen ) const;
149 
154  FBString Left( unsigned int pLen ) const;
155 
160  FBString Right( unsigned int pLen ) const;
161 
165  unsigned int GetLen() const;
166 
170  bool IsEmpty() const;
171 
176  int Find( char pCar ) const;
177 
182  int ReverseFind( char pCar ) const;
183 
184 private:
188  void Copy( const char* pStr );
189 
193  void Cat( const char* pStr );
194 
195  friend FBString operator+( const FBString& p1Str, const char* p2Str );
196 };
197 
198 FBString operator+( const FBString& p1Str, const char* p2Str );
199 
201 class FBSDK_DLL FBStringList // This class is a direct wrapper it cannot have virtual functions
202 {
203 protected:
205  KStringList* mItems;
206 public:
208  FBStringList();
209 
214  FBStringList( const char *pString, const char pSeparator = '~');
215 
217  FBStringList(const FBStringList& pOther);
218 
223  FBStringList& operator= (const FBStringList& pOther);
224 
226  ~FBStringList();
227 
228 public:
230  KStringList* GetInternal() const;
231 
236  kReference GetReferenceAt( int pIndex ) const;
237 
242  void SetReferenceAt( int pIndex,kReference pRef );
243 
248  int Find( kReference pRef ) const;
249 
256  int Find( const char *pString, bool pCaseSensitive = true, bool pStartWith = false ) const;
257 
262  const char *GetAt( int pIndex ) const;
263 
269  const char *operator[](int pIndex) const;
270 
272  void Sort( );
273 
277  int GetCount() const;
278 
283  int Remove( const char *S );
284 
289  const char* AsString(const char pSeparator = '~') const;
290 
295  bool SetString( const char *pString, const char pSeparator = '~');
296 
302  int Add( const char *S,kReference pRef = 0 );
303 
305  void Clear();
306 
310  void RemoveAt( int pIndex );
311 
316  int IndexOf( const char *S ) const;
317 
323  void InsertAt( int pIndex, const char *S,kReference pRef = 0 );
324 
329  bool SetAt( int pIndex,const char *pString );
330 };
331 
333 // Global
335 #ifdef FBSDKUseNamespace
336  }
337 #endif
338 
339 #endif
340 
KStringList * mItems
Internal use only - List of items.
Definition: fbstring.h:205
K_FORWARD(KStringList)
Types & macros.
Basic string class.
Definition: fbstring.h:66
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbstring.h:49
Definition: Python-ast.h:18
FBString operator+(const FBString &p1Str, const char *p2Str)
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
String list.
Definition: fbstring.h:201
bool operator==(const FBPickInfos &pLhs, const FBPickInfos &pRhs)