27 #ifndef GENICAM_GCSTRING_H 28 #define GENICAM_GCSTRING_H 42 #define GCSTRING_NPOS size_t(-1) 52 # if defined(_MSC_VER) && !defined(PHARLAP_WIN32) 55 class GCBASE_API gcwchar
59 explicit gcwchar(
size_t n );
62 gcwchar(
const gcwchar &rhs );
65 gcwchar & operator = (
const gcwchar &rhs);
68 const wchar_t * c_str()
const;
71 size_t length()
const;
87 gcstring (
const char *pc,
size_t n );
90 # if defined(_MSC_VER) && !defined(PHARLAP_WIN32) 91 explicit gcstring (
const wchar_t *pBufferUTF16 );
92 gcstring (
const wchar_t *pBufferUTF16,
size_t n );
100 virtual gcstring & append (
size_t count,
char ch );
102 virtual gcstring & assign (
size_t count,
char ch );
103 virtual gcstring & assign (
const char *pc );
104 virtual gcstring & assign (
const char *pc,
size_t n );
105 # if defined(_MSC_VER) && !defined(PHARLAP_WIN32) 106 virtual gcstring & assign (
const wchar_t *pStringUTF16 );
107 virtual gcstring & assign (
const wchar_t *pStringUTF16,
int n );
109 virtual int compare (
const gcstring &str )
const;
110 # if defined(_MSC_VER) && !defined(PHARLAP_WIN32) 111 virtual gcwchar w_str (
void )
const;
113 virtual const char *c_str (
void )
const;
114 virtual bool empty (
void )
const;
115 virtual size_t find (
char ch,
size_t offset = 0 )
const;
116 virtual size_t find (
const gcstring &str,
size_t offset = 0 )
const;
117 virtual size_t find (
const gcstring &str,
size_t offset,
size_t count )
const;
118 virtual size_t find (
const char* pc,
size_t offset = 0)
const;
119 virtual size_t find (
const char* pc,
size_t offset,
size_t count )
const;
120 virtual size_t length (
void )
const;
121 virtual size_t size (
void )
const;
122 virtual void resize (
size_t n );
123 virtual void reserve (
size_t n = 0 );
125 virtual size_t max_size ( )
const;
127 virtual size_t find_first_of (
const gcstring &str,
size_t offset = 0 )
const;
128 virtual size_t find_first_not_of (
const gcstring &str,
size_t offset = 0 )
const;
130 virtual size_t find_last_of (
char c,
size_t offset =
GCSTRING_NPOS )
const;
132 virtual size_t find_last_not_of (
char c,
size_t offset =
GCSTRING_NPOS )
const;
133 static size_t _npos (
void );
134 virtual void swap (
gcstring &Right );
140 bool operator != (
const gcstring &str )
const;
141 bool operator != (
const char *pc )
const;
144 gcstring & operator += (
const char *pc );
147 gcstring operator += (
char ch )
const;
149 # if defined(_MSC_VER) && !defined(PHARLAP_WIN32) 150 gcstring & operator = (
const wchar_t *pStringUTF16 );
152 bool operator == (
const gcstring &str )
const;
153 bool operator == (
const char *pc )
const;
154 bool operator < (
const gcstring &str )
const;
155 bool operator > (
const gcstring &str )
const;
156 operator const char * ( void )
const;
157 void operator delete (
void *pWhere );
158 void operator delete (
void *pWhere,
void *pNewWhere );
159 void *
operator new (
size_t uiSize );
160 void *
operator new (
size_t uiSize,
void *pWhere );
174 uint8_t m_opaqueData[64];
181 static const size_t npos;
188 GCBASE_API
void ThrowBadAlloc(
const char *source,
int line);
198 str.assign(tmp.c_str(), tmp.size());
200 catch(std::bad_alloc &)
202 ThrowBadAlloc(__FILE__, __LINE__);
215 str.assign(tmp.c_str(), tmp.size());
217 catch(std::bad_alloc &)
219 ThrowBadAlloc(__FILE__, __LINE__);
236 catch(std::bad_alloc &)
238 GENICAM_NAMESPACE::ThrowBadAlloc(__FILE__, __LINE__);
251 str.assign(tmp.c_str(), tmp.size());
253 catch(std::bad_alloc &)
255 GENICAM_NAMESPACE::ThrowBadAlloc(__FILE__, __LINE__);
262 #endif // GENICAM_GCSTRING_H std::istream & getline(std::istream &is, GENICAM_NAMESPACE::gcstring &str, char delim)
Definition: GCString.h:209
std::ostream & operator<<(std::ostream &ostr, const GENICAM_NAMESPACE::gcstring &str)
Definition: GCString.h:229
std::istream & operator>>(std::istream &istr, GENICAM_NAMESPACE::gcstring &str)
Definition: GCString.h:245
A string class which is a clone of std::string.
Definition: GCString.h:50
#define GCSTRING_NPOS
Indicates either 'not found' or 'all remaining characters'.
Definition: GCString.h:42
Platform-dependent type definitions.