orx  1.14
Portable Game Engine
orxString.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2022 Orx-Project
4  *
5  * This software is provided 'as-is', without any express or implied
6  * warranty. In no event will the authors be held liable for any damages
7  * arising from the use of this software.
8  *
9  * Permission is granted to anyone to use this software for any purpose,
10  * including commercial applications, and to alter it and redistribute it
11  * freely, subject to the following restrictions:
12  *
13  * 1. The origin of this software must not be misrepresented; you must not
14  * claim that you wrote the original software. If you use this software
15  * in a product, an acknowledgment in the product documentation would be
16  * appreciated but is not required.
17  *
18  * 2. Altered source versions must be plainly marked as such, and must not be
19  * misrepresented as being the original software.
20  *
21  * 3. This notice may not be removed or altered from any source
22  * distribution.
23  */
24 
44 #ifndef _orxSTRING_H_
45 #define _orxSTRING_H_
46 
47 
48 #include "orxInclude.h"
49 
50 #include "math/orxVector.h"
51 #include "memory/orxMemory.h"
52 
53 #ifdef __orxMSVC__
54 
55  #pragma warning(disable : 4996)
56 
57  #define strtoll _strtoi64
58  #define strtoull _strtoui64
59 
60 #endif /* __orxMSVC__ */
61 
62 #define STRTO_CAST (int)
63 
64 #include <stdio.h>
65 #include <stdarg.h>
66 #include <string.h>
67 #include <stdlib.h>
68 
69 #ifndef __orxWINDOWS__
70  #include <strings.h>
71 #endif /* !__orxWINDOWS__ */
72 
73 #include "debug/orxDebug.h"
74 
75 
76 #define orxSTRING_KC_VECTOR_START '('
77 #define orxSTRING_KC_VECTOR_START_ALT '{'
78 #define orxSTRING_KC_VECTOR_SEPARATOR ','
79 #define orxSTRING_KC_VECTOR_END ')'
80 #define orxSTRING_KC_VECTOR_END_ALT '}'
81 
82 
83 
86 #define orxString_ToCRC orxString_Hash
87 
88 
89 /* *** String inlined functions *** */
90 
91 
96 static orxINLINE const orxSTRING orxString_SkipWhiteSpaces(const orxSTRING _zString)
97 {
98  const orxSTRING zResult;
99 
100  /* Non null? */
101  if(_zString != orxNULL)
102  {
103  /* Skips all white spaces */
104  for(zResult = _zString; (*zResult == ' ') || (*zResult == '\t') || (*zResult == orxCHAR_CR) || (*zResult == orxCHAR_LF); zResult++);
105 
106  /* Empty? */
107  if(*zResult == orxCHAR_NULL)
108  {
109  /* Updates result */
110  zResult = orxSTRING_EMPTY;
111  }
112  }
113  else
114  {
115  /* Updates result */
116  zResult = orxNULL;
117  }
118 
119  /* Done! */
120  return zResult;
121 }
122 
127 static orxINLINE const orxSTRING orxString_SkipPath(const orxSTRING _zString)
128 {
129  const orxSTRING zResult;
130 
131  /* Non null? */
132  if(_zString != orxNULL)
133  {
134  const orxCHAR *pc;
135 
136  /* Updates result */
137  zResult = _zString;
138 
139  /* For all characters */
140  for(pc = _zString; *pc != orxCHAR_NULL; pc++)
141  {
142  /* Is a directory separator? */
144  {
145  orxCHAR cNextChar = *(pc + 1);
146 
147  /* Non terminal and not a directory separator? */
148  if((cNextChar != orxCHAR_NULL) && (cNextChar != orxCHAR_DIRECTORY_SEPARATOR_LINUX) && (cNextChar != orxCHAR_DIRECTORY_SEPARATOR_WINDOWS))
149  {
150  /* Updates result */
151  zResult = pc + 1;
152  }
153  }
154  }
155  }
156  else
157  {
158  /* Updates result */
159  zResult = orxNULL;
160  }
161 
162  /* Done! */
163  return zResult;
164 }
165 
170 static orxINLINE orxU32 orxString_GetLength(const orxSTRING _zString)
171 {
172  /* Checks */
173  orxASSERT(_zString != orxNULL);
174 
175  /* Done! */
176  return((orxU32)strlen(_zString));
177 }
178 
183 static orxINLINE orxBOOL orxString_IsCharacterASCII(orxU32 _u32CharacterCodePoint)
184 {
185  /* Done! */
186  return((_u32CharacterCodePoint < 0x80) ? orxTRUE : orxFALSE);
187 }
188 
193 static orxINLINE orxBOOL orxString_IsCharacterAlphaNumeric(orxU32 _u32CharacterCodePoint)
194 {
195  /* Done! */
196  return(((_u32CharacterCodePoint >= 'a') && (_u32CharacterCodePoint <= 'z'))
197  || ((_u32CharacterCodePoint >= 'A') && (_u32CharacterCodePoint <= 'Z'))
198  || ((_u32CharacterCodePoint >= '0') && (_u32CharacterCodePoint <= '9'))) ? orxTRUE : orxFALSE;
199 }
200 
205 static orxINLINE orxU32 orxString_GetUTF8CharacterLength(orxU32 _u32CharacterCodePoint)
206 {
207  orxU32 u32Result;
208 
209  /* 1-byte long? */
210  if(_u32CharacterCodePoint < 0x80)
211  {
212  /* Updates result */
213  u32Result = 1;
214  }
215  else if(_u32CharacterCodePoint < 0x0800)
216  {
217  /* Updates result */
218  u32Result = 2;
219  }
220  else if(_u32CharacterCodePoint < 0x00010000)
221  {
222  /* Updates result */
223  u32Result = 3;
224  }
225  else if(_u32CharacterCodePoint < 0x00110000)
226  {
227  /* Updates result */
228  u32Result = 4;
229  }
230  else
231  {
232  /* Updates result */
233  u32Result = orxU32_UNDEFINED;
234  }
235 
236  /* Done! */
237  return u32Result;
238 }
239 
246 static orxU32 orxFASTCALL orxString_PrintUTF8Character(orxSTRING _zDstString, orxU32 _u32Size, orxU32 _u32CharacterCodePoint)
247 {
248  orxU32 u32Result;
249 
250  /* Gets character's encoded length */
251  u32Result = orxString_GetUTF8CharacterLength(_u32CharacterCodePoint);
252 
253  /* Enough room? */
254  if(u32Result <= _u32Size)
255  {
256  /* Depending on character's length */
257  switch(u32Result)
258  {
259  case 1:
260  {
261  /* Writes character */
262  *_zDstString = (orxCHAR)_u32CharacterCodePoint;
263 
264  break;
265  }
266 
267  case 2:
268  {
269  /* Writes first character */
270  *_zDstString++ = (orxCHAR)(0xC0 | ((_u32CharacterCodePoint & 0x07C0) >> 6));
271 
272  /* Writes second character */
273  *_zDstString = (orxCHAR)(0x80 | (_u32CharacterCodePoint & 0x3F));
274 
275  break;
276  }
277 
278  case 3:
279  {
280  /* Writes first character */
281  *_zDstString++ = (orxCHAR)(0xE0 | ((_u32CharacterCodePoint & 0xF000) >> 12));
282 
283  /* Writes second character */
284  *_zDstString++ = (orxCHAR)(0x80 | ((_u32CharacterCodePoint & 0x0FC0) >> 6));
285 
286  /* Writes third character */
287  *_zDstString = (orxCHAR)(0x80 | (_u32CharacterCodePoint & 0x3F));
288 
289  break;
290  }
291 
292  case 4:
293  {
294  /* Writes first character */
295  *_zDstString++ = (orxCHAR)(0xF0 | ((_u32CharacterCodePoint & 0x001C0000) >> 18));
296 
297  /* Writes second character */
298  *_zDstString++ = (orxCHAR)(0x80 | ((_u32CharacterCodePoint & 0x0003F000) >> 12));
299 
300  /* Writes third character */
301  *_zDstString++ = (orxCHAR)(0x80 | ((_u32CharacterCodePoint & 0x00000FC0) >> 6));
302 
303  /* Writes fourth character */
304  *_zDstString = (orxCHAR)(0x80 | (_u32CharacterCodePoint & 0x3F));
305 
306  break;
307  }
308 
309  default:
310  {
311  /* Logs message */
312  orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Can't print invalid unicode character <0x%X> to string.", _u32CharacterCodePoint);
313 
314  /* Updates result */
315  u32Result = orxU32_UNDEFINED;
316 
317  break;
318  }
319  }
320  }
321  else
322  {
323  /* Logs message */
324  orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Can't print unicode character <0x%X> to string as there isn't enough space for it.", _u32CharacterCodePoint);
325 
326  /* Updates result */
327  u32Result = orxU32_UNDEFINED;
328  }
329 
330  /* Done! */
331  return u32Result;
332 }
333 
339 static orxU32 orxFASTCALL orxString_GetFirstCharacterCodePoint(const orxSTRING _zString, const orxSTRING *_pzRemaining)
340 {
341  const orxU8 *pu8Byte;
342  orxU32 u32Result;
343 
344  /* Checks */
345  orxASSERT(_zString != orxNULL);
346 
347  /* Gets the first byte */
348  pu8Byte = (const orxU8 *)_zString;
349 
350  /* ASCII? */
351  if(*pu8Byte < 0x80)
352  {
353  /* Updates result */
354  u32Result = *pu8Byte;
355  }
356  /* Invalid UTF-8 byte sequence */
357  else if(*pu8Byte < 0xC0)
358  {
359  /* Logs message */
360  orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Invalid or non-UTF-8 string at <0x%X>: multi-byte sequence non-leading byte '%c' (0x%2X) at index %d.", _zString, *pu8Byte, *pu8Byte, pu8Byte - (orxU8 *)_zString);
361 
362  /* Updates result */
363  u32Result = orxU32_UNDEFINED;
364  }
365  /* Overlong UTF-8 2-byte sequence */
366  else if(*pu8Byte < 0xC2)
367  {
368  /* Logs message */
369  orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Invalid or non-UTF-8 string at <0x%X>: overlong 2-byte sequence starting with byte '%c' (0x%2X) at index %d.", _zString, *pu8Byte, *pu8Byte, pu8Byte - (orxU8 *)_zString);
370 
371  /* Updates result */
372  u32Result = orxU32_UNDEFINED;
373  }
374  /* 2-byte sequence */
375  else if(*pu8Byte < 0xE0)
376  {
377  /* Updates result with first character */
378  u32Result = *pu8Byte++ & 0x1F;
379 
380  /* Valid second character? */
381  if((*pu8Byte & 0xC0) == 0x80)
382  {
383  /* Updates result */
384  u32Result = (u32Result << 6) | (*pu8Byte & 0x3F);
385  }
386  else
387  {
388  /* Logs message */
389  orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Invalid or non-UTF-8 string at <0x%X>: 2-byte sequence non-trailing byte '%c' (0x%2X) at index %d.", _zString, *pu8Byte, *pu8Byte, pu8Byte - (orxU8 *)_zString);
390 
391  /* Updates result */
392  u32Result = orxU32_UNDEFINED;
393  }
394  }
395  /* 3-byte sequence */
396  else if(*pu8Byte < 0xF0)
397  {
398  /* Updates result with first character */
399  u32Result = *pu8Byte++ & 0x0F;
400 
401  /* Valid second character? */
402  if((*pu8Byte & 0xC0) == 0x80)
403  {
404  /* Updates result */
405  u32Result = (u32Result << 6) | (*pu8Byte++ & 0x3F);
406 
407  /* Valid third character? */
408  if((*pu8Byte & 0xC0) == 0x80)
409  {
410  /* Updates result */
411  u32Result = (u32Result << 6) | (*pu8Byte & 0x3F);
412  }
413  else
414  {
415  /* Logs message */
416  orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Invalid or non-UTF-8 string at <0x%X>: 3-byte sequence non-trailing byte '%c' (0x%2X) at index %d.", _zString, *pu8Byte, *pu8Byte, pu8Byte - (orxU8 *)_zString);
417 
418  /* Updates result */
419  u32Result = orxU32_UNDEFINED;
420  }
421  }
422  else
423  {
424  /* Logs message */
425  orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Invalid or non-UTF-8 string at <0x%X>: 3-byte sequence non-trailing byte '%c' (0x%2X) at index %d.", _zString, *pu8Byte, *pu8Byte, pu8Byte - (orxU8 *)_zString);
426 
427  /* Updates result */
428  u32Result = orxU32_UNDEFINED;
429  }
430  }
431  /* 4-byte sequence */
432  else if(*pu8Byte < 0xF5)
433  {
434  /* Updates result with first character */
435  u32Result = *pu8Byte++ & 0x07;
436 
437  /* Valid second character? */
438  if((*pu8Byte & 0xC0) == 0x80)
439  {
440  /* Updates result */
441  u32Result = (u32Result << 6) | (*pu8Byte++ & 0x3F);
442 
443  /* Valid third character? */
444  if((*pu8Byte & 0xC0) == 0x80)
445  {
446  /* Updates result */
447  u32Result = (u32Result << 6) | (*pu8Byte++ & 0x3F);
448 
449  /* Valid fourth character? */
450  if((*pu8Byte & 0xC0) == 0x80)
451  {
452  /* Updates result */
453  u32Result = (u32Result << 6) | (*pu8Byte & 0x3F);
454  }
455  else
456  {
457  /* Logs message */
458  orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Invalid or non-UTF-8 string at <0x%X>: 4-byte sequence non-trailing byte '%c' (0x%2X) at index %d.", _zString, *pu8Byte, *pu8Byte, pu8Byte - (orxU8 *)_zString);
459 
460  /* Updates result */
461  u32Result = orxU32_UNDEFINED;
462  }
463  }
464  else
465  {
466  /* Logs message */
467  orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Invalid or non-UTF-8 string at <0x%X>: 4-byte sequence non-trailing byte '%c' (0x%2X) at index %d.", _zString, *pu8Byte, *pu8Byte, pu8Byte - (orxU8 *)_zString);
468 
469  /* Updates result */
470  u32Result = orxU32_UNDEFINED;
471  }
472  }
473  else
474  {
475  /* Logs message */
476  orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Invalid or non-UTF-8 string at <0x%X>: 4-byte sequence non-trailing byte '%c' (0x%2X) at index %d.", _zString, *pu8Byte, *pu8Byte, pu8Byte - (orxU8 *)_zString);
477 
478  /* Updates result */
479  u32Result = orxU32_UNDEFINED;
480  }
481  }
482  else
483  {
484  /* Logs message */
485  orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Invalid or non-UTF-8 string at <0x%X>: invalid out-of-bound byte '%c' (0x%2X) at index %d.", _zString, *pu8Byte, *pu8Byte, pu8Byte - (orxU8 *)_zString);
486 
487  /* Updates result */
488  u32Result = orxU32_UNDEFINED;
489  }
490 
491  /* Asks for remaining string? */
492  if(_pzRemaining != orxNULL)
493  {
494  /* Stores it */
495  *_pzRemaining = (orxSTRING)(pu8Byte + 1);
496  }
497 
498  /* Done! */
499  return u32Result;
500 }
501 
506 static orxINLINE orxU32 orxString_GetCharacterCount(const orxSTRING _zString)
507 {
508  const orxCHAR *pc;
509  orxU32 u32Result;
510 
511  /* Checks */
512  orxASSERT(_zString != orxNULL);
513 
514  /* For all characters */
515  for(pc = _zString, u32Result = 0; *pc != orxCHAR_NULL; u32Result++)
516  {
517  /* Invalid current character ID */
519  {
520  /* Updates result */
521  u32Result = orxU32_UNDEFINED;
522 
523  /* Logs message */
524  orxDEBUG_PRINT(orxDEBUG_LEVEL_SYSTEM, "Invalid or non-UTF8 string <%s>, can't count characters.", _zString);
525 
526  break;
527  }
528  }
529 
530  /* Done! */
531  return u32Result;
532 }
533 
540 static orxINLINE orxSTRING orxString_NCopy(orxSTRING _zDstString, const orxSTRING _zSrcString, orxU32 _u32CharNumber)
541 {
542  /* Checks */
543  orxASSERT(_zDstString != orxNULL);
544  orxASSERT(_zSrcString != orxNULL);
545  orxASSERT(_u32CharNumber > 0);
546 
547  /* Done! */
548  return(strncpy(_zDstString, _zSrcString, (size_t)_u32CharNumber));
549 }
550 
555 static orxINLINE orxSTRING orxString_Duplicate(const orxSTRING _zSrcString)
556 {
557  orxU32 u32Size;
558  orxSTRING zResult;
559 
560  /* Checks */
561  orxASSERT(_zSrcString != orxNULL);
562 
563  /* Gets string size in bytes */
564  u32Size = (orxString_GetLength(_zSrcString) + 1) * sizeof(orxCHAR);
565 
566  /* Allocates it */
567  zResult = (orxSTRING)orxMemory_Allocate(u32Size, orxMEMORY_TYPE_TEXT);
568 
569  /* Valid? */
570  if(zResult != orxNULL)
571  {
572  /* Copies source to it */
573  orxMemory_Copy(zResult, _zSrcString, u32Size);
574  }
575 
576  /* Done! */
577  return zResult;
578 }
579 
583 static orxINLINE orxSTATUS orxString_Delete(orxSTRING _zString)
584 {
585  /* Checks */
586  orxASSERT(_zString != orxNULL);
587  orxASSERT(_zString != orxSTRING_EMPTY);
588 
589  /* Frees its memory */
590  orxMemory_Free(_zString);
591 
592  /* Done! */
593  return orxSTATUS_SUCCESS;
594 }
595 
602 static orxINLINE orxS32 orxString_Compare(const orxSTRING _zString1, const orxSTRING _zString2)
603 {
604  /* Checks */
605  orxASSERT(_zString1 != orxNULL);
606  orxASSERT(_zString2 != orxNULL);
607 
608  /* Done! */
609  return(strcmp(_zString1, _zString2));
610 }
611 
620 static orxINLINE orxS32 orxString_NCompare(const orxSTRING _zString1, const orxSTRING _zString2, orxU32 _u32CharNumber)
621 {
622  /* Checks */
623  orxASSERT(_zString1 != orxNULL);
624  orxASSERT(_zString2 != orxNULL);
625 
626  /* Done! */
627  return(strncmp(_zString1, _zString2, (size_t)_u32CharNumber));
628 }
629 
636 static orxINLINE orxS32 orxString_ICompare(const orxSTRING _zString1, const orxSTRING _zString2)
637 {
638  /* Checks */
639  orxASSERT(_zString1 != orxNULL);
640  orxASSERT(_zString2 != orxNULL);
641 
642 #ifdef __orxWINDOWS__
643 
644  /* Done! */
645  return(stricmp(_zString1, _zString2));
646 
647 #else /* __orxWINDOWS__ */
648 
649  /* Done! */
650  return(strcasecmp(_zString1, _zString2));
651 
652 #endif /* __orxWINDOWS__ */
653 }
654 
663 static orxINLINE orxS32 orxString_NICompare(const orxSTRING _zString1, const orxSTRING _zString2, orxU32 _u32CharNumber)
664 {
665  /* Checks */
666  orxASSERT(_zString1 != orxNULL);
667  orxASSERT(_zString2 != orxNULL);
668 
669 #ifdef __orxWINDOWS__
670 
671  /* Done! */
672  return(strnicmp(_zString1, _zString2, (size_t)_u32CharNumber));
673 
674 #else /* __orxWINDOWS__ */
675 
676  /* Done! */
677  return(strncasecmp(_zString1, _zString2, _u32CharNumber));
678 
679 #endif /* __orxWINDOWS__ */
680 }
681 
687 static orxINLINE orxU32 orxString_ExtractBase(const orxSTRING _zString, const orxSTRING *_pzRemaining)
688 {
689  const orxSTRING zString;
690  orxU32 u32Result, u32Offset;
691 
692  /* Checks */
693  orxASSERT(_zString != orxNULL);
694 
695  /* Skips white spaces */
696  zString = orxString_SkipWhiteSpaces(_zString);
697 
698  /* Default result and offset: decimal */
699  u32Result = 10;
700  u32Offset = 0;
701 
702  /* Depending on first character */
703  switch(zString[0])
704  {
705  case '0':
706  {
707  /* Depending on second character */
708  switch(zString[1] | 0x20)
709  {
710  case 'x':
711  {
712  /* Updates result and offset: hexadecimal */
713  u32Result = 16;
714  u32Offset = 2;
715 
716  break;
717  }
718 
719  case 'b':
720  {
721  /* Updates result and offset: binary */
722  u32Result = 2;
723  u32Offset = 2;
724 
725  break;
726  }
727 
728  default:
729  {
730  /* Octal? */
731  if((zString[1] >= '0')
732  && (zString[1] <= '9'))
733  {
734  /* Updates result and offset: octal */
735  u32Result = 8;
736  u32Offset = 1;
737  }
738 
739  break;
740  }
741  }
742 
743  break;
744  }
745 
746  case '#':
747  {
748  /* Updates result and offset: hexadecimal */
749  u32Result = 16;
750  u32Offset = 1;
751 
752  break;
753  }
754 
755  default:
756  {
757  break;
758  }
759  }
760 
761  /* Asks for remaining string? */
762  if(_pzRemaining != orxNULL)
763  {
764  /* Stores it */
765  *_pzRemaining = zString + u32Offset;
766  }
767 
768  /* Done! */
769  return u32Result;
770 }
771 
779 static orxINLINE orxSTATUS orxString_ToS32Base(const orxSTRING _zString, orxU32 _u32Base, orxS32 *_ps32OutValue, const orxSTRING *_pzRemaining)
780 {
781  orxCHAR *pcEnd;
782  orxSTATUS eResult;
783 
784  /* Checks */
785  orxASSERT(_ps32OutValue != orxNULL);
786  orxASSERT(_zString != orxNULL);
787 
788  /* Convert */
789  *_ps32OutValue = (orxS32)strtol(_zString, &pcEnd, STRTO_CAST _u32Base);
790 
791  /* Valid conversion ? */
792  if((pcEnd != _zString) && (_zString[0] != orxCHAR_NULL))
793  {
794  /* Updates result */
795  eResult = orxSTATUS_SUCCESS;
796  }
797  else
798  {
799  /* Updates result */
800  eResult = orxSTATUS_FAILURE;
801  }
802 
803  /* Asks for remaining string? */
804  if(_pzRemaining != orxNULL)
805  {
806  /* Stores it */
807  *_pzRemaining = pcEnd;
808  }
809 
810  /* Done! */
811  return eResult;
812 }
813 
820 static orxINLINE orxSTATUS orxString_ToS32(const orxSTRING _zString, orxS32 *_ps32OutValue, const orxSTRING *_pzRemaining)
821 {
822  const orxSTRING zValue;
823  orxU32 u32Base;
824  orxSTATUS eResult;
825 
826  /* Checks */
827  orxASSERT(_ps32OutValue != orxNULL);
828  orxASSERT(_zString != orxNULL);
829 
830  /* Extracts base */
831  u32Base = orxString_ExtractBase(_zString, &zValue);
832 
833  /* Gets value */
834  eResult = orxString_ToS32Base(zValue, u32Base, _ps32OutValue, _pzRemaining);
835 
836  /* Done! */
837  return eResult;
838 }
839 
847 static orxINLINE orxSTATUS orxString_ToU32Base(const orxSTRING _zString, orxU32 _u32Base, orxU32 *_pu32OutValue, const orxSTRING *_pzRemaining)
848 {
849  orxCHAR *pcEnd;
850  orxSTATUS eResult;
851 
852  /* Checks */
853  orxASSERT(_pu32OutValue != orxNULL);
854  orxASSERT(_zString != orxNULL);
855 
856  /* Convert */
857  *_pu32OutValue = (orxU32)strtoul(_zString, &pcEnd, STRTO_CAST _u32Base);
858 
859  /* Valid conversion ? */
860  if((pcEnd != _zString) && (_zString[0] != orxCHAR_NULL))
861  {
862  /* Updates result */
863  eResult = orxSTATUS_SUCCESS;
864  }
865  else
866  {
867  /* Updates result */
868  eResult = orxSTATUS_FAILURE;
869  }
870 
871  /* Asks for remaining string? */
872  if(_pzRemaining != orxNULL)
873  {
874  /* Stores it */
875  *_pzRemaining = pcEnd;
876  }
877 
878  /* Done! */
879  return eResult;
880 }
881 
888 static orxINLINE orxSTATUS orxString_ToU32(const orxSTRING _zString, orxU32 *_pu32OutValue, const orxSTRING *_pzRemaining)
889 {
890  const orxSTRING zValue;
891  orxU32 u32Base;
892  orxSTATUS eResult;
893 
894  /* Checks */
895  orxASSERT(_pu32OutValue != orxNULL);
896  orxASSERT(_zString != orxNULL);
897 
898  /* Extracts base */
899  u32Base = orxString_ExtractBase(_zString, &zValue);
900 
901  /* Gets value */
902  eResult = orxString_ToU32Base(zValue, u32Base, _pu32OutValue, _pzRemaining);
903 
904  /* Done! */
905  return eResult;
906 }
907 
915 static orxINLINE orxSTATUS orxString_ToS64Base(const orxSTRING _zString, orxU32 _u32Base, orxS64 *_ps64OutValue, const orxSTRING *_pzRemaining)
916 {
917  orxCHAR *pcEnd;
918  orxSTATUS eResult;
919 
920  /* Checks */
921  orxASSERT(_ps64OutValue != orxNULL);
922  orxASSERT(_zString != orxNULL);
923 
924  /* Convert */
925  *_ps64OutValue = (orxS64)strtoll(_zString, &pcEnd, STRTO_CAST _u32Base);
926 
927  /* Valid conversion ? */
928  if((pcEnd != _zString) && (_zString[0] != orxCHAR_NULL))
929  {
930  /* Updates result */
931  eResult = orxSTATUS_SUCCESS;
932  }
933  else
934  {
935  /* Updates result */
936  eResult = orxSTATUS_FAILURE;
937  }
938 
939  /* Asks for remaining string? */
940  if(_pzRemaining != orxNULL)
941  {
942  /* Stores it */
943  *_pzRemaining = pcEnd;
944  }
945 
946  /* Done! */
947  return eResult;
948 }
949 
956 static orxINLINE orxSTATUS orxString_ToS64(const orxSTRING _zString, orxS64 *_ps64OutValue, const orxSTRING *_pzRemaining)
957 {
958  const orxSTRING zValue;
959  orxU32 u32Base;
960  orxSTATUS eResult;
961 
962  /* Checks */
963  orxASSERT(_ps64OutValue != orxNULL);
964  orxASSERT(_zString != orxNULL);
965 
966  /* Extracts base */
967  u32Base = orxString_ExtractBase(_zString, &zValue);
968 
969  /* Gets signed value */
970  eResult = orxString_ToS64Base(zValue, u32Base, _ps64OutValue, _pzRemaining);
971 
972  /* Done! */
973  return eResult;
974 }
975 
983 static orxINLINE orxSTATUS orxString_ToU64Base(const orxSTRING _zString, orxU32 _u32Base, orxU64 *_pu64OutValue, const orxSTRING *_pzRemaining)
984 {
985  orxCHAR *pcEnd;
986  orxSTATUS eResult;
987 
988  /* Checks */
989  orxASSERT(_pu64OutValue != orxNULL);
990  orxASSERT(_zString != orxNULL);
991 
992  /* Convert */
993  *_pu64OutValue = (orxU64)strtoull(_zString, &pcEnd, STRTO_CAST _u32Base);
994 
995  /* Valid conversion ? */
996  if((pcEnd != _zString) && (_zString[0] != orxCHAR_NULL))
997  {
998  /* Updates result */
999  eResult = orxSTATUS_SUCCESS;
1000  }
1001  else
1002  {
1003  /* Updates result */
1004  eResult = orxSTATUS_FAILURE;
1005  }
1006 
1007  /* Asks for remaining string? */
1008  if(_pzRemaining != orxNULL)
1009  {
1010  /* Stores it */
1011  *_pzRemaining = pcEnd;
1012  }
1013 
1014  /* Done! */
1015  return eResult;
1016 }
1017 
1024 static orxINLINE orxSTATUS orxString_ToU64(const orxSTRING _zString, orxU64 *_pu64OutValue, const orxSTRING *_pzRemaining)
1025 {
1026  const orxSTRING zValue;
1027  orxU32 u32Base;
1028  orxSTATUS eResult;
1029 
1030  /* Checks */
1031  orxASSERT(_pu64OutValue != orxNULL);
1032  orxASSERT(_zString != orxNULL);
1033 
1034  /* Extracts base */
1035  u32Base = orxString_ExtractBase(_zString, &zValue);
1036 
1037  /* Gets signed value */
1038  eResult = orxString_ToU64Base(zValue, u32Base, _pu64OutValue, _pzRemaining);
1039 
1040  /* Done! */
1041  return eResult;
1042 }
1043 
1050 static orxINLINE orxSTATUS orxString_ToFloat(const orxSTRING _zString, orxFLOAT *_pfOutValue, const orxSTRING *_pzRemaining)
1051 {
1052  orxCHAR *pcEnd;
1053  orxSTATUS eResult;
1054 
1055  /* Checks */
1056  orxASSERT(_pfOutValue != orxNULL);
1057  orxASSERT(_zString != orxNULL);
1058 
1059  /* Linux / Mac / iOS / Android / MSVC? */
1060 #if defined(__orxLINUX__) || defined(__orxMAC__) || defined (__orxIOS__) || defined(__orxMSVC__) || defined(__orxANDROID__)
1061 
1062  /* Converts it */
1063  *_pfOutValue = (orxFLOAT)strtod(_zString, &pcEnd);
1064 
1065 #else /* __orxLINUX__ || __orxMAC__ || __orxIOS__ || __orxMSVC__ || __orxANDROID__ */
1066 
1067  /* Converts it */
1068  *_pfOutValue = strtof(_zString, &pcEnd);
1069 
1070 #endif /* __orxLINUX__ || __orxMAC__ || __orxIOS__ || __orxMSVC__ || __orxANDROID__ */
1071 
1072  /* Valid conversion ? */
1073  if((pcEnd != _zString) && (_zString[0] != orxCHAR_NULL))
1074  {
1075  /* Updates result */
1076  eResult = orxSTATUS_SUCCESS;
1077  }
1078  else
1079  {
1080  /* Updates result */
1081  eResult = orxSTATUS_FAILURE;
1082  }
1083 
1084  /* Asks for remaining string? */
1085  if(_pzRemaining != orxNULL)
1086  {
1087  /* Stores it */
1088  *_pzRemaining = pcEnd;
1089  }
1090 
1091  /* Done! */
1092  return eResult;
1093 }
1094 
1101 static orxINLINE orxSTATUS orxString_ToVector(const orxSTRING _zString, orxVECTOR *_pvOutValue, const orxSTRING *_pzRemaining)
1102 {
1103  orxVECTOR stValue;
1104  const orxSTRING zString;
1105  orxSTATUS eResult = orxSTATUS_FAILURE;
1106 
1107  /* Checks */
1108  orxASSERT(_pvOutValue != orxNULL);
1109  orxASSERT(_zString != orxNULL);
1110 
1111  /* Skips all white spaces */
1112  zString = orxString_SkipWhiteSpaces(_zString);
1113 
1114  /* Is a vector start character? */
1115  if((*zString == orxSTRING_KC_VECTOR_START)
1116  || (*zString == orxSTRING_KC_VECTOR_START_ALT))
1117  {
1118  orxCHAR cEndMarker;
1119 
1120  /* Gets end marker */
1122 
1123  /* Skips all white spaces */
1124  zString = orxString_SkipWhiteSpaces(zString + 1);
1125 
1126  /* Gets X value */
1127  if(orxString_ToFloat(zString, &(stValue.fX), &zString) != orxSTATUS_FAILURE)
1128  {
1129  /* Skips all white spaces */
1130  zString = orxString_SkipWhiteSpaces(zString);
1131 
1132  /* Is a vector separator character? */
1133  if(*zString == orxSTRING_KC_VECTOR_SEPARATOR)
1134  {
1135  /* Skips all white spaces */
1136  zString = orxString_SkipWhiteSpaces(zString + 1);
1137 
1138  /* Gets Y value */
1139  if(orxString_ToFloat(zString, &(stValue.fY), &zString) != orxSTATUS_FAILURE)
1140  {
1141  /* Skips all white spaces */
1142  zString = orxString_SkipWhiteSpaces(zString);
1143 
1144  /* Is a vector separator character? */
1145  if(*zString == orxSTRING_KC_VECTOR_SEPARATOR)
1146  {
1147  /* Skips all white spaces */
1148  zString = orxString_SkipWhiteSpaces(zString + 1);
1149 
1150  /* Gets Z value */
1151  if(orxString_ToFloat(zString, &(stValue.fZ), &zString) != orxSTATUS_FAILURE)
1152  {
1153  /* Skips all white spaces */
1154  zString = orxString_SkipWhiteSpaces(zString);
1155 
1156  /* Has a valid end marker? */
1157  if(*zString == cEndMarker)
1158  {
1159  /* Updates result */
1160  eResult = orxSTATUS_SUCCESS;
1161  }
1162  }
1163  }
1164  /* Has a valid end marker? */
1165  else if(*zString == cEndMarker)
1166  {
1167  /* Clears Z component */
1168  stValue.fZ = orxFLOAT_0;
1169 
1170  /* Updates result */
1171  eResult = orxSTATUS_SUCCESS;
1172  }
1173  }
1174  }
1175  }
1176  }
1177 
1178  /* Valid? */
1179  if(eResult != orxSTATUS_FAILURE)
1180  {
1181  /* Updates vector */
1182  orxVector_Copy(_pvOutValue, &stValue);
1183 
1184  /* Asks for remaining string? */
1185  if(_pzRemaining != orxNULL)
1186  {
1187  /* Stores it */
1188  *_pzRemaining = zString + 1;
1189  }
1190  }
1191 
1192  /* Done! */
1193  return eResult;
1194 }
1195 
1202 static orxINLINE orxSTATUS orxString_ToBool(const orxSTRING _zString, orxBOOL *_pbOutValue, const orxSTRING *_pzRemaining)
1203 {
1204  orxS32 s32Value;
1205  orxSTATUS eResult;
1206 
1207  /* Checks */
1208  orxASSERT(_pbOutValue != orxNULL);
1209  orxASSERT(_zString != orxNULL);
1210 
1211  /* Tries numeric value */
1212  eResult = orxString_ToS32Base(_zString, 10, &s32Value, _pzRemaining);
1213 
1214  /* Valid? */
1215  if(eResult != orxSTATUS_FAILURE)
1216  {
1217  /* Updates boolean */
1218  *_pbOutValue = (s32Value != 0) ? orxTRUE : orxFALSE;
1219  }
1220  else
1221  {
1222  orxU32 u32Length;
1223 
1224  /* Gets length of false */
1225  u32Length = orxString_GetLength(orxSTRING_FALSE);
1226 
1227  /* Is false? */
1228  if(orxString_NICompare(_zString, orxSTRING_FALSE, u32Length) == 0)
1229  {
1230  /* Updates boolean */
1231  *_pbOutValue = orxFALSE;
1232 
1233  /* Has remaining? */
1234  if(_pzRemaining != orxNULL)
1235  {
1236  /* Updates it */
1237  *_pzRemaining += u32Length;
1238  }
1239 
1240  /* Updates result */
1241  eResult = orxSTATUS_SUCCESS;
1242  }
1243  else
1244  {
1245  /* Gets length of true */
1246  u32Length = orxString_GetLength(orxSTRING_TRUE);
1247 
1248  /* Is true? */
1249  if(orxString_NICompare(_zString, orxSTRING_TRUE, u32Length) == 0)
1250  {
1251  /* Updates boolean */
1252  *_pbOutValue = orxTRUE;
1253 
1254  /* Has remaining? */
1255  if(_pzRemaining != orxNULL)
1256  {
1257  /* Updates it */
1258  *_pzRemaining += u32Length;
1259  }
1260 
1261  /* Updates result */
1262  eResult = orxSTATUS_SUCCESS;
1263  }
1264  }
1265  }
1266 
1267  /* Done! */
1268  return eResult;
1269 }
1270 
1275 static orxINLINE orxSTRING orxString_LowerCase(orxSTRING _zString)
1276 {
1277  orxCHAR *pc;
1278 
1279  /* Checks */
1280  orxASSERT(_zString != orxNULL);
1281 
1282  /* Converts the whole string */
1283  for(pc = _zString; *pc != orxCHAR_NULL; pc++)
1284  {
1285  /* Needs to be converted? */
1286  if((*pc >= 'A') && (*pc <= 'Z'))
1287  {
1288  /* Lower case */
1289  *pc |= 0x20;
1290  }
1291  }
1292 
1293  return _zString;
1294 }
1295 
1300 static orxINLINE orxSTRING orxString_UpperCase(orxSTRING _zString)
1301 {
1302  orxCHAR *pc;
1303 
1304  /* Checks */
1305  orxASSERT(_zString != orxNULL);
1306 
1307  /* Converts the whole string */
1308  for(pc = _zString; *pc != orxCHAR_NULL; pc++)
1309  {
1310  /* Needs to be converted? */
1311  if((*pc >= 'a') && (*pc <= 'z'))
1312  {
1313  /* Upper case */
1314  *pc &= ~0x20;
1315  }
1316  }
1317 
1318  return _zString;
1319 }
1320 
1326 static orxINLINE const orxSTRING orxString_SearchString(const orxSTRING _zString1, const orxSTRING _zString2)
1327 {
1328  /* Checks */
1329  orxASSERT(_zString1 != orxNULL);
1330  orxASSERT(_zString2 != orxNULL);
1331 
1332  /* Returns result */
1333  return(strstr(_zString1, _zString2));
1334 }
1335 
1341 static orxINLINE const orxSTRING orxString_SearchChar(const orxSTRING _zString, orxCHAR _cChar)
1342 {
1343  /* Checks */
1344  orxASSERT(_zString != orxNULL);
1345 
1346  /* Returns result */
1347  return(strchr(_zString, _cChar));
1348 }
1349 
1356 static orxINLINE orxS32 orxString_SearchCharIndex(const orxSTRING _zString, orxCHAR _cChar, orxS32 _s32Position)
1357 {
1358  orxS32 s32Index, s32Result = -1;
1359  const orxCHAR *pc;
1360 
1361  /* Checks */
1362  orxASSERT(_zString != orxNULL);
1363  orxASSERT(_s32Position <= (orxS32)orxString_GetLength(_zString));
1364 
1365  /* For all characters */
1366  for(s32Index = _s32Position, pc = _zString + s32Index; *pc != orxCHAR_NULL; pc++, s32Index++)
1367  {
1368  /* Found? */
1369  if(*pc == _cChar)
1370  {
1371  /* Updates result */
1372  s32Result = s32Index;
1373 
1374  break;
1375  }
1376  }
1377 
1378  /* Done! */
1379  return s32Result;
1380 }
1381 
1388 static orxINLINE orxS32 orxCDECL orxString_NPrint(orxSTRING _zDstString, orxU32 _u32CharNumber, const orxSTRING _zSrcString, ...)
1389 {
1390  va_list stArgs;
1391  orxS32 s32Result;
1392 
1393  /* Checks */
1394  orxASSERT(_zDstString != orxNULL);
1395  orxASSERT(_zSrcString != orxNULL);
1396  orxASSERT(_u32CharNumber > 0);
1397 
1398  /* Gets variable arguments & prints the string */
1399  va_start(stArgs, _zSrcString);
1400  s32Result = vsnprintf(_zDstString, (size_t)_u32CharNumber, _zSrcString, stArgs);
1401  va_end(stArgs);
1402 
1403  /* Overflow? */
1404  if(s32Result <= 0)
1405  {
1406  /* Updates result */
1407  s32Result = (orxS32)_u32CharNumber - 1;
1408  }
1409  else
1410  {
1411  /* Clamps result */
1412  s32Result = orxCLAMP(s32Result, 0, (orxS32)_u32CharNumber - 1);
1413  }
1414 
1415  /* Enforces terminating null character */
1416  _zDstString[s32Result] = orxCHAR_NULL;
1417 
1418  /* Done! */
1419  return s32Result;
1420 }
1421 
1427 static orxINLINE orxS32 orxCDECL orxString_Scan(const orxSTRING _zString, const orxSTRING _zFormat, ...)
1428 {
1429  va_list stArgs;
1430  orxS32 s32Result;
1431 
1432  /* Checks */
1433  orxASSERT(_zString != orxNULL);
1434 
1435  /* Gets variable arguments & scans the string */
1436  va_start(stArgs, _zFormat);
1437  s32Result = vsscanf(_zString, _zFormat, stArgs);
1438  va_end(stArgs);
1439 
1440  /* Clamps result */
1441  s32Result = orxMAX(s32Result, 0);
1442 
1443  /* Done! */
1444  return s32Result;
1445 }
1446 
1451 static orxINLINE const orxSTRING orxString_GetExtension(const orxSTRING _zFileName)
1452 {
1453  orxS32 s32Index, s32NextIndex;
1454  const orxSTRING zResult;
1455 
1456  /* Checks */
1457  orxASSERT(_zFileName != orxNULL);
1458 
1459  /* Finds last '.' */
1460  for(s32Index = orxString_SearchCharIndex(_zFileName, '.', 0);
1461  (s32Index >= 0) && ((s32NextIndex = orxString_SearchCharIndex(_zFileName, '.', s32Index + 1)) > 0);
1462  s32Index = s32NextIndex);
1463 
1464  /* Updates result */
1465  zResult = (s32Index >= 0) ? _zFileName + s32Index + 1 : orxSTRING_EMPTY;
1466 
1467  /* Done! */
1468  return zResult;
1469 }
1470 
1471 /* *** String module functions *** */
1472 
1475 extern orxDLLAPI void orxFASTCALL orxString_Setup();
1476 
1480 extern orxDLLAPI orxSTATUS orxFASTCALL orxString_Init();
1481 
1484 extern orxDLLAPI void orxFASTCALL orxString_Exit();
1485 
1486 
1492 extern orxDLLAPI orxSTRINGID orxFASTCALL orxString_NHash(const orxSTRING _zString, orxU32 _u32CharNumber);
1493 
1498 extern orxDLLAPI orxSTRINGID orxFASTCALL orxString_Hash(const orxSTRING _zString);
1499 
1504 extern orxDLLAPI orxSTRINGID orxFASTCALL orxString_GetID(const orxSTRING _zString);
1505 
1510 extern orxDLLAPI const orxSTRING orxFASTCALL orxString_GetFromID(orxSTRINGID _stID);
1511 
1516 extern orxDLLAPI const orxSTRING orxFASTCALL orxString_Store(const orxSTRING _zString);
1517 
1518 
1519 #ifdef __orxMSVC__
1520 
1521  #pragma warning(default : 4996)
1522 
1523 #endif /* __orxMSVC__ */
1524 
1525 #endif /* _orxSTRING_H_ */
1526 
static orxINLINE const orxSTRING orxString_GetExtension(const orxSTRING _zFileName)
Definition: orxString.h:1451
static orxINLINE orxSTATUS orxString_ToS64(const orxSTRING _zString, orxS64 *_ps64OutValue, const orxSTRING *_pzRemaining)
Definition: orxString.h:956
orxDLLAPI orxSTRINGID orxFASTCALL orxString_GetID(const orxSTRING _zString)
orxDLLAPI void orxFASTCALL orxString_Setup()
static orxINLINE orxS32 orxString_SearchCharIndex(const orxSTRING _zString, orxCHAR _cChar, orxS32 _s32Position)
Definition: orxString.h:1356
orxDLLAPI const orxSTRING orxFASTCALL orxString_Store(const orxSTRING _zString)
static orxINLINE orxBOOL orxString_IsCharacterAlphaNumeric(orxU32 _u32CharacterCodePoint)
Definition: orxString.h:193
static orxINLINE orxSTATUS orxString_ToU32Base(const orxSTRING _zString, orxU32 _u32Base, orxU32 *_pu32OutValue, const orxSTRING *_pzRemaining)
Definition: orxString.h:847
static orxINLINE orxS32 orxString_NICompare(const orxSTRING _zString1, const orxSTRING _zString2, orxU32 _u32CharNumber)
Definition: orxString.h:663
static orxINLINE const orxSTRING orxString_SkipWhiteSpaces(const orxSTRING _zString)
Definition: orxString.h:96
static orxINLINE orxSTRING orxString_Duplicate(const orxSTRING _zSrcString)
Definition: orxString.h:555
#define orxSTRING_KC_VECTOR_END
Definition: orxString.h:79
static orxINLINE orxSTRING orxString_LowerCase(orxSTRING _zString)
Definition: orxString.h:1275
orxDLLAPI orxSTRINGID orxFASTCALL orxString_NHash(const orxSTRING _zString, orxU32 _u32CharNumber)
#define orxTRUE
Definition: orxType.h:198
orxDLLAPI orxSTATUS orxFASTCALL orxString_Init()
static orxINLINE orxS32 orxString_NCompare(const orxSTRING _zString1, const orxSTRING _zString2, orxU32 _u32CharNumber)
Definition: orxString.h:620
static const orxU32 orxU32_UNDEFINED
Definition: orxType.h:214
#define orxSTRING_KC_VECTOR_END_ALT
Definition: orxString.h:80
static orxINLINE orxSTATUS orxString_ToU64(const orxSTRING _zString, orxU64 *_pu64OutValue, const orxSTRING *_pzRemaining)
Definition: orxString.h:1024
static orxINLINE orxSTATUS orxString_ToU32(const orxSTRING _zString, orxU32 *_pu32OutValue, const orxSTRING *_pzRemaining)
Definition: orxString.h:888
orxFLOAT fY
Definition: orxVector.h:77
static orxINLINE orxU32 orxString_ExtractBase(const orxSTRING _zString, const orxSTRING *_pzRemaining)
Definition: orxString.h:687
#define orxCLAMP(V, MIN, MAX)
Definition: orxMath.h:89
#define orxCHAR_CR
Definition: orxType.h:228
#define orxFALSE
Definition: orxType.h:197
static orxINLINE orxS32 orxCDECL orxString_Scan(const orxSTRING _zString, const orxSTRING _zFormat,...)
Definition: orxString.h:1427
#define orxCHAR_DIRECTORY_SEPARATOR_WINDOWS
Definition: orxType.h:241
orxFLOAT fX
Definition: orxVector.h:69
orxDLLAPI void *orxFASTCALL orxMemory_Allocate(orxU32 _u32Size, orxMEMORY_TYPE _eMemType)
static orxINLINE orxSTATUS orxString_ToS32Base(const orxSTRING _zString, orxU32 _u32Base, orxS32 *_ps32OutValue, const orxSTRING *_pzRemaining)
Definition: orxString.h:779
static orxINLINE const orxSTRING orxString_SkipPath(const orxSTRING _zString)
Definition: orxString.h:127
orxDLLAPI const orxSTRING orxSTRING_EMPTY
static orxINLINE orxSTATUS orxString_ToVector(const orxSTRING _zString, orxVECTOR *_pvOutValue, const orxSTRING *_pzRemaining)
Definition: orxString.h:1101
orxDLLAPI const orxSTRING orxSTRING_TRUE
static orxU32 orxFASTCALL orxString_GetFirstCharacterCodePoint(const orxSTRING _zString, const orxSTRING *_pzRemaining)
Definition: orxString.h:339
static orxINLINE orxSTRING orxString_UpperCase(orxSTRING _zString)
Definition: orxString.h:1300
#define orxMAX(A, B)
Definition: orxMath.h:81
static orxINLINE orxU32 orxString_GetLength(const orxSTRING _zString)
Definition: orxString.h:170
#define orxSTRING_KC_VECTOR_START
Definition: orxString.h:76
static orxINLINE orxSTATUS orxString_ToBool(const orxSTRING _zString, orxBOOL *_pbOutValue, const orxSTRING *_pzRemaining)
Definition: orxString.h:1202
static orxINLINE orxSTATUS orxString_ToU64Base(const orxSTRING _zString, orxU32 _u32Base, orxU64 *_pu64OutValue, const orxSTRING *_pzRemaining)
Definition: orxString.h:983
static orxINLINE orxSTATUS orxString_Delete(orxSTRING _zString)
Definition: orxString.h:583
static orxINLINE orxU32 orxString_GetUTF8CharacterLength(orxU32 _u32CharacterCodePoint)
Definition: orxString.h:205
static orxINLINE orxS32 orxString_Compare(const orxSTRING _zString1, const orxSTRING _zString2)
Definition: orxString.h:602
static orxU32 orxFASTCALL orxString_PrintUTF8Character(orxSTRING _zDstString, orxU32 _u32Size, orxU32 _u32CharacterCodePoint)
Definition: orxString.h:246
static orxINLINE const orxSTRING orxString_SearchString(const orxSTRING _zString1, const orxSTRING _zString2)
Definition: orxString.h:1326
orxSTATUS
Definition: orxType.h:256
static orxINLINE orxS32 orxString_ICompare(const orxSTRING _zString1, const orxSTRING _zString2)
Definition: orxString.h:636
static orxINLINE orxS32 orxCDECL orxString_NPrint(orxSTRING _zDstString, orxU32 _u32CharNumber, const orxSTRING _zSrcString,...)
Definition: orxString.h:1388
static orxINLINE orxSTATUS orxString_ToS64Base(const orxSTRING _zString, orxU32 _u32Base, orxS64 *_ps64OutValue, const orxSTRING *_pzRemaining)
Definition: orxString.h:915
orxFLOAT fZ
Definition: orxVector.h:85
#define orxDLLAPI
Definition: orxDecl.h:370
#define STRTO_CAST
Definition: orxString.h:62
#define orxCHAR_LF
Definition: orxType.h:229
static orxINLINE orxBOOL orxString_IsCharacterASCII(orxU32 _u32CharacterCodePoint)
Definition: orxString.h:183
static orxINLINE const orxSTRING orxString_SearchChar(const orxSTRING _zString, orxCHAR _cChar)
Definition: orxString.h:1341
orxDLLAPI void orxFASTCALL orxString_Exit()
static orxINLINE orxSTATUS orxString_ToFloat(const orxSTRING _zString, orxFLOAT *_pfOutValue, const orxSTRING *_pzRemaining)
Definition: orxString.h:1050
static const orxFLOAT orxFLOAT_0
Definition: orxType.h:202
orxDLLAPI void orxFASTCALL orxMemory_Free(void *_pMem)
#define orxSTRING_KC_VECTOR_SEPARATOR
Definition: orxString.h:78
#define orxCHAR_NULL
Definition: orxType.h:227
static orxINLINE orxSTATUS orxString_ToS32(const orxSTRING _zString, orxS32 *_ps32OutValue, const orxSTRING *_pzRemaining)
Definition: orxString.h:820
#define orxDEBUG_PRINT(LEVEL, STRING,...)
Definition: orxDebug.h:338
static orxINLINE orxU32 orxString_GetCharacterCount(const orxSTRING _zString)
Definition: orxString.h:506
static orxINLINE void * orxMemory_Copy(void *_pDest, const void *_pSrc, orxU32 _u32Size)
Definition: orxMemory.h:149
static orxINLINE orxSTRING orxString_NCopy(orxSTRING _zDstString, const orxSTRING _zSrcString, orxU32 _u32CharNumber)
Definition: orxString.h:540
orxDLLAPI const orxSTRING orxSTRING_FALSE
#define orxSTRING_KC_VECTOR_START_ALT
Definition: orxString.h:77
#define orxASSERT(TEST,...)
Definition: orxDebug.h:372
orxDLLAPI const orxSTRING orxFASTCALL orxString_GetFromID(orxSTRINGID _stID)
static orxINLINE orxVECTOR * orxVector_Copy(orxVECTOR *_pvDst, const orxVECTOR *_pvSrc)
Definition: orxVector.h:135
#define orxCHAR_DIRECTORY_SEPARATOR_LINUX
Definition: orxType.h:242
orxDLLAPI orxSTRINGID orxFASTCALL orxString_Hash(const orxSTRING _zString)

Generated for orx by doxygen 1.8.11