Changeset 99828 in vbox for trunk/include/iprt/nocrt/ostream
- Timestamp:
- May 17, 2023 1:48:57 PM (23 months ago)
- svn:sync-xref-src-repo-rev:
- 157464
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/nocrt/ostream
r98103 r99828 51 51 class basic_ostream : public basic_ios<a_CharType, a_CharTraits> 52 52 { 53 public: 54 typedef a_CharType char_type; 55 typedef a_CharTraits traits_type; 56 typedef typename a_CharTraits::int_type int_type; 57 typedef typename a_CharTraits::pos_type pos_type; 58 typedef typename a_CharTraits::off_type off_type; 59 53 60 protected: 54 61 /** Sentry class that performs pre and post output work. */ … … 71 78 pTiedStream->flush(); 72 79 if (!pTiedStream->good()) 73 a_rParent.setstate( failbit);80 a_rParent.setstate(ios::failbit); 74 81 } 75 82 } … … 91 98 public: 92 99 explicit basic_ostream(std::basic_streambuf<a_CharType,a_CharTraits> *a_pBuf) 93 : basic_ios (a_pBuf)100 : basic_ios<a_CharType, a_CharTraits>(a_pBuf) 94 101 { } 95 102 … … 99 106 std::basic_ostream<a_CharType, a_CharTraits> *a_pTiedStream, 100 107 bool a_fUnbuffered) 101 : basic_ios (a_pBuf)102 { 103 m_pTiedStream = a_pTiedStream;108 : basic_ios<a_CharType, a_CharTraits>(a_pBuf) 109 { 110 this->m_pTiedStream = a_pTiedStream; 104 111 if (!a_fUnbuffered) 105 setf(std::ios_base::unitbuf);112 this->setf(std::ios_base::unitbuf); 106 113 } 107 114 … … 116 123 117 124 public: 118 basic_ostream &put( char_type a_ch)125 basic_ostream &put(a_CharType a_ch) 119 126 { 120 127 sentry PrePost(*this); 121 128 if (PrePost) 122 129 { 123 if ( m_pBuf->sputc(a_ch) == traits_type::eof())124 m_fState |=badbit;130 if (this->m_pBuf->sputc(a_ch) == traits_type::eof()) 131 this->m_fState |= ios::badbit; 125 132 } 126 133 return *this; 127 134 } 128 135 129 basic_ostream &write(const char_type *a_pchSrc, std::streamsize a_cchToWrite)136 basic_ostream &write(const a_CharType *a_pchSrc, std::streamsize a_cchToWrite) 130 137 { 131 138 sentry PrePost(*this); 132 139 if (PrePost) 133 140 { 134 std::streamsize cchWritten = m_pBuf->sputn(a_pchSrc, a_cchToWrite);141 std::streamsize cchWritten = this->m_pBuf->sputn(a_pchSrc, a_cchToWrite); 135 142 if (cchWritten != a_cchToWrite) 136 m_fState |=badbit;143 this->m_fState |= ios::badbit; 137 144 } 138 145 return *this; … … 141 148 basic_ostream &flush() 142 149 { 143 if ( m_pBuf)144 m_pBuf->pubsync();150 if (this->m_pBuf) 151 this->m_pBuf->pubsync(); 145 152 return *this; 146 153 } … … 148 155 pos_type tellp() RT_NOEXCEPT; 149 156 basic_ostream &seekp(pos_type a_off) RT_NOEXCEPT; 150 basic_ostream &seekp(off_type a_off, seekdir enmDir) RT_NOEXCEPT;157 basic_ostream &seekp(off_type a_off, ios::seekdir enmDir) RT_NOEXCEPT; 151 158 152 159 /** @name Internal support methods … … 157 164 inline unsigned intGetIntegerBase() const RT_NOEXCEPT 158 165 { 159 switch ( m_fFlags &basefield)166 switch (this->m_fFlags & ios::basefield) 160 167 { 161 168 default: 162 case dec: return 10;163 case hex: return 16;164 case oct: return 8;169 case ios::dec: return 10; 170 case ios::hex: return 16; 171 case ios::oct: return 8; 165 172 } 166 173 } … … 170 177 { 171 178 unsigned fFlags = 0; 172 if ( m_fFlags &uppercase)179 if (this->m_fFlags & ios::uppercase) 173 180 fFlags |= RTSTR_F_CAPITAL; 174 if ( m_fFlags &showbase)181 if (this->m_fFlags & ios::showbase) 175 182 fFlags |= RTSTR_F_SPECIAL; 176 if ( m_fFlags &showpos)183 if (this->m_fFlags & ios::showpos) 177 184 fFlags |= RTSTR_F_PLUS; 178 185 return fFlags;
Note:
See TracChangeset
for help on using the changeset viewer.