00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef OFSTREAM_H
00035 #define OFSTREAM_H
00036
00037 #include "dcmtk/config/osconfig.h"
00038
00039 #ifdef USE_STD_CXX_INCLUDES
00040
00041 #include <iostream>
00042 #ifdef HAVE_IOS
00043 #include <ios>
00044 #endif
00045 #include <fstream>
00046 #include <iomanip>
00047
00048 #if defined(HAVE_SSTREAM)
00049 #include <sstream>
00050 #define USE_STRINGSTREAM
00051 #elif defined(HAVE_STRSTREAM)
00052 #include <strstream>
00053 #else
00054 #error DCMTK needs stringstream or strstream type
00055 #endif
00056 #ifdef HAVE_STD_NAMESPACE
00057 namespace std { }
00058 using namespace std;
00059 #endif
00060
00061 #else
00062
00063 #include <iostream.h>
00064 #include <fstream.h>
00065
00066 #if defined(HAVE_STRSTREA_H) || defined(HAVE_STRSTREAM_H)
00067 #ifdef HAVE_STRSTREA_H
00068 #include <strstrea.h>
00069 #else
00070 #include <strstream.h>
00071 #endif
00072 #elif defined(HAVE_SSTREAM_H)
00073 #include <sstream.h>
00074 #define USE_STRINGSTREAM
00075 #else
00076 #error DCMTK needs stringstream or strstream type
00077 #endif
00078 #include <iomanip.h>
00079
00080 #endif
00081
00082 #ifdef USE_STRINGSTREAM
00083
00084 typedef stringstream OFStringStream;
00085 typedef ostringstream OFOStringStream;
00086 typedef istringstream OFIStringStream;
00087
00088 #define OFStringStream_ends ""
00089 #define OFSTRINGSTREAM_GETOFSTRING(oss, string) \
00090 OFString string((oss).str().c_str());
00091
00092
00093 #define OFSTRINGSTREAM_GETSTR(oss, chptr) \
00094 { \
00095 string chptr##__ = (oss).str(); \
00096 const char *chptr = chptr##__.c_str();
00097 #define OFSTRINGSTREAM_FREESTR(chptr) \
00098 }
00099
00100 #else
00101
00102 typedef strstream OFStringStream;
00103 typedef ostrstream OFOStringStream;
00104 typedef istrstream OFIStringStream;
00105
00106 #define OFStringStream_ends ends
00107 #define OFSTRINGSTREAM_GETOFSTRING(oss, string) \
00108 char * string##__ = (oss).str(); \
00109 OFString string(string##__); \
00110 delete[] string##__;
00111
00112
00113 #define OFSTRINGSTREAM_GETSTR(oss, chptr) \
00114 { \
00115 const char *chptr = (oss).str();
00116 #define OFSTRINGSTREAM_FREESTR(chptr) \
00117 delete[] (char *)chptr; \
00118 }
00119
00120 #endif
00121
00122 #endif
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151