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

mnstream.h

Go to the documentation of this file.
00001 #ifndef MN_stream_H 00002 #define MN_stream_H 00003 00004 #include <config.h> 00005 00006 #ifdef HAVE_IOSTREAM 00007 #if defined(__NetBSD__) 00008 #undef HAVE_AND_USE_IOSTREAM 00009 #elif defined(__GNUC__) && __GNUC__==2 && (__GNUC_MINOR__==95 || __GNUC_MINOR__==96) 00010 /* very very very very very annoying RedHat branches */ 00011 #undef HAVE_AND_USE_IOSTREAM 00012 #else 00013 #define HAVE_AND_USE_IOSTREAM 00014 #endif 00015 #else 00016 #undef HAVE_AND_USE_IOSTREAM 00017 #endif 00018 00019 #ifdef HAVE_AND_USE_IOSTREAM 00020 # include <iostream> 00021 # include <iomanip> 00022 # include <fstream> 00023 # include <sstream> 00024 00025 // Nothing that is related to ostrstream is working correctly 00026 // after the Ansi adaptation. Find a generic workaround for old 00027 // and new code. 00028 typedef std::ostringstream ostrstream; 00029 #ifdef __GNUC__ 00030 typedef std::_Ios_Openmode Openmode; 00031 #elif defined(__INTEL_COMPILER) 00032 typedef std::ios_base::openmode Openmode; 00033 #else 00034 typedef int Openmode; 00035 #endif 00036 using std::ostream; 00037 using std::istream; 00038 using std::fstream; 00039 using std::ifstream; 00040 using std::ofstream; 00041 using std::cin; 00042 using std::cout; 00043 using std::cerr; 00044 using std::endl; 00045 using std::ends; 00046 using std::hex; 00047 using std::setfill; 00048 using std::setw; 00049 using std::ios; 00050 00051 /* new ostringstream can manage memory */ 00052 #define UNFREEZE(sso) 00053 /* new ostringstream semantics can take care of memory 00054 * but access to content has become more difficult. 00055 */ 00056 #define C_STR(sso) sso.str().c_str() 00057 #else 00058 #include <iostream.h> 00059 #include <iomanip.h> 00060 #include <fstream.h> 00061 #include <strstream.h> 00062 00063 /* new ostrstream can not manage memory */ 00064 #define UNFREEZE(sso) sso.rdbuf()->freeze(0); 00065 /* but access to data is simpler */ 00066 #define C_STR(sso) sso.str() 00067 typedef int Openmode; 00068 #endif 00069 00070 #endif /* MN_stream_H */ 00071

Generated on Sun Mar 6 13:35:49 2005 for Komssys by doxygen 1.3.8