19 #ifndef _STLP_SSTREAM_C 20 #define _STLP_SSTREAM_C 22 #ifndef _STLP_INTERNAL_SSTREAM 26 #if defined ( _STLP_NESTED_TYPE_PARAM_BUG ) 28 # define __BSB_int_type__ int 29 # define __BSB_pos_type__ streampos 31 # define __BSB_int_type__ _STLP_TYPENAME_ON_RETURN_TYPE basic_stringbuf<_CharT, _Traits, _Alloc>::int_type 32 # define __BSB_pos_type__ _STLP_TYPENAME_ON_RETURN_TYPE basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type 43 template <
class _CharT,
class _Traits,
class _Alloc>
49 template <
class _CharT,
class _Traits,
class _Alloc>
57 template <
class _CharT,
class _Traits,
class _Alloc>
62 template <
class _CharT,
class _Traits,
class _Alloc>
70 template <
class _CharT,
class _Traits,
class _Alloc>
74 _CharT* __data_ptr = _S_start(_M_str);
75 _CharT* __data_end = _S_finish(_M_str);
78 this->setg(__data_ptr, (_M_mode & ios_base::ate) ? __data_end : __data_ptr, __data_end);
83 if ( _M_mode & (ios_base::app | ios_base::ate) ) {
84 this->setp( __data_end, __data_end );
86 this->setp( __data_ptr, __data_end );
87 this->pbump((
int)_M_str.size());
94 template <
class _CharT,
class _Traits,
class _Alloc>
97 return this->gptr() != this->egptr()
98 ? _Traits::to_int_type(*this->gptr())
103 template <
class _CharT,
class _Traits,
class _Alloc>
106 if (this->gptr() != this->egptr()) {
107 int_type __c = _Traits::to_int_type(*this->gptr());
115 template <
class _CharT,
class _Traits,
class _Alloc>
118 if (this->gptr() != this->eback()) {
126 *this->gptr() = _Traits::to_char_type(
__c);
134 return _Traits::not_eof(
__c);
141 template <
class _CharT,
class _Traits,
class _Alloc>
146 if ( this->pptr() < this->epptr() ) {
147 _M_str.push_back( _Traits::to_char_type(
__c) );
150 ptrdiff_t __offset = this->gptr() - this->eback();
151 _M_str.push_back(_Traits::to_char_type(
__c));
152 _CharT* __data_ptr = _S_start(_M_str);
153 this->setg(__data_ptr, __data_ptr + __offset, _S_finish(_M_str));
154 this->setp(__data_ptr, _S_finish(_M_str));
155 this->pbump((
int)_M_str.size());
157 _M_str.push_back( _Traits::to_char_type(
__c) );
158 this->setp(_S_start(_M_str), _S_finish(_M_str));
159 this->pbump((
int)_M_str.size());
165 return _Traits::not_eof(
__c);
168 template <
class _CharT,
class _Traits,
class _Alloc>
177 if ( !_M_str.empty() && this->pbase() == _S_start(_M_str)) {
178 ptrdiff_t __avail = _S_finish(_M_str) - this->pptr();
181 this->pbump((
int)
__n);
185 __nwritten += __avail;
194 ptrdiff_t __get_offset = this->gptr() - this->eback();
196 __data_ptr = _S_start(_M_str);
197 this->setg(__data_ptr, __data_ptr + __get_offset, _S_finish(_M_str));
200 __data_ptr = _S_start(_M_str);
203 this->setp(__data_ptr, _S_finish(_M_str));
204 this->pbump((
int)_M_str.size());
211 template <
class _CharT,
class _Traits,
class _Alloc>
220 if (this->pbase() == _S_start(_M_str)) {
221 ptrdiff_t __avail = _S_finish(_M_str) - this->pptr();
228 _Traits::assign(this->pptr(), __avail,
__c);
229 __nwritten += __avail;
239 ptrdiff_t __get_offset = this->gptr() - this->eback();
240 _M_str.append(__app_size,
__c);
241 __data_ptr = _S_start(_M_str);
242 this->setg(__data_ptr, __data_ptr + __get_offset, _S_finish(_M_str));
244 _M_str.append(__app_size,
__c);
245 __data_ptr = _S_start(_M_str);
248 this->setp(__data_ptr, _S_finish(_M_str));
249 this->pbump((
int)_M_str.size());
250 __nwritten += __app_size;
260 template <
class _CharT,
class _Traits,
class _Alloc>
264 bool __do_get_area =
false;
265 bool __do_put_area =
false;
269 if (this->pbase() == _S_start(_M_str)) {
270 __do_put_area =
true;
271 __offp = this->pptr() - this->pbase();
274 if (this->eback() == _S_start(_M_str)) {
275 __do_get_area =
true;
276 __offg = this->gptr() - this->eback();
282 _CharT* __data_ptr = _S_start(_M_str);
285 this->setg(__data_ptr, __data_ptr + __offg, _S_finish(_M_str));
289 this->setp(__data_ptr, _S_finish(_M_str));
290 this->pbump((
int)__offp);
297 template <
class _CharT,
class _Traits,
class _Alloc>
308 if ( !(__imode || __omode) )
311 if ( (__imode && (this->gptr() == 0)) || (__omode && (this->pptr() == 0)) )
320 __newoff = _M_str.size();
323 __newoff = __imode ? this->gptr() - this->eback() : this->pptr() - this->pbase();
337 if (__off < 0 || __off >
__n)
346 if (__off < 0 || __off >
__n)
348 this->setp(this->pbase(), this->pbase() +
__n);
349 this->pbump((
int)__off);
355 template <
class _CharT,
class _Traits,
class _Alloc>
364 if ( !(__imode || __omode) )
367 if ( (__imode && (this->gptr() == 0)) || (__omode && (this->pptr() == 0)) )
373 if (__n < 0 || __n > this->egptr() - this->eback())
379 if (
__n < 0 ||
size_t(
__n) > _M_str.size())
382 this->setp(_S_start(_M_str), _S_finish(_M_str));
383 this->pbump((
int)
__n);
392 template <
class _CharT,
class _Traits,
class _Alloc>
400 template <
class _CharT,
class _Traits,
class _Alloc>
408 template <
class _CharT,
class _Traits,
class _Alloc>
415 template <
class _CharT,
class _Traits,
class _Alloc>
423 template <
class _CharT,
class _Traits,
class _Alloc>
431 template <
class _CharT,
class _Traits,
class _Alloc>
438 template <
class _CharT,
class _Traits,
class _Alloc>
445 template <
class _CharT,
class _Traits,
class _Alloc>
452 template <
class _CharT,
class _Traits,
class _Alloc>
458 # undef __BSB_int_type__ 459 # undef __BSB_pos_type__
virtual streamsize xsputn(const char_type *__s, streamsize __n)
#define __STATIC_CAST(__x, __y)
virtual pos_type seekoff(off_type __off, ios_base::seekdir __dir, ios_base::openmode __mode=ios_base::in|ios_base::out)
virtual _Base * setbuf(_CharT *__buf, streamsize __n)
#define eq(received, expected, label, type)
virtual int_type underflow()
virtual ~basic_stringbuf()
_Traits::off_type off_type
basic_stringbuf(ios_base::openmode __mode=ios_base::in|ios_base::out)
basic_stringstream(openmode __mod=ios_base::in|ios_base::out)
_Traits::pos_type pos_type
_Traits::int_type int_type
virtual streamsize _M_xsputnc(char_type __c, streamsize __n)
basic_ostringstream(ios_base::openmode __mode=ios_base::out)
_Check_return_ _CRTIMP int __cdecl __cdecl eof(_In_ int _FileHandle)
virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode=ios_base::in|ios_base::out)
#define _STLP_END_NAMESPACE
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
__kernel_ptrdiff_t ptrdiff_t
#define _STLP_BEGIN_NAMESPACE
basic_istringstream(ios_base::openmode __mode=ios_base::in)