EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
str2conv.h
Go to the documentation of this file.
1 /*
2  ------------------------------------------------------------------------------------
3  LICENSE:
4  ------------------------------------------------------------------------------------
5  This file is part of EVEmu: EVE Online Server Emulator
6  Copyright 2006 - 2008 The EVEmu Team
7  For the latest information visit http://evemu.mmoforge.org
8  ------------------------------------------------------------------------------------
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13 
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License along with
19  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20  Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21  http://www.gnu.org/copyleft/lesser.txt.
22  ------------------------------------------------------------------------------------
23  Author: Bloody.Rabbit
24 */
25 
26 #ifndef __UTILS__STR2CONV_H__INCL__
27 #define __UTILS__STR2CONV_H__INCL__
28 
38 template< typename T >
39 T str2( const char* str ) { return T( str ); }
49 template< typename T >
50 T str2( const std::string& str ) { return str2< T >( str.c_str() ); }
51 
59 template<>
60 bool str2< bool >( const char* str );
61 
69 template<>
70 int8 str2< int8 >( const char* str );
78 template<>
79 int16 str2< int16 >( const char* str );
87 template<>
88 int32 str2< int32 >( const char* str );
96 template<>
97 int64 str2< int64 >( const char* str );
98 
106 template<>
107 uint8 str2< uint8 >( const char* str );
115 template<>
116 uint16 str2< uint16 >( const char* str );
124 template<>
125 uint32 str2< uint32 >( const char* str );
133 //template<>
134 //uint64 str2< uint64 >( const char* str );
135 
143 template<>
144 float str2< float >( const char* str );
152 template<>
153 double str2< double >( const char* str );
161 template<>
162 long double str2< long double >( const char* str );
163 
164 #endif /* !__UTILS__STR2CONV_H__INCL__ */
unsigned __int8 uint8
Definition: eve-compat.h:46
int32 str2< int32 >(const char *str)
Converts string to integer.
int8 str2< int8 >(const char *str)
Converts string to integer.
uint32 str2< uint32 >(const char *str)
Converts string to unsigned integer.
float str2< float >(const char *str)
Converts string to unsigned integer.
int64 str2< int64 >(const char *str)
Converts string to integer.
int16 str2< int16 >(const char *str)
Converts string to integer.
long double str2< long double >(const char *str)
Converts string to real number.
signed __int8 int8
Definition: eve-compat.h:45
uint8 str2< uint8 >(const char *str)
Converts string to unsigned integer.
signed __int32 int32
Definition: eve-compat.h:49
bool str2< bool >(const char *str)
Converts string to boolean.
Definition: str2conv.cpp:31
unsigned __int32 uint32
Definition: eve-compat.h:50
T str2(const char *str)
Generic string conversion template.
Definition: str2conv.h:39
signed __int64 int64
Definition: eve-compat.h:51
double str2< double >(const char *str)
Converts string to real number.
signed __int16 int16
Definition: eve-compat.h:47
uint16 str2< uint16 >(const char *str)
Converts string to unsigned integer.
unsigned __int16 uint16
Definition: eve-compat.h:48