Changeset 99828 in vbox for trunk/include/iprt
- Timestamp:
- May 17, 2023 1:48:57 PM (22 months ago)
- svn:sync-xref-src-repo-rev:
- 157464
- Location:
- trunk/include/iprt/nocrt
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/nocrt/fstream
r98103 r99828 56 56 public: 57 57 basic_filebuf(PRTSTREAM a_pStrm = NULL, bool a_fStdStream = false) 58 : basic_streambuf ()58 : basic_streambuf<a_CharType, a_CharTraits>() 59 59 , m_pStrm(a_pStrm) 60 60 , m_fStdStream(a_fStdStream) … … 142 142 //} 143 143 144 std::streamsize xsputn(char_type const *a_pchSrc, std::streamsize a_cchSrc) //RT_OVERRIDE 144 std::streamsize xsputn(typename basic_streambuf<a_CharType, a_CharTraits>::char_type const *a_pchSrc, 145 std::streamsize a_cchSrc) //RT_OVERRIDE 145 146 { 146 147 if (flushBuffered()) … … 167 168 public: 168 169 basic_ofstream() 169 : basic_ostream (&m_FileBuf) /** @todo m_FileBuf isn't initialized yet... */170 : basic_ostream<a_CharType, a_CharTraits>(&m_FileBuf) /** @todo m_FileBuf isn't initialized yet... */ 170 171 , m_FileBuf() 171 172 { … … 173 174 174 175 explicit basic_ofstream(const char *a_pszFilename, ios_base::openmode a_fMode = ios_base::out) 175 : basic_ostream (&m_FileBuf) /** @todo m_FileBuf isn't initialized yet... */176 : basic_ostream<a_CharType, a_CharTraits>(&m_FileBuf) /** @todo m_FileBuf isn't initialized yet... */ 176 177 , m_FileBuf() 177 178 { -
trunk/include/iprt/nocrt/ios
r98103 r99828 266 266 char_type *epptr() const RT_NOEXCEPT 267 267 { 268 return &m_pach Buf[m_cchPut];268 return &m_pachPut[m_cchPut]; 269 269 } 270 270 … … 498 498 } 499 499 500 std::basic_streambuf<a_CharType, a_CharTraits> *rdbuf(std::basic_streambuf<a_CharType, a_CharTraits> *a_pNew buf) RT_NOEXCEPT500 std::basic_streambuf<a_CharType, a_CharTraits> *rdbuf(std::basic_streambuf<a_CharType, a_CharTraits> *a_pNewBuf) RT_NOEXCEPT 501 501 { 502 502 std::basic_streambuf<a_CharType, a_CharTraits> *pOldBuf = m_pBuf; -
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; -
trunk/include/iprt/nocrt/string
r98103 r99828 158 158 { 159 159 const char_type * const pszStart = a_psz; 160 while (!eq(*a_psz Left, char_type()))160 while (!eq(*a_psz, char_type())) 161 161 a_psz++; 162 162 return static_cast<std::size_t>(a_psz - pszStart); … … 216 216 char_type volatile *pchDstV = static_cast<char_type const volatile *>(a_pchDst); 217 217 char_type const volatile *pchSrcV = static_cast<char_type const volatile *>(a_pchSrc); 218 if ((uintptr_t) a_pchDst < (uintptr_t)a_pchSrc)218 if ((uintptr_t)pchDstV < (uintptr_t)pchSrcV) 219 219 { 220 220 /* forward copy */ 221 221 while (a_cch-- > 0) 222 * a_pchDstV++ = *a_pchSrcV++;222 *pchDstV++ = *pchSrcV++; 223 223 } 224 224 else 225 225 { 226 226 /* reverse copy */ 227 a_pchSrcV += a_cch;228 a_pchDstV += a_cch;229 while (a_cch Dst-- > 0)230 * a_pchDstV-- = *a_pchSrcV--;227 pchSrcV += a_cch; 228 pchDstV += a_cch; 229 while (a_cch-- > 0) 230 *pchDstV-- = *pchSrcV--; 231 231 } 232 232 return pchRet;
Note:
See TracChangeset
for help on using the changeset viewer.