ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

_ios.c
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1999
00003  * Silicon Graphics Computer Systems, Inc.
00004  *
00005  * Copyright (c) 1999
00006  * Boris Fomitchev
00007  *
00008  * This material is provided "as is", with absolutely no warranty expressed
00009  * or implied. Any use is at your own risk.
00010  *
00011  * Permission to use or copy this software for any purpose is hereby granted
00012  * without fee, provided the above notices are retained on all copies.
00013  * Permission to modify the code and to distribute modified code is granted,
00014  * provided the above notices are retained, and a notice that the code was
00015  * modified is included with the above copyright notice.
00016  *
00017  */
00018 #ifndef _STLP_IOS_C
00019 #define _STLP_IOS_C
00020 
00021 #ifndef _STLP_INTERNAL_IOS_H
00022 # include <stl/_ios.h>
00023 #endif
00024 
00025 #ifndef _STLP_INTERNAL_STREAMBUF
00026 # include <stl/_streambuf.h>
00027 #endif
00028 
00029 #ifndef _STLP_INTERNAL_NUMPUNCT_H
00030 # include <stl/_numpunct.h>
00031 #endif
00032 
00033 _STLP_BEGIN_NAMESPACE
00034 
00035 // basic_ios<>'s non-inline member functions
00036 
00037 // Public constructor, taking a streambuf.
00038 template <class _CharT, class _Traits>
00039 basic_ios<_CharT, _Traits>
00040   ::basic_ios(basic_streambuf<_CharT, _Traits>* __streambuf)
00041     : ios_base(), _M_cached_ctype(0),
00042       _M_fill(_STLP_NULL_CHAR_INIT(_CharT)), _M_streambuf(0), _M_tied_ostream(0) {
00043   basic_ios<_CharT, _Traits>::init(__streambuf);
00044 }
00045 
00046 template <class _CharT, class _Traits>
00047 basic_streambuf<_CharT, _Traits>*
00048 basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __buf) {
00049   basic_streambuf<_CharT, _Traits>* __tmp = _M_streambuf;
00050   _M_streambuf = __buf;
00051   this->clear();
00052   return __tmp;
00053 }
00054 
00055 template <class _CharT, class _Traits>
00056 basic_ios<_CharT, _Traits>&
00057 basic_ios<_CharT, _Traits>::copyfmt(const basic_ios<_CharT, _Traits>& __x) {
00058   _M_invoke_callbacks(erase_event);
00059   _M_copy_state(__x);           // Inherited from ios_base.
00060   _M_cached_ctype = __x._M_cached_ctype;
00061   _M_fill = __x._M_fill;
00062   _M_tied_ostream = __x._M_tied_ostream;
00063   _M_invoke_callbacks(copyfmt_event);
00064   this->_M_set_exception_mask(__x.exceptions());
00065   return *this;
00066 }
00067 
00068 template <class _CharT, class _Traits>
00069 locale basic_ios<_CharT, _Traits>::imbue(const locale& __loc) {
00070   locale __tmp = ios_base::imbue(__loc);
00071   _STLP_TRY {
00072     if (_M_streambuf)
00073       _M_streambuf->pubimbue(__loc);
00074 
00075     // no throwing here
00076     _M_cached_ctype = &use_facet<ctype<char_type> >(__loc);
00077   }
00078   _STLP_CATCH_ALL {
00079     __tmp = ios_base::imbue(__tmp);
00080     _M_handle_exception(ios_base::failbit);
00081   }
00082   return __tmp;
00083 }
00084 
00085 // Protected constructor and initialization functions. The default
00086 // constructor creates an uninitialized basic_ios, and init() initializes
00087 // all of the members to the values in Table 89 of the C++ standard.
00088 
00089 template <class _CharT, class _Traits>
00090 basic_ios<_CharT, _Traits>::basic_ios()
00091   : ios_base(),
00092     _M_fill(_STLP_NULL_CHAR_INIT(_CharT)), _M_streambuf(0), _M_tied_ostream(0)
00093 {}
00094 
00095 template <class _CharT, class _Traits>
00096 void
00097 basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb)
00098 {
00099   this->rdbuf(__sb);
00100   this->imbue(locale());
00101   this->tie(0);
00102   this->_M_set_exception_mask(ios_base::goodbit);
00103   this->_M_clear_nothrow(__sb != 0 ? ios_base::goodbit : ios_base::badbit);
00104   ios_base::flags(ios_base::skipws | ios_base::dec);
00105   ios_base::width(0);
00106   ios_base::precision(6);
00107   this->fill(widen(' '));
00108   // We don't need to worry about any of the three arrays: they are
00109   // initialized correctly in ios_base's constructor.
00110 }
00111 
00112 // This is never called except from within a catch clause.
00113 template <class _CharT, class _Traits>
00114 void basic_ios<_CharT, _Traits>::_M_handle_exception(ios_base::iostate __flag)
00115 {
00116   this->_M_setstate_nothrow(__flag);
00117   if (this->_M_get_exception_mask() & __flag)
00118     _STLP_RETHROW;
00119 }
00120 
00121 _STLP_END_NAMESPACE
00122 
00123 #endif /* _STLP_IOS_C */
00124 
00125 // Local Variables:
00126 // mode:C++
00127 // End:

Generated on Sat May 26 2012 04:27:43 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.