39#include "blocxx/BLOCXX_config.h"
46#ifdef BLOCXX_HAVE_UNISTD_H
52#include "blocxx/WinUnnamedPipe.hpp"
55#include <sys/socket.h>
72 return this->
write(&value,
sizeof(
int));
79 int len =
static_cast<int>(
strData.length()+1);
90 return this->
read(value,
sizeof(
int));
124 return retval.releaseString();
133 return WinUnnamedPipe::createUnnamedPipe(
doOpen);
145 return WinUnnamedPipe::createStdin();
162 return WinUnnamedPipe::createStdout();
179 return WinUnnamedPipe::createStdinStdout();
201 return WinUnnamedPipe::createStderr();
218 return WinUnnamedPipe::createUnnamedPipeFromDescriptor(
inputAndOutput);
235 return WinUnnamedPipe::createUnnamedPipeFromDescriptor(
input,
output);
247 return WinUnnamedPipe::createConnectedPipes(
first,
second);
#define BLOCXX_DEFINE_EXCEPTION_WITH_ID(NAME)
Define a new exception class named <NAME>Exception that derives from Exception.
#define BLOCXX_THROW_ERRNO_MSG(exType, msg)
Throw an exception using FILE, LINE, errno and strerror(errno)
#define BLOCXX_INVALID_HANDLE
The AutoPtrVec class provides a simple class for smart pointers to a dynamically allocated array of o...
PURPOSE: The AutoResource class template is an analog of std::auto_ptr for managing arbitrary resourc...
virtual int write(const void *dataOut, int dataOutLen, ErrorAction errorAsException=E_RETURN_ON_ERROR)=0
Write a specified number of bytes to the device that is exposing the IOIFC interface.
virtual int read(void *dataIn, int dataInLen, ErrorAction errorAsException=E_RETURN_ON_ERROR)=0
Read a specified number of bytes from the device that is exposing the IOIFC interface.
This String class is an abstract data type that represents as NULL terminated string of characters.
const char * c_str() const
Abstract interface for an UnnamedPipe.
int readString(String &strData)
Reads a String from the pipe.
static UnnamedPipeRef createStdinStdout()
Create an instance of the concrete class that implements the UnnamedPipe interface connected to stdin...
static void createConnectedPipes(UnnamedPipeRef &first, UnnamedPipeRef &second)
Create a connected pair of pipes.
static UnnamedPipeRef createStdout()
Create an instance of the concrete class that implements the UnnamedPipe interface connected to stdou...
int readInt(int *value)
Reads an int (native binary representation) from the pipe.
static UnnamedPipeRef createUnnamedPipe(EOpen doOpen=E_OPEN)
Create an instance of the concrete class that implements the UnnamedPipe interface.
int writeString(const String &strData)
Writes a String to the pipe.
int writeInt(int value)
Write an int (native binary representation) to the pipe.
static UnnamedPipeRef createStdin()
Create an instance of the concrete class that implements the UnnamedPipe interface connected to stdin...
String readAll()
Read from the pipe and collect into a string, until the other end of the pipe is closed.
static UnnamedPipeRef createUnnamedPipeFromDescriptor(AutoDescriptor inputAndOutput)
Create an instance of the concrete class that implements the UnnamedPipe interface connected bidirect...
static UnnamedPipeRef createStderr()
Create an instance of the concrete class that implements the UnnamedPipe interface connected to stder...
IntrusiveReference< UnnamedPipe > UnnamedPipeRef
bool operator==(const Array< T > &x, const Array< T > &y)
AutoResource< AutoDescriptorPolicy > AutoDescriptor
An analog of std::auto_ptr for descriptors.