comparison DEPENDENCIES/generic/include/boost/log/detail/attachable_sstream_buf.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
comparison
equal deleted inserted replaced
100:793467b5e61c 101:c530137014c0
1 /* 1 /*
2 * Copyright Andrey Semashev 2007 - 2013. 2 * Copyright Andrey Semashev 2007 - 2015.
3 * Distributed under the Boost Software License, Version 1.0. 3 * Distributed under the Boost Software License, Version 1.0.
4 * (See accompanying file LICENSE_1_0.txt or copy at 4 * (See accompanying file LICENSE_1_0.txt or copy at
5 * http://www.boost.org/LICENSE_1_0.txt) 5 * http://www.boost.org/LICENSE_1_0.txt)
6 */ 6 */
7 /*! 7 /*!
80 } 80 }
81 81
82 //! Clears the buffer to the initial state 82 //! Clears the buffer to the initial state
83 void clear() 83 void clear()
84 { 84 {
85 register char_type* pBase = this->pbase(); 85 char_type* pBase = this->pbase();
86 register char_type* pPtr = this->pptr(); 86 char_type* pPtr = this->pptr();
87 if (pBase != pPtr) 87 if (pBase != pPtr)
88 this->pbump(static_cast< int >(pBase - pPtr)); 88 this->pbump(static_cast< int >(pBase - pPtr));
89 } 89 }
90 90
91 //! Detaches the buffer from the string 91 //! Detaches the buffer from the string
111 protected: 111 protected:
112 //! Puts all buffered data to the string 112 //! Puts all buffered data to the string
113 int sync() 113 int sync()
114 { 114 {
115 BOOST_ASSERT(m_Storage != 0); 115 BOOST_ASSERT(m_Storage != 0);
116 register char_type* pBase = this->pbase(); 116 char_type* pBase = this->pbase();
117 register char_type* pPtr = this->pptr(); 117 char_type* pPtr = this->pptr();
118 if (pBase != pPtr) 118 if (pBase != pPtr)
119 { 119 {
120 m_Storage->append(pBase, pPtr); 120 m_Storage->append(pBase, pPtr);
121 this->pbump(static_cast< int >(pBase - pPtr)); 121 this->pbump(static_cast< int >(pBase - pPtr));
122 } 122 }
139 std::streamsize xsputn(const char_type* s, std::streamsize n) 139 std::streamsize xsputn(const char_type* s, std::streamsize n)
140 { 140 {
141 BOOST_ASSERT(m_Storage != 0); 141 BOOST_ASSERT(m_Storage != 0);
142 basic_ostringstreambuf::sync(); 142 basic_ostringstreambuf::sync();
143 typedef typename string_type::size_type string_size_type; 143 typedef typename string_type::size_type string_size_type;
144 register const string_size_type max_storage_left = 144 const string_size_type max_storage_left =
145 m_Storage->max_size() - m_Storage->size(); 145 m_Storage->max_size() - m_Storage->size();
146 if (static_cast< string_size_type >(n) < max_storage_left) 146 if (static_cast< string_size_type >(n) < max_storage_left)
147 { 147 {
148 m_Storage->append(s, static_cast< string_size_type >(n)); 148 m_Storage->append(s, static_cast< string_size_type >(n));
149 return n; 149 return n;