25 #include <pybind11/pybind11.h>
30 using namespace pybind11::literals;
37 py::class_<Stream, std::shared_ptr<Stream>> clsStream(mod,
"Stream");
39 clsStream.def(py::init<std::istream *, std::ostream *>(),
"istream"_a,
"ostream"_a);
40 clsStream.def(py::init<>());
42 clsStream.def_property_readonly(
"isFits", &Stream::getIsFits);
43 clsStream.def_property_readonly(
"hasStdStream", &Stream::hasStdStream);
49 py::class_<FileStream, std::shared_ptr<FileStream>, Stream> clsFileStream(mod,
"FileStream");
51 clsFileStream.def(py::init<std::string const &, bool>(),
"path"_a,
"doWrite"_a =
false);
53 clsFileStream.def_property_readonly(
"path", &FileStream::getPath);
56 py::class_<StringStream, std::shared_ptr<StringStream>, Stream> clsStringStream(mod,
"StringStream");
58 clsStringStream.def(py::init<std::string const &>(),
"data"_a =
"");
60 clsStringStream.def(
"getSourceData", &StringStream::getSourceData);
61 clsStringStream.def(
"getSinkData", &StringStream::getSinkData);
62 clsStringStream.def(
"sinkToSource", &StringStream::sinkToSource);