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