D:/WorkDir/SugoiProjects/SugoiTools/include/SugoiTools/tools.h

00001 /* LICENSE_BEGIN
00002 SutoiTools library supply support for debugging, testing and 
00003 setting good bases for you application. It is part of the 
00004 SugoiEngine project.
00005 Copyright (C) 2006 Allusse Yannick (yannick dot allusse at laposte dot net)
00006 
00007 
00008 This program is free software; you can redistribute it and/or
00009 modify it under the terms of the GNU General Public License
00010 as published by the Free Software Foundation; either version 2
00011 of the License, or (at your option) any later version.
00012 
00013 This program is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 GNU General Public License for more details.
00017 
00018 You should have received a copy of the GNU General Public License
00019 along with this program; if not, write to the Free Software
00020 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00021 LICENSE_END
00022 */
00023 
00024 /* \file tools.h
00025  * \brief A few helpful functions.
00026  * \author Yannick Allusse
00027 */
00028 
00029 
00030 #ifndef SUGOI_TOOLS_TOOLS_h
00031 #define SUGOI_TOOLS_TOOLS_h
00032 
00033 
00034 #include "SugoiTools\config.h"
00035 #include "SugoiTools\exceptions.h"
00036 
00037 
00038 namespace SGE{
00039 _SG_TLS_EXPORT std::string  StringToUpper(std::string &_s);
00040 _SG_TLS_EXPORT std::string  StringToLower(std::string &_s);
00041 _SG_TLS_EXPORT void ParseFilePath(const std::string &_SourceName, std::string *_path, std::string *_name);
00042 _SG_TLS_EXPORT void ParseFileType(const std::string &_SourceName, std::string *_name, std::string *_type);
00043 
00049 template <typename Type>
00050 std::string ToCharStr(const Type & _Val)
00051 {
00052           std::ostringstream oss;
00053           oss << _Val;
00054     return oss.str();
00055 };
00056           /*
00057           template <>
00058           std::string ToCharStr<bool>(const bool            &_Val)
00059           {         return (_Val)?"true": "false"; };
00060           */
00061 
00062 
00063 
00068 _SG_TLS_EXPORT void Terminate(int _MsgID, std::string _MsgError="", char * _file=NULL, long _line = 0);
00069 
00070 #define TERMINATE_APP(MSG_ID, MSG){\
00071 {Terminate(MSG_ID, MSG, __FILE__, __LINE__);}}
00072 
00073 #define NOMINMAX
00074 
00075 
00076 _SG_TLS_EXPORT HINSTANCE      DLLLoad(const char * _DLLNAME, const char * _DLLPath = NULL);
00077 _SG_TLS_EXPORT void                     DLLClose(HINSTANCE & _DllInstance);
00078 
00084 _SG_TLS_EXPORT FARPROC                  DLLGetProcAddress(HINSTANCE & _DllInstance, const char * _ProcName);
00085 
00086 };//namespace SGE
00087 #endif//SUGOI_TOOLS_TOOLS_h

Generated on Mon Mar 19 23:15:11 2007 for SugoiTools by  doxygen 1.4.6-NO