gwnavruntime/base/stringutils.h Source File

stringutils.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 
8 #ifndef Navigation_StringUtils_H
9 #define Navigation_StringUtils_H
10 
14 #include <stdarg.h> // for va_list args
15 
16 namespace Kaim
17 {
18 
21 {
22 public:
23  // ------------ Parsing functions ------------
25  static KyInt32 FindFirstOf(const char* str, const char* charsToSearch, KyInt32 start = 0);
26 
27  // Spit string into tokens
28  static void GetTokens(const char* str, const char* delimiters, KyArray<String>& tokens, bool acceptEmptyStrings = false);
29 
30  // ------------ safe sprintf variants ------------
31  // It is safe in regards to the final content of 'dest' if textFmt and the argument list are well formed and enough memory is available.
32  // So 'dest' can be reallocated in this function in order to be large enough to store the complete string.
33  // However using this function is slower than calling standard functions.
34  static KyInt32 SafeSvprintf(KyArrayPOD<char>& dest, const char* textFmt, va_list argList);
35  static KyInt32 SafeSprintf(KyArrayPOD<char>& dest, const char* textFmt, ...);
36 };
37 
38 } // namespace Kaim
39 
40 #endif
int KyInt32
Type used internally to represent a 32-bit integer.
Definition: types.h:35
Definition: gamekitcrowddispersion.h:20
Utility functions for manipulating strings.
Definition: stringutils.h:20