GClasses

GClasses::GPipe Class Reference

This class wraps the handle of a pipe. It closes the pipe when it is destroyed. This class is useful in conjunction with GApp::systemExecute for reading from, or writing to, the standard i/o streams of a child process. More...

#include <GApp.h>

List of all members.

Public Member Functions

 GPipe ()
 Construct an empty pipe holder.
 ~GPipe ()
void set (HANDLE h)
 Set the handle of the pipe.
HANDLE get ()
 Returns the current handle.
ssize_t read (char *buf, size_t bufSize)
 Read from the pipe until there is nothing else to read, or the buffer is full.
void write (const char *buf, size_t bufSize)
 Write to the pipe.
void toFile (const char *szFilename)
 Reads from the pipe and writes to the specified file, until there is nothing left to read.

Protected Attributes

HANDLE m_handle

Detailed Description

This class wraps the handle of a pipe. It closes the pipe when it is destroyed. This class is useful in conjunction with GApp::systemExecute for reading from, or writing to, the standard i/o streams of a child process.


Constructor & Destructor Documentation

GClasses::GPipe::GPipe ( )

Construct an empty pipe holder.

GClasses::GPipe::~GPipe ( )

Member Function Documentation

HANDLE GClasses::GPipe::get ( ) [inline]

Returns the current handle.

ssize_t GClasses::GPipe::read ( char *  buf,
size_t  bufSize 
)

Read from the pipe until there is nothing else to read, or the buffer is full.

void GClasses::GPipe::set ( HANDLE  h)

Set the handle of the pipe.

void GClasses::GPipe::toFile ( const char *  szFilename)

Reads from the pipe and writes to the specified file, until there is nothing left to read.

void GClasses::GPipe::write ( const char *  buf,
size_t  bufSize 
)

Write to the pipe.


Member Data Documentation

HANDLE GClasses::GPipe::m_handle [protected]