- Cal3D 0.9 API Reference -

Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

platform.h

00001 //****************************************************************************//
00002 // platform.h                                                                 //
00003 // Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger                       //
00004 //****************************************************************************//
00005 // This library is free software; you can redistribute it and/or modify it    //
00006 // under the terms of the GNU Lesser General Public License as published by   //
00007 // the Free Software Foundation; either version 2.1 of the License, or (at    //
00008 // your option) any later version.                                            //
00009 //****************************************************************************//
00010 
00011 #ifndef CAL_PLATFORM_H
00012 #define CAL_PLATFORM_H
00013 
00014 //****************************************************************************//
00015 // Compiler configuration                                                     //
00016 //****************************************************************************//
00017 
00018 #if defined(_WIN32) && !defined(__MINGW32__)
00019 #pragma warning(disable : 4251)
00020 #pragma warning(disable : 4786)
00021 #endif
00022 
00023 #if !defined(_WIN32) || defined(__MINGW32__)
00024 #define stricmp strcasecmp
00025 #endif
00026 
00027 
00028 //****************************************************************************//
00029 // Dynamic library export setup                                               //
00030 //****************************************************************************//
00031 
00032 #if defined(_WIN32) && !defined(__MINGW32__)
00033 
00034 #ifndef CAL3D_API
00035 #ifdef CAL3D_EXPORTS
00036 #define CAL3D_API __declspec(dllexport)
00037 #else
00038 #define CAL3D_API __declspec(dllimport)
00039 #endif
00040 #endif
00041 
00042 #else
00043 
00044 #define CAL3D_API
00045 
00046 #endif
00047 
00048 //****************************************************************************//
00049 // Endianness setup                                                           //
00050 //****************************************************************************//
00051 
00052 #if  defined(__i386__) || \
00053      defined(__ia64__) || \
00054      defined(WIN32) || \
00055      defined(__alpha__) || defined(__alpha) || \
00056      defined(__arm__) || \
00057     (defined(__mips__) && defined(__MIPSEL__)) || \
00058      defined(__SYMBIAN32__) || \
00059      defined(__x86_64__) || \
00060      defined(__LITTLE_ENDIAN__)
00061 
00062 #define CAL3D_LITTLE_ENDIAN
00063 
00064 #else
00065 
00066 #define CAL3D_BIG_ENDIAN
00067 
00068 #endif
00069 
00070 //****************************************************************************//
00071 // Includes                                                                   //
00072 //****************************************************************************//
00073 
00074 // standard includes
00075 #include <stdlib.h>
00076 #include <math.h>
00077 
00078 // debug includes
00079 #include <assert.h>
00080 
00081 // STL includes
00082 #include <iostream>
00083 #include <fstream>
00084 #include <sstream>
00085 #include <string>
00086 #include <vector>
00087 #include <list>
00088 #include <map>
00089 
00090 //****************************************************************************//
00091 // Class declaration                                                          //
00092 //****************************************************************************//
00093 
00094  /*****************************************************************************/
00098 class CAL3D_API CalPlatform
00099 {
00100 // constructors/destructor
00101 protected:
00102   CalPlatform();
00103   virtual ~CalPlatform();
00104 
00105 // member functions 
00106 public:
00107   static bool readBytes(std::istream& input, void *pBuffer, int length);
00108   static bool readFloat(std::istream& input, float& value);
00109   static bool readInteger(std::istream& input, int& value);
00110   static bool readString(std::istream& input, std::string& strValue);
00111 
00112   static bool readBytes(char* input, void *pBuffer, int length);
00113   static bool readFloat(char* input, float& value);
00114   static bool readInteger(char* input, int& value);
00115   static bool readString(char* input, std::string& strValue);
00116 
00117   static bool writeBytes(std::ostream& output, const void *pBuffer, int length);
00118   static bool writeFloat(std::ostream& output, float value);
00119   static bool writeInteger(std::ostream& output, int value);
00120   static bool writeString(std::ostream& output, const std::string& strValue);
00121 };
00122 
00123 #endif
00124 
00125 //****************************************************************************//

Generated at Thu Dec 2 19:59:18 2004 by The Cal3D Team with doxygen 1.3.9.1 © 1997-2001 Dimitri van Heesch