EMA C++ Edition
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EmaString.h
Go to the documentation of this file.
1 /*|-----------------------------------------------------------------------------
2  *| This source code is provided under the Apache 2.0 license --
3  *| and is provided AS IS with no warranty or guarantee of fit for purpose. --
4  *| See the project's LICENSE.md for details. --
5  *| Copyright (C) 2019 Refinitiv. All rights reserved. --
6  *|-----------------------------------------------------------------------------
7  */
8 
9 #ifndef __thomsonreuters_ema_access_EmaString_h
10 #define __thomsonreuters_ema_access_EmaString_h
11 
48 #include "Access/Include/Common.h"
49 
50 namespace thomsonreuters {
51 
52 namespace ema {
53 
54 namespace access {
55 
57 {
58 public :
59 
64  static const UInt32 npos = -1;
65 
67 
68 
70  EmaString();
71 
81  EmaString( const char* str, UInt32 length = EmaString::npos );
82 
86  EmaString( const EmaString& other );
88 
90 
91 
93  virtual ~EmaString();
94  //}@
95 
97 
98 
101  EmaString& clear();
102 
111  EmaString& set( const char* str, UInt32 length = EmaString::npos );
112 
118  EmaString& operator=( const EmaString& other );
119 
126  EmaString& operator=( const char* other );
127 
133  EmaString& append( Int64 value );
134 
140  EmaString& append( UInt64 value );
141 
147  EmaString& append( Int32 value );
148 
154  EmaString& append( UInt32 value );
155 
161  EmaString& append( float value );
162 
168  EmaString& append( double value );
169 
175  EmaString& append( const char* value );
176 
182  EmaString& append( const EmaString& value );
183 
189  EmaString& operator+=( Int64 value );
190 
196  EmaString& operator+=( UInt64 value );
197 
203  EmaString& operator+=( Int32 value );
204 
210  EmaString& operator+=( UInt32 value );
211 
217  EmaString& operator+=( float value );
218 
224  EmaString& operator+=( double value );
225 
231  EmaString& operator+=( const char* value );
232 
238  EmaString& operator+=( const EmaString& value );
239 
245  EmaString operator+( const EmaString& str ) const;
246 
252  EmaString operator+( const char* str ) const;
253 
259  char& operator[]( UInt32 index );
260 
264  EmaString& trimWhitespace();
266 
268 
269 
272  bool empty() const;
273 
277  virtual const char* c_str() const;
278 
282  UInt32 length() const;
283 
289  char operator[]( UInt32 index ) const;
290 
297  EmaString substr( UInt32 index, UInt32 length ) const;
298 
303  operator const char* () const;
304 
311  Int32 find( const EmaString& str, Int32 index = 0 ) const;
312 
319  Int32 find( const char* str, Int32 index = 0 ) const;
320 
326  Int32 findLast( const EmaString& str ) const;
327 
333  Int32 findLast( const char* ) const;
334 
340  bool operator==( const EmaString& str ) const;
341 
347  bool operator!=( const EmaString& str ) const;
348 
354  bool operator>( const EmaString& str ) const;
355 
361  bool operator<( const EmaString& str ) const;
362 
368  bool operator>=( const EmaString& str ) const;
369 
375  bool operator<=( const EmaString& str ) const;
376 
382  bool operator==( const char* str ) const;
383 
389  bool operator!=( const char* str ) const;
390 
396  bool operator>( const char* str ) const;
397 
403  bool operator<( const char* str ) const;
404 
410  bool operator>=( const char* str ) const;
411 
417  bool operator<=( const char* str ) const;
418 
423  bool caseInsensitiveCompare( const EmaString& str ) const;
424 
429  bool caseInsensitiveCompare( const char * str ) const;
431 
432 protected:
433 
434  mutable char* _pString;
436  mutable UInt32 _capacity;
437 
438 private:
439 
440  int compare( const char * rhs ) const;
441 };
442 
443 }
444 
445 }
446 
447 }
448 
449 #endif //__thomsonreuters_ema_access_EmaString_h
long long Int64
represents 64-bit signed integer
Definition: Common.h:74
unsigned long long UInt64
represents 64-bit unsigned integer
Definition: Common.h:68
unsigned int UInt32
represents 32-bit unsigned integer
Definition: Common.h:56
EmaBuffer operator+(EmaBuffer buff_1, const EmaBuffer &buff_2)
EmaString class is a container of a null terminated Ascii character string.
Definition: EmaString.h:56
#define EMA_ACCESS_API
Definition: Common.h:95
int Int32
represents 32-bit signed integer
Definition: Common.h:62
Common.h file provides definitions of common variable types used in EMA.