ReplicaNet and RNLobby  1
StringUtils.h
1 /* START_LICENSE_HEADER
2 
3 Copyright (C) 2000 Martin Piper, original design and program code
4 Copyright (C) 2001 Replica Software
5 
6 This program file is copyright (C) Replica Software and can only be used under license.
7 For more information visit: http://www.replicanet.com/
8 Or email: info@replicanet.com
9 
10 END_LICENSE_HEADER */
11 #include "RNPlatform/Inc/MemoryTracking.h"
12 #ifndef _RN_STRINGUTILS_H_
13 #define _RN_STRINGUTILS_H_
14 #include <string>
15 
16 namespace RNReplicaNet
17 {
18 
20 extern std::string TrimWhite(const std::string &t);
21 
23 extern std::string ToLower( const std::string &input );
24 
29 template <typename T> extern T StringTo(const std::string &input , const T defaultValue = 0);
30 
35 template <typename T> extern std::string ToString(const T input , const int decimalPlaces = -1 );
36 
40 extern std::string ValidateUsername(const std::string &input);
41 
44 extern std::string ValidateEmail(const std::string &input);
45 
47 extern std::string GetStringSafe( const char *input , const int maxLen );
48 
49 extern std::string ReadTextFile( const char *filename );
50 
51 } // namespace RNReplicaNet
52 
53 #endif //#ifndef _RN_STRINGUTILS_H_