xieite::file_pipe::open()

Defined in fragment xieite:file_pipe
(header-only: <xieite/io/file_pipe.hpp>)


Constructs a xieite::file_pipe.


Declaration

#0
void open(std::string_view cmd, std::string_view mode) noexcept;

#1
#if XIEITE_PLTF_TYPE_WINDOWS
void open(std::wstring_view cmd, std::wstring_view mode) noexcept;
#endif
Only defined if the target platform is Windows.


Example

import xieite;

int main() {
	xieite::file_pipe pipe;

	pipe.open("echo Hello, world!", "r");

	xieite::dump(xieite::read(pipe.get()));
}
Possible output:
Hello, world!