Changeset 2710 for code/trunk/src/util
- Timestamp:
- Feb 28, 2009, 7:46:37 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:ignore deleted
- Property svn:mergeinfo changed
-
code/trunk/src/util
- Property svn:mergeinfo changed
-
code/trunk/src/util/CMakeLists.txt
r2295 r2710 1 SET(UTIL_SRC_FILES 1 # 2 # ORXONOX - the hottest 3D action shooter ever to exist 3 # > www.orxonox.net < 4 # 5 # This program is free software; you can redistribute it and/or 6 # modify it under the terms of the GNU General Public License 7 # as published by the Free Software Foundation; either version 2 8 # of the License, or (at your option) any later version. 9 # 10 # This program is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License along 16 # with this program; if not, write to the Free Software Foundation, 17 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 # 19 20 SET_SOURCE_FILES(UTIL_FILES 21 CRC32.h 22 Clipboard.h 23 Convert.h 24 Debug.h 25 Exception.h 26 ExprParser.h 27 Math.h 28 MathConvert.h 29 MultiType.h 30 MultiTypeValue.h 31 OutputBuffer.h 32 OutputHandler.h 33 SignalHandler.h 34 Sleep.h 35 String.h 36 SubString.h 37 UtilPrereqs.h 38 mbool.h 39 2 40 Clipboard.cc 3 41 CRC32.cc … … 12 50 SubString.cc 13 51 ) 52 #GET_ALL_HEADER_FILES(UTIL_HDR_FILES) 53 #SET(UTIL_FILES ${UTIL_SRC_FILES} ${UTIL_HDR_FILES}) 54 GENERATE_SOURCE_GROUPS(${UTIL_FILES}) 55 # Also add OrxonoxConfig to have it least somewhere in the IDE 56 LIST(APPEND UTIL_FILES 57 ${CMAKE_BINARY_DIR}/src/OrxonoxConfig.h 58 ${CMAKE_SOURCE_DIR}/src/OrxonoxConfig.h.in 59 ${CMAKE_BINARY_DIR}/src/SpecialConfig.h 60 ${CMAKE_SOURCE_DIR}/src/SpecialConfig.h.in 61 ) 62 SOURCE_GROUP("" FILES 63 ${CMAKE_BINARY_DIR}/src/OrxonoxConfig.h 64 ${CMAKE_SOURCE_DIR}/src/OrxonoxConfig.h.in 65 ${CMAKE_BINARY_DIR}/src/SpecialConfig.h 66 ${CMAKE_SOURCE_DIR}/src/SpecialConfig.h.in 67 ) 14 68 15 ADD_LIBRARY(util SHARED ${UTIL_SRC_FILES}) 69 IF(GCC_NO_SYSTEM_HEADER_SUPPORT) 70 # Get around displaying a few hundred lines of warning code 71 SET_SOURCE_FILES_PROPERTIES(MultiType.cc PROPERTIES COMPILE_FLAGS "-w") 72 ENDIF() 16 73 17 TARGET_LINK_LIBRARIES(util 18 ${OGRE_LIBRARIES} 19 ) 74 ADD_LIBRARY(util SHARED ${UTIL_FILES}) 75 SET_TARGET_PROPERTIES(util PROPERTIES DEFINE_SYMBOL "UTIL_SHARED_BUILD") 76 TARGET_LINK_LIBRARIES(util ${OGRE_LIBRARY}) 77 78 ORXONOX_INSTALL(util) -
code/trunk/src/util/CRC32.h
r2171 r2710 32 32 #include "UtilPrereqs.h" 33 33 #include <iostream> 34 #include "Integers.h"35 34 36 35 namespace orxonox -
code/trunk/src/util/Clipboard.cc
r2171 r2710 36 36 #include "Clipboard.h" 37 37 38 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN3238 #ifdef ORXONOX_PLATFORM_WINDOWS 39 39 40 40 ///////////// … … 104 104 } 105 105 106 #else /* ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32*/106 #else /* ORXONOX_PLATFORM_WINDOWS */ 107 107 108 108 ///////////// … … 135 135 } 136 136 137 #endif /* ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32*/137 #endif /* ORXONOX_PLATFORM_WINDOWS */ -
code/trunk/src/util/Convert.h
r2662 r2710 50 50 // This is however exactly what convertValue does, so we need to suppress these warnings. 51 51 // They only occur when using the ImplicitConversion template. 52 #if ORXONOX_COMPILER == ORXONOX_COMPILER_GNUC52 #ifdef ORXONOX_COMPILER_GCC 53 53 # pragma GCC system_header 54 54 #endif … … 63 63 64 64 // disable warnings about possible loss of data 65 #if ORXONOX_COMPILER ==ORXONOX_COMPILER_MSVC65 #ifdef ORXONOX_COMPILER_MSVC 66 66 # pragma warning(push) 67 67 # pragma warning(disable:4244) … … 88 88 } 89 89 90 #if ORXONOX_COMPILER ==ORXONOX_COMPILER_MSVC90 #ifdef ORXONOX_COMPILER_MSVC 91 91 # pragma warning(pop) 92 92 #endif -
code/trunk/src/util/Exception.cc
- Property svn:mergeinfo changed
/code/branches/buildsystem2/src/util/Exception.cc (added) merged: 2509-2510 /code/branches/buildsystem3/src/util/Exception.cc (added) merged: 2664
- Property svn:mergeinfo changed
-
code/trunk/src/util/Exception.h
- Property svn:mergeinfo changed
/code/branches/buildsystem2/src/util/Exception.h (added) merged: 2509-2510 /code/branches/buildsystem3/src/util/Exception.h (added) merged: 2664
- Property svn:mergeinfo changed
-
code/trunk/src/util/Math.h
r2662 r2710 52 52 53 53 //Get around Windows hackery 54 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN3254 #ifdef ORXONOX_PLATFORM_WINDOWS 55 55 # ifdef max 56 56 # undef max -
code/trunk/src/util/OutputBuffer.cc
r2171 r2710 68 68 OutputBuffer& OutputBuffer::operator<<(std::ostream& (*manipulator)(std::ostream&)) 69 69 { 70 71 72 70 this->stream_ << manipulator; 71 this->callListeners(); 72 return *this; 73 73 } 74 74 … … 79 79 OutputBuffer& OutputBuffer::operator<<(std::ios& (*manipulator)(std::ios&)) 80 80 { 81 82 83 81 this->stream_ << manipulator; 82 this->callListeners(); 83 return *this; 84 84 } 85 85 … … 90 90 OutputBuffer& OutputBuffer::operator<<(std::ios_base& (*manipulator)(std::ios_base&)) 91 91 { 92 93 94 92 this->stream_ << manipulator; 93 this->callListeners(); 94 return *this; 95 95 } 96 96 -
code/trunk/src/util/OutputHandler.cc
r2662 r2710 33 33 34 34 #include "OutputHandler.h" 35 #include <time.h> 35 36 #include <ctime> 37 #include <cstdlib> 36 38 37 39 namespace orxonox … … 41 43 @param logfilename The name of the logfile 42 44 */ 43 OutputHandler::OutputHandler(const std::string& logfilename) 44 { 45 OutputHandler::OutputHandler() 46 { 47 #ifdef ORXONOX_PLATFORM_WINDOWS 48 char* pTempDir = getenv("TEMP"); 49 this->logfilename_ = std::string(pTempDir) + "/orxonox.log"; 50 #else 51 this->logfilename_ = "/tmp/orxonox.log"; 52 #endif 53 #ifdef NDEBUG 54 this->softDebugLevel_[LD_All] = this->softDebugLevel_[LD_Logfile] = 2; 55 this->softDebugLevel_[LD_Console] = this->softDebugLevel_[LD_Shell] = 1; 56 #else 57 this->softDebugLevel_[LD_All] = this->softDebugLevel_[LD_Logfile] = 3; 58 this->softDebugLevel_[LD_Console] = this->softDebugLevel_[LD_Shell] = 2; 59 #endif 60 45 61 this->outputBuffer_ = &this->fallbackBuffer_; 46 this->softDebugLevel_[0] = this->softDebugLevel_[1] = this->softDebugLevel_[2] = this->softDebugLevel_[3] = 2;47 this->logfilename_ = logfilename;48 62 this->logfile_.open(this->logfilename_.c_str(), std::fstream::out); 49 63 … … 53 67 timeinfo = localtime(&rawtime); 54 68 55 this->logfile_ << "Started log at" << asctime(timeinfo) << std::endl;69 this->logfile_ << "Started log on " << asctime(timeinfo) << std::endl; 56 70 this->logfile_.flush(); 57 71 } … … 72 86 OutputHandler& OutputHandler::getOutStream() 73 87 { 74 static OutputHandler orxout ("orxonox.log");88 static OutputHandler orxout; 75 89 return orxout; 76 90 } … … 112 126 113 127 /** 128 @brief Sets the path where to create orxonox.log 129 @param Path string with trailing slash 130 */ 131 void OutputHandler::setLogPath(const std::string& path) 132 { 133 OutputHandler::getOutStream().logfile_.close(); 134 // store old content 135 std::ifstream old; 136 old.open(OutputHandler::getOutStream().logfilename_.c_str()); 137 OutputHandler::getOutStream().logfilename_ = path + "orxonox.log"; 138 OutputHandler::getOutStream().logfile_.open(OutputHandler::getOutStream().logfilename_.c_str(), std::fstream::out); 139 OutputHandler::getOutStream().logfile_ << old.rdbuf(); 140 old.close(); 141 OutputHandler::getOutStream().logfile_.flush(); 142 } 143 144 /** 114 145 @brief Overloaded << operator, redirects the output to the console and the logfile. 115 146 @param sb The streambuffer that should be shown in the console -
code/trunk/src/util/OutputHandler.h
r2662 r2710 101 101 static int getSoftDebugLevel(OutputHandler::OutputDevice device = OutputHandler::LD_All); 102 102 103 static void setLogPath(const std::string& path); 104 103 105 void setOutputBuffer(OutputBuffer* buffer); 104 106 … … 142 144 143 145 private: 144 explicit OutputHandler( const std::string& logfilename);145 OutputHandler(const OutputHandler& oh); // don't copy146 explicit OutputHandler(); 147 OutputHandler(const OutputHandler& oh); 146 148 virtual ~OutputHandler(); 147 149 -
code/trunk/src/util/SignalHandler.cc
- Property svn:mergeinfo changed
/code/branches/buildsystem2/src/util/SignalHandler.cc (added) merged: 2596,2639 /code/branches/buildsystem3/src/util/SignalHandler.cc (added) merged: 2664,2685
r2662 r2710 44 44 } 45 45 46 #if ORXONOX_PLATFORM != ORXONOX_PLATFORM_WIN3246 #ifdef ORXONOX_PLATFORM_LINUX 47 47 48 48 #include <wait.h> … … 159 159 } 160 160 161 COUT(0) << "recieved signal " << sigName.c_str() << std::endl << "try to write backtrace to file orxonox .log" << std::endl;161 COUT(0) << "recieved signal " << sigName.c_str() << std::endl << "try to write backtrace to file orxonox_crash.log" << std::endl; 162 162 163 163 int sigPipe[2]; … … 353 353 } 354 354 355 #endif /* ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32*/355 #endif /* ORXONOX_PLATFORM_LINUX */ - Property svn:mergeinfo changed
-
code/trunk/src/util/SignalHandler.h
- Property svn:mergeinfo changed
/code/branches/buildsystem2/src/util/SignalHandler.h (added) merged: 2596,2639 /code/branches/buildsystem3/src/util/SignalHandler.h (added) merged: 2664
r2662 r2710 46 46 } 47 47 48 #if ORXONOX_PLATFORM != ORXONOX_PLATFORM_WIN3248 #ifdef ORXONOX_PLATFORM_LINUX 49 49 #include <signal.h> 50 50 … … 97 97 } 98 98 99 #else /* ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32*/99 #else /* ORXONOX_PLATFORM_LINUX */ 100 100 101 101 namespace orxonox … … 116 116 } 117 117 118 #endif /* ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32*/118 #endif /* ORXONOX_PLATFORM_LINUX */ 119 119 120 120 #endif /* _SignalHandler_H__ */ - Property svn:mergeinfo changed
-
code/trunk/src/util/Sleep.h
r2171 r2710 36 36 #define _Sleep_H__ 37 37 38 #include " OrxonoxPlatform.h"38 #include "UtilPrereqs.h" 39 39 40 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN3240 #ifdef ORXONOX_PLATFORM_WINDOWS 41 41 #include <winbase.h> 42 42 -
code/trunk/src/util/UtilPrereqs.h
r2171 r2710 35 35 #define _UtilPrereqs_H__ 36 36 37 #include " util/OrxonoxPlatform.h"37 #include "OrxonoxConfig.h" 38 38 39 39 //----------------------------------------------------------------------- 40 40 // Shared library settings 41 41 //----------------------------------------------------------------------- 42 #if (ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32) && !defined( UTIL_STATIC_BUILD )42 #if defined(ORXONOX_PLATFORM_WINDOWS) && !defined( UTIL_STATIC_BUILD ) 43 43 # ifdef UTIL_SHARED_BUILD 44 44 # define _UtilExport __declspec(dllexport)
Note: See TracChangeset
for help on using the changeset viewer.