VirtualBox

Changeset 96354 in vbox


Ignore:
Timestamp:
Aug 19, 2022 5:37:29 PM (2 years ago)
Author:
vboxsync
Message:

IPRT/nocrt: Defined cout and cerr; implemented ostream::flush and fixed a compile issue. bugref:10261

Location:
trunk
Files:
2 added
3 edited

Legend:

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

    r95993 r96354  
    358358                if (cchCopied > 0)
    359359                {
    360                     cchCopied = RT_MIN(cchCopied, a_cchSrc);
     360                    cchCopied = RT_MIN(cchCopied, static_cast<std::size_t>(a_cchSrc));
    361361                    traits_type::copy(&m_pachPut[m_offPutNext], a_pchSrc, cchCopied);
    362362                    m_cchPut += cchCopied;
  • trunk/include/iprt/nocrt/ostream

    r95993 r96354  
    8383            : basic_ios(a_pBuf)
    8484        { }
     85
     86        /** For cerr initialization.
     87         * @internal */
     88        explicit basic_ostream(std::basic_streambuf<a_CharType,a_CharTraits> *a_pBuf,
     89                               std::basic_ostream<a_CharType, a_CharTraits> *a_pTiedStream,
     90                               bool a_fUnbuffered)
     91            : basic_ios(a_pBuf)
     92        {
     93            m_pTiedStream = a_pTiedStream;
     94            if (!a_fUnbuffered)
     95                setf(std::ios_base::unitbuf);
     96        }
     97
    8598    private:
    8699        basic_ostream(basic_ostream const &a_rSrc);             /* not copyable */
     
    116129        }
    117130
    118         basic_ostream &flush();
     131        basic_ostream &flush()
     132        {
     133            if (m_pBuf)
     134                m_pBuf->pubsync();
     135            return *this;
     136        }
     137
    119138        pos_type       tellp() RT_NOEXCEPT;
    120139        basic_ostream &seekp(pos_type a_off) RT_NOEXCEPT;
     
    123142        /** @name Internal support methods
    124143         * @{ */
    125         basic_ostream &intWrite(const char *a_pchSrc, std::streamsize a_cchToWrite); /**< Internal method outputting char buffers. */
     144        inline basic_ostream &intWrite(const char *a_pchSrc, std::streamsize a_cchToWrite); /**< Internal method outputting char buffers. */
    126145
    127146        /** @returns 8, 10 or 16. */
     
    240259
    241260    template<>
    242     basic_ostream<char> &basic_ostream<char>::intWrite(const char *a_pchSrc, std::streamsize a_cchToWrite)
     261    inline basic_ostream<char> &basic_ostream<char>::intWrite(const char *a_pchSrc, std::streamsize a_cchToWrite)
    243262    {
    244263        return write(a_pchSrc, a_cchToWrite);
  • trunk/src/VBox/Runtime/Makefile.kmk

    r96338 r96354  
    19031903        r3/nocrt-clearerr.cpp \
    19041904        r3/nocrt-ferror.cpp \
     1905        r3/nocrt-cerr.cpp \
     1906        r3/nocrt-cout.cpp \
    19051907
    19061908  RuntimeR3_SOURCES.x86 = $(RuntimeBaseR3_SOURCES.x86) \
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