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

void _STLP_CALL ios_base::_S_initialize ( ) [static, protected]

Definition at line 191 of file iostream.cpp.

Referenced by ios_base::Init::Init().

                                         {
#if !defined (_STLP_HAS_NO_NAMESPACES) && !defined (_STLP_DONT_USE_PRIV_NAMESPACE)
  using _STLP_PRIV stdio_istreambuf;
  using _STLP_PRIV stdio_ostreambuf;
#endif

  auto_ptr<streambuf> cin_buf;
  auto_ptr<streambuf> cout_buf;
  auto_ptr<streambuf> cerr_buf;
  auto_ptr<streambuf> clog_buf;

  if (_S_is_synced)
    cin_buf.reset(new stdio_istreambuf(stdin));
  else
    cin_buf.reset(_Stl_create_filebuf(stdin, ios_base::in));

  if (_S_is_synced) {
#ifdef _STLP_REDIRECT_STDSTREAMS
    cout_buf.reset(_Stl_create_filebuf("/stdout.txt", ios::out));
    cerr_buf.reset(_Stl_create_filebuf("/stderr.txt", ios::out));
    clog_buf.reset(_Stl_create_filebuf("/stdlog.txt", ios::out));
#else
    cout_buf.reset(new stdio_ostreambuf(stdout));
    cerr_buf.reset(new stdio_ostreambuf(stderr));
    clog_buf.reset(new stdio_ostreambuf(stderr));
#endif
  }
  else {
    cout_buf.reset(_Stl_create_filebuf(stdout, ios_base::out));
    cerr_buf.reset(_Stl_create_filebuf(stderr, ios_base::out));
    clog_buf.reset(_Stl_create_filebuf(stderr, ios_base::out));
  }

  istream* ptr_cin  = new(&cin)  istream(cin_buf.get()); cin_buf.release();
  ostream* ptr_cout = new(&cout) ostream(cout_buf.get()); cout_buf.release();
  ostream* ptr_cerr = new(&cerr) ostream(cerr_buf.get()); cerr_buf.release();
  /*ostream* ptr_clog = */ new(&clog) ostream(clog_buf.get()); clog_buf.release();
  ptr_cin->tie(ptr_cout);
  ptr_cerr->setf(ios_base::unitbuf);

#ifndef _STLP_NO_WCHAR_T
  auto_ptr<wfilebuf> win(_Stl_create_wfilebuf(stdin, ios_base::in));
  auto_ptr<wfilebuf> wout(_Stl_create_wfilebuf(stdout, ios_base::out));
  auto_ptr<wfilebuf> werr(_Stl_create_wfilebuf(stderr, ios_base::out));
  auto_ptr<wfilebuf> wlog(_Stl_create_wfilebuf(stderr, ios_base::out));

  // Run constructors for the four wide stream objects.
  wistream* ptr_wcin  = new(&wcin)  wistream(win.get()); win.release();
  wostream* ptr_wcout = new(&wcout) wostream(wout.get()); wout.release();
  wostream* ptr_wcerr = new(&wcerr) wostream(werr.get()); werr.release();
  /*wostream* ptr_wclog = */ new(&wclog) wostream(wlog.get()); wlog.release();

  ptr_wcin->tie(ptr_wcout);
  ptr_wcerr->setf(ios_base::unitbuf);
#endif
}

Generated on Sat May 26 2012 06:23:03 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.