VirtualBox

Changeset 99828 in vbox for trunk/include/iprt


Ignore:
Timestamp:
May 17, 2023 1:48:57 PM (22 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).

Location:
trunk/include/iprt/nocrt
Files:
4 edited

Legend:

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

    r98103 r99828  
    5656    public:
    5757        basic_filebuf(PRTSTREAM a_pStrm = NULL, bool a_fStdStream = false)
    58             : basic_streambuf()
     58            : basic_streambuf<a_CharType, a_CharTraits>()
    5959            , m_pStrm(a_pStrm)
    6060            , m_fStdStream(a_fStdStream)
     
    142142        //}
    143143
    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
    145146        {
    146147            if (flushBuffered())
     
    167168    public:
    168169        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... */
    170171            , m_FileBuf()
    171172        {
     
    173174
    174175        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... */
    176177            , m_FileBuf()
    177178        {
  • trunk/include/iprt/nocrt/ios

    r98103 r99828  
    266266        char_type *epptr()  const RT_NOEXCEPT
    267267        {
    268             return &m_pachBuf[m_cchPut];
     268            return &m_pachPut[m_cchPut];
    269269        }
    270270
     
    498498        }
    499499
    500         std::basic_streambuf<a_CharType, a_CharTraits> *rdbuf(std::basic_streambuf<a_CharType, a_CharTraits> *a_pNewbuf) RT_NOEXCEPT
     500        std::basic_streambuf<a_CharType, a_CharTraits> *rdbuf(std::basic_streambuf<a_CharType, a_CharTraits> *a_pNewBuf) RT_NOEXCEPT
    501501        {
    502502            std::basic_streambuf<a_CharType, a_CharTraits> *pOldBuf = m_pBuf;
  • 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;
  • trunk/include/iprt/nocrt/string

    r98103 r99828  
    158158    {
    159159        const char_type * const pszStart = a_psz;
    160         while (!eq(*a_pszLeft, char_type()))
     160        while (!eq(*a_psz, char_type()))
    161161               a_psz++;
    162162        return static_cast<std::size_t>(a_psz - pszStart);
     
    216216        char_type volatile       *pchDstV = static_cast<char_type const volatile *>(a_pchDst);
    217217        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)
    219219        {
    220220            /* forward copy */
    221221            while (a_cch-- > 0)
    222                 *a_pchDstV++ = *a_pchSrcV++;
     222                *pchDstV++ = *pchSrcV++;
    223223        }
    224224        else
    225225        {
    226226            /* reverse copy */
    227             a_pchSrcV += a_cch;
    228             a_pchDstV += a_cch;
    229             while (a_cchDst-- > 0)
    230                 *a_pchDstV-- = *a_pchSrcV--;
     227            pchSrcV += a_cch;
     228            pchDstV += a_cch;
     229            while (a_cch-- > 0)
     230                *pchDstV-- = *pchSrcV--;
    231231        }
    232232        return pchRet;
Note: See TracChangeset for help on using the changeset viewer.

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