VirtualBox

Changeset 99828 in vbox for trunk/include/iprt/nocrt/ostream


Ignore:
Timestamp:
May 17, 2023 1:48:57 PM (23 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
157464
Message:

*: A bunch of adjustments that allows using /permissive- with Visual C++ (qt 6.x necessity).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/nocrt/ostream

    r98103 r99828  
    5151    class basic_ostream : public basic_ios<a_CharType, a_CharTraits>
    5252    {
     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
    5360    protected:
    5461        /** Sentry class that performs pre and post output work. */
     
    7178                        pTiedStream->flush();
    7279                        if (!pTiedStream->good())
    73                             a_rParent.setstate(failbit);
     80                            a_rParent.setstate(ios::failbit);
    7481                    }
    7582                }
     
    9198    public:
    9299        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)
    94101        { }
    95102
     
    99106                               std::basic_ostream<a_CharType, a_CharTraits> *a_pTiedStream,
    100107                               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;
    104111            if (!a_fUnbuffered)
    105                 setf(std::ios_base::unitbuf);
     112                this->setf(std::ios_base::unitbuf);
    106113        }
    107114
     
    116123
    117124    public:
    118         basic_ostream &put(char_type a_ch)
     125        basic_ostream &put(a_CharType a_ch)
    119126        {
    120127            sentry PrePost(*this);
    121128            if (PrePost)
    122129            {
    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;
    125132            }
    126133            return *this;
    127134        }
    128135
    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)
    130137        {
    131138            sentry PrePost(*this);
    132139            if (PrePost)
    133140            {
    134                 std::streamsize cchWritten = m_pBuf->sputn(a_pchSrc, a_cchToWrite);
     141                std::streamsize cchWritten = this->m_pBuf->sputn(a_pchSrc, a_cchToWrite);
    135142                if (cchWritten != a_cchToWrite)
    136                     m_fState |= badbit;
     143                    this->m_fState |= ios::badbit;
    137144            }
    138145            return *this;
     
    141148        basic_ostream &flush()
    142149        {
    143             if (m_pBuf)
    144                 m_pBuf->pubsync();
     150            if (this->m_pBuf)
     151                this->m_pBuf->pubsync();
    145152            return *this;
    146153        }
     
    148155        pos_type       tellp() RT_NOEXCEPT;
    149156        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;
    151158
    152159        /** @name Internal support methods
     
    157164        inline unsigned intGetIntegerBase() const RT_NOEXCEPT
    158165        {
    159             switch (m_fFlags & basefield)
     166            switch (this->m_fFlags & ios::basefield)
    160167            {
    161168                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;
    165172            }
    166173        }
     
    170177        {
    171178            unsigned fFlags = 0;
    172             if (m_fFlags & uppercase)
     179            if (this->m_fFlags & ios::uppercase)
    173180                fFlags |= RTSTR_F_CAPITAL;
    174             if (m_fFlags & showbase)
     181            if (this->m_fFlags & ios::showbase)
    175182                fFlags |= RTSTR_F_SPECIAL;
    176             if (m_fFlags & showpos)
     183            if (this->m_fFlags & ios::showpos)
    177184                fFlags |= RTSTR_F_PLUS;
    178185            return fFlags;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette