SCENE C++ API  2.1.0
lsstring.h
1 #pragma once
2 
3 #include <core_api/lsglobaldefinitions.h>
4 #include <core_api/lsinterface.h>
5 
6 namespace SCENE_API {
7 
8 // Forward declarations
9 class LSString_Implementation;
10 
13 class LSString : public LSInterface
14 {
15 public:
16 
18 
19 
22  CORE_API_EXPORT LSString();
23 
26  CORE_API_EXPORT LSString(const LSString& str);
27 
30  CORE_API_EXPORT LSString(const wchar_t* str);
31 
34  CORE_API_EXPORT LSString(const wchar_t& c);
35 
38  CORE_API_EXPORT ~LSString();
39 
42  CORE_API_EXPORT LSString& operator=(const LSString& str);
43 
46  CORE_API_EXPORT LSString& operator=(const wchar_t* str);
47 
49 
50 
52 
53 
58  CORE_API_EXPORT static LSString fromCharStr(const char* charStr);
59 
64  CORE_API_EXPORT static LSString fromUtf8Str(const char* utf8Str);
65 
69  CORE_API_EXPORT static LSString fromWcharStr(const wchar_t* wcharStr);
70 
72 
73 
75 
76 
82  CORE_API_EXPORT const char* toCharStr() const;
83 
89  CORE_API_EXPORT const char* toUtf8Str() const;
90 
95  CORE_API_EXPORT const wchar_t* toWcharStr() const;
96 
98 
99 
101 
102 
106  CORE_API_EXPORT bool empty() const;
107 
112  CORE_API_EXPORT int length() const;
113 
119  CORE_API_EXPORT int find(const LSString& str, int pos = 0) const;
120 
126  CORE_API_EXPORT int find(const wchar_t* str, int pos = 0) const;
127 
133  CORE_API_EXPORT int find(const wchar_t& c, int pos = 0) const;
134 
140  CORE_API_EXPORT int rfind(const LSString& str, int pos = -1) const;
141 
147  CORE_API_EXPORT int rfind(const wchar_t* str, int pos = -1) const;
148 
154  CORE_API_EXPORT int rfind(const wchar_t& c, int pos = -1) const;
155 
160  CORE_API_EXPORT LSString substr(int pos = 0, int len = -1) const;
161 
170  CORE_API_EXPORT int compare(const LSString& str) const;
171 
180  CORE_API_EXPORT int compare(const wchar_t* str) const;
181 
186  CORE_API_EXPORT LSString& replace(const LSString& before, const LSString& after);
187 
192  CORE_API_EXPORT LSString& replace(const LSString& before, const wchar_t* after);
193 
198  CORE_API_EXPORT LSString& replace(const wchar_t* before, const LSString& after);
199 
204  CORE_API_EXPORT LSString& replace(const wchar_t* before, const wchar_t* after);
205 
210  CORE_API_EXPORT LSString& replace(const wchar_t& before, const wchar_t& after);
211 
215  CORE_API_EXPORT LSString& append(const LSString& str);
216 
220  CORE_API_EXPORT LSString& append(const wchar_t* str);
221 
225  CORE_API_EXPORT LSString& append(const wchar_t& c);
226 
230  CORE_API_EXPORT LSString& operator+=(const LSString& str);
231 
235  CORE_API_EXPORT LSString& operator+=(const wchar_t* str);
236 
240  CORE_API_EXPORT LSString& operator+=(const wchar_t& c);
241 
243 
245 
246 
251  CORE_API_EXPORT wchar_t& operator[](int pos);
252 
257  CORE_API_EXPORT wchar_t operator[](int pos) const;
258 
263  CORE_API_EXPORT wchar_t& at(int pos);
264 
269  CORE_API_EXPORT wchar_t at(int pos) const;
270 
272 
273 
275 
276 
280  CORE_API_EXPORT void* operator new(size_t tSize);
281 
285  CORE_API_EXPORT void operator delete(void* p);
286 
288 
289 
290 protected:
291  LS_INTERFACE(LSString, LSInterface)
292 };
293 
295 
296 
302 CORE_API_EXPORT LSString operator+(const LSString& str1, const LSString& str2);
303 
309 CORE_API_EXPORT LSString operator+(const LSString& str1, const wchar_t* str2);
310 
316 CORE_API_EXPORT LSString operator+(const wchar_t* str1, const LSString& str2);
317 
318 
324 CORE_API_EXPORT LSString operator+(const LSString& str, const wchar_t& c);
325 
331 CORE_API_EXPORT LSString operator+(const wchar_t& c, const LSString& str);
332 
337 CORE_API_EXPORT bool operator== (const LSString& str1, const LSString& str2);
338 
340 
342 
343 
348 CORE_API_EXPORT bool operator== (const LSString& str1, const wchar_t* str2);
349 
354 CORE_API_EXPORT bool operator== (const wchar_t* str1, const LSString& str2);
355 
360 CORE_API_EXPORT bool operator!= (const LSString& str1, const LSString& str2);
361 
366 CORE_API_EXPORT bool operator!= (const LSString& str1, const wchar_t* str2);
367 
372 CORE_API_EXPORT bool operator!= (const wchar_t* str1, const LSString& str2);
373 
379 CORE_API_EXPORT bool operator< (const LSString& str1, const LSString& str2);
380 
386 CORE_API_EXPORT bool operator< (const LSString& str1, const wchar_t* str2);
387 
393 CORE_API_EXPORT bool operator< (const wchar_t* str1, const LSString& str2);
394 
400 CORE_API_EXPORT bool operator<= (const LSString& str1, const LSString& str2);
401 
407 CORE_API_EXPORT bool operator<= (const LSString& str1, const wchar_t* str2);
408 
414 CORE_API_EXPORT bool operator<= (const wchar_t* str1, const LSString& str2);
415 
421 CORE_API_EXPORT bool operator> (const LSString& str1, const LSString& str2);
422 
428 CORE_API_EXPORT bool operator> (const LSString& str1, const wchar_t* str2);
429 
435 CORE_API_EXPORT bool operator> (const wchar_t* str1, const LSString& str2);
436 
442 CORE_API_EXPORT bool operator>= (const LSString& str1, const LSString& str2);
443 
449 CORE_API_EXPORT bool operator>= (const LSString& str1, const wchar_t* str2);
450 
456 CORE_API_EXPORT bool operator>= (const wchar_t* str1, const LSString& str2);
457 
459 
460 }