enhanded StdAwk::Pipe to support CloseMode

This commit is contained in:
2009-08-29 03:48:02 +00:00
parent 81b3d369e8
commit 2ba054c1a3
7 changed files with 52 additions and 37 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.hpp 267 2009-08-25 09:50:07Z hyunghwan.chung $
* $Id: Awk.hpp 272 2009-08-28 09:48:02Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
@ -403,11 +403,23 @@ public:
RW = QSE_AWK_RIO_PIPE_RW
};
enum CloseMode
{
CLOSE_FULL = QSE_AWK_RIO_CLOSE_FULL,
CLOSE_READ = QSE_AWK_RIO_CLOSE_READ,
CLOSE_WRITE = QSE_AWK_RIO_CLOSE_WRITE
};
protected:
Pipe (Run* run, rio_arg_t* riod);
public:
/// The function returns the requested opening mode.
Mode getMode () const;
/// The getCloseMode() function returns the requested closing
/// mode. The returned value is valid if getMode() returns RW.
CloseMode getCloseMode () const;
};
/**

View File

@ -1,5 +1,5 @@
/*
* $Id: awk.h 271 2009-08-27 12:52:20Z hyunghwan.chung $
* $Id: awk.h 272 2009-08-28 09:48:02Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
@ -351,13 +351,13 @@ enum qse_awk_rio_mode_t
};
typedef enum qse_awk_rio_mode_t qse_awk_rio_mode_t;
enum qse_awk_rio_rwcopt_t
enum qse_awk_rio_rwcmode_t
{
QSE_AWK_RIO_CLOSE_A = 0,
QSE_AWK_RIO_CLOSE_R = 1,
QSE_AWK_RIO_CLOSE_W = 2
QSE_AWK_RIO_CLOSE_FULL = 0,
QSE_AWK_RIO_CLOSE_READ = 1,
QSE_AWK_RIO_CLOSE_WRITE = 2
};
typedef enum qse_awk_rio_rwcopt_t qse_awk_rio_rwcopt_t;
typedef enum qse_awk_rio_rwcmode_t qse_awk_rio_rwcmode_t;
/**
* The qse_awk_rio_arg_t defines the data structure passed to a runtime
@ -369,10 +369,10 @@ typedef enum qse_awk_rio_rwcopt_t qse_awk_rio_rwcopt_t;
typedef struct qse_awk_rio_arg_t qse_awk_rio_arg_t;
struct qse_awk_rio_arg_t
{
qse_awk_rio_mode_t mode; /**< [IN] I/O mode */
qse_char_t* name; /**< [IN] name of I/O object */
qse_awk_rio_rwcopt_t rwcopt; /**< [IN] closing option for rwpipe */
void* handle; /**< [OUT] I/O handle set by a handler */
qse_awk_rio_mode_t mode; /**< [IN] opening mode */
qse_char_t* name; /**< [IN] name of I/O object */
qse_awk_rio_rwcmode_t rwcmode; /**< [IN] closing mode for rwpipe */
void* handle; /**< [OUT] I/O handle set by a handler */
/*-- from here down, internal use only --*/
int type;