| 50 | \*---------------------------------------------------------------------------*/ |
| 51 | |
| 52 | class OSstream |
| 53 | : |
| 54 | public Ostream |
| 55 | { |
| 56 | // Private data |
| 57 | |
| 58 | fileName name_; |
| 59 | ostream& os_; |
| 60 | |
| 61 | |
| 62 | // Private Member Functions |
| 63 | |
| 64 | //- Disallow default bitwise assignment |
| 65 | void operator=(const OSstream&); |
| 66 | |
| 67 | |
| 68 | public: |
| 69 | |
| 70 | // Constructors |
| 71 | |
| 72 | //- Set stream status |
| 73 | OSstream |
| 74 | ( |
| 75 | ostream& os, |
| 76 | const string& name, |
| 77 | streamFormat format=ASCII, |
| 78 | versionNumber version=currentVersion, |
| 79 | compressionType compression=UNCOMPRESSED |
| 80 | ); |
| 81 | |
| 82 | |
| 83 | // Member functions |
| 84 | |
| 85 | // Enquiry |
| 86 | |
| 87 | //- Return the name of the stream |
| 88 | // Useful for Fstream to return the filename |
| 89 | virtual const fileName& name() const |
| 90 | { |
| 91 | return name_; |
| 92 | } |
| 93 | |
| 94 | //- Return non-const access to the name of the stream |
| 95 | // Useful to alter the stream name |
| 96 | virtual fileName& name() |
| 97 | { |
| 98 | return name_; |
| 99 | } |
| 100 | |
| 101 | //- Return flags of output stream |
| 102 | virtual ios_base::fmtflags flags() const; |
| 103 | |
| 104 | |
| 105 | // Write functions |
| 106 | |
| 107 | //- Write next token to stream |
| 108 | virtual Ostream& write(const token&); |
| 109 | |