mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-05 13:28:11 +08:00
20 lines
499 B
C++
20 lines
499 B
C++
/*
|
|
* ioredirect.cpp
|
|
*
|
|
* Created on: 2018年8月27日
|
|
* Author: fasiondog
|
|
*/
|
|
|
|
#include "ioredirect.h"
|
|
|
|
using namespace boost::python;
|
|
|
|
void export_io_redirect() {
|
|
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);
|
|
}
|