hikyuu2/hikyuu_pywrap/ioredirect.cpp

22 lines
545 B
C++
Raw Normal View History

/*
* ioredirect.cpp
*
* Created on: 2018827
* Author: fasiondog
*/
#include "ioredirect.h"
using namespace boost::python;
void export_io_redirect() {
2018-09-22 18:27:55 +08:00
boost::python::docstring_options doc_options(false);
class_<OstreamRedirect>("OstreamRedirect", init<bool,bool>((arg("stdout")=true, arg("stderr")=true)))
.def("__enter__", &OstreamRedirect::enter)
.def("__exit__", &OstreamRedirect::exit)
.def("open", &OstreamRedirect::enter)
.def("close", &OstreamRedirect::exit)
;
}