#ifndef IOSTREAM_PIPE_H__
#define IOSTREAM_PIPE_H__


#include "maxon/iostreams.h"


namespace maxon
{

/// @addtogroup IO
/// @{

//----------------------------------------------------------------------------------------
/// Parameters for UrlInterface::SetData(), UrlInterface::GetData().
//----------------------------------------------------------------------------------------
namespace URLFLAGS
{
	MAXON_ATTRIBUTE(Bool, PIPE_CREATE, 'pipc'); ///< Set to true, if the named pipe should be created, otherwise an existing pipe will be used. This flag is ignored for unnamed pipes. Depending on the OS the name might be modified.
}


#ifdef MAXON_TARGET_WINDOWS
	using PIPEHANDLE = void*;
#else
	using PIPEHANDLE = int;
#endif

//----------------------------------------------------------------------------------------
/// Creates a pipe stream for in and output
//----------------------------------------------------------------------------------------
class IoPipeInOutputStreamInterface : MAXON_INTERFACE_BASES(InOutputStreamInterface)
{
	MAXON_INTERFACE(IoPipeInOutputStreamInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.iopipeinoutputstream");
public:

	MAXON_METHOD PIPEHANDLE GetReadHandle() const;
	MAXON_METHOD PIPEHANDLE GetWriteHandle() const;
};

// include autogenerated headerfile here
#include "iostream_pipe1.hxx"
#include "iostream_pipe2.hxx"

/// @}

} // namespace maxon



#endif // IOSTREAM_PIPE_H__
