/usr/include/dcmtk/ofstd/ofstream.h is in libdcmtk-dev 3.6.2-3build3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | /*
*
* Copyright (C) 2002-2017, OFFIS e.V.
* All rights reserved. See COPYRIGHT file for details.
*
* This software and supporting documentation were developed by
*
* OFFIS e.V.
* R&D Division Health
* Escherweg 2
* D-26121 Oldenburg, Germany
*
*
* Module: ofstd
*
* Author: Andreas Barth
*
* Purpose: C++ header to handle standard and old stream libraries.
*
*/
#ifndef OFSTREAM_H
#define OFSTREAM_H
#include "dcmtk/config/osconfig.h"
#ifdef USE_STD_CXX_INCLUDES
#include <iostream>
#ifdef HAVE_IOS
#include <ios>
#endif
#include <fstream>
#include <iomanip>
// For standard STREAMS library: preference for standard stringstream
#if defined(HAVE_SSTREAM)
#include <sstream>
#define USE_STRINGSTREAM
#elif defined(HAVE_STRSTREAM)
#include <strstream>
#else
#error DCMTK needs stringstream or strstream type
#endif
/* DCMTK by default does not anymore pollute the default namespace by
* importing namespace std. Earlier releases did this to simplify compatibility
* with older compilers where STL classes were not consistently defined
* in namespace std. We now have configure macros which should care for this.
* If user code still relies on namespace std to be included, compile with
* macro USING_STD_NAMESPACE defined.
*/
#ifdef USING_STD_NAMESPACE
namespace std { }
using namespace std;
#endif
#else /* USE_STD_CXX_INCLUDES */
#include <iostream.h>
#include <fstream.h>
// For old STREAMS library: preference for strstream
#if defined(HAVE_STRSTREA_H) || defined(HAVE_STRSTREAM_H)
#ifdef HAVE_STRSTREA_H
#include <strstrea.h>
#else
#include <strstream.h>
#endif
#elif defined(HAVE_SSTREAM_H)
#include <sstream.h>
#define USE_STRINGSTREAM
#else
#error DCMTK needs stringstream or strstream type
#endif
#include <iomanip.h>
#endif /* USE_STD_CXX_INCLUDES */
// define STD_NAMESPACE to std:: if the standard namespace exists
#ifndef STD_NAMESPACE
#ifdef HAVE_STD_NAMESPACE
#define STD_NAMESPACE std::
#else
#define STD_NAMESPACE
#endif
#endif
#define OFendl STD_NAMESPACE endl
#ifdef USE_STRINGSTREAM
typedef STD_NAMESPACE stringstream OFStringStream;
typedef STD_NAMESPACE ostringstream OFOStringStream;
typedef STD_NAMESPACE istringstream OFIStringStream;
#define OFStringStream_ends ""
#ifdef HAVE_STL_STRING
#define OFSTRINGSTREAM_GETOFSTRING(oss, strng) \
OFString strng((oss).str());
#else
#define OFSTRINGSTREAM_GETOFSTRING(oss, strng) \
STD_NAMESPACE string strng##__((oss).str()); \
OFString strng(strng##__.c_str(), strng##__.length());
#endif
// The following two macros define a block structure. Please note that variables
// declared between xxx_GETSTR and xxx_FREESTR are only valid within this scope.
#define OFSTRINGSTREAM_GETSTR(oss, chptr) \
{ \
STD_NAMESPACE string chptr##__ = (oss).str(); \
const char *chptr = chptr##__.c_str();
#define OFSTRINGSTREAM_FREESTR(chptr) \
}
#else /* USE_STRINGSTREAM */
typedef STD_NAMESPACE strstream OFStringStream;
typedef STD_NAMESPACE ostrstream OFOStringStream;
typedef STD_NAMESPACE istrstream OFIStringStream;
#define OFStringStream_ends STD_NAMESPACE ends
#define OFSTRINGSTREAM_GETOFSTRING(oss, strng) \
char *strng##__ = (oss).str(); \
OFString strng(strng##__, (oss).pcount()); \
delete[] strng##__;
// The following two macros define a block structure. Please note that variables
// declared between xxx_GETSTR and xxx_FREESTR are only valid within this scope.
#define OFSTRINGSTREAM_GETSTR(oss, chptr) \
{ \
const char *chptr = (oss).str();
#define OFSTRINGSTREAM_FREESTR(chptr) \
delete[] (char *)chptr; \
}
#endif /* USE_STRINGSTREAM */
#endif /* OFSTREAM_H */
|