HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
UT_ReadPipe.h
Go to the documentation of this file.
1
/*
2
* PROPRIETARY INFORMATION. This software is proprietary to
3
* Side Effects Software Inc., and is not to be reproduced,
4
* transmitted, or disclosed in any way without written permission.
5
*
6
* NAME: UT_ReadPipe.h ( UT Library, C++)
7
*
8
* COMMENTS: This is a read pipe which gets around the problem of having a
9
* broken pipe if you close before reading all of the input from
10
* the pipe command.
11
*/
12
13
#ifndef __UT_ReadPipe__
14
#define __UT_ReadPipe__
15
16
#include "
UT_API.h
"
17
#include "
UT_NonCopyable.h
"
18
#include "
UT_SysClone.h
"
19
#include <stdio.h>
20
#include <sys/types.h>
21
22
class
UT_API
UT_ReadPipe
{
23
public
:
24
explicit
UT_ReadPipe
(
const
char
*cmd = 0);
25
26
// If the pipe is open and destructed, the process will be killed.
27
~
UT_ReadPipe
();
28
29
UT_NON_COPYABLE
(
UT_ReadPipe
)
30
31
FILE *
open
(
const
char
*cmd);
32
33
int
close
();
34
FILE *
getFilePtr
() {
return
myFilePtr; }
35
36
// Get the error for the pipe
37
int
getErrno
()
const
{
return
myErrno; }
38
39
// If close() succeeds, you can get the exit status of the child process by
40
// calling the following method.
41
int
getStatus
()
const
{
return
myExitStatus; }
42
43
// This method will return the child process id.
44
pid_t
getPid
()
const
{
return
myPid; }
45
46
private
:
47
FILE *myFilePtr;
48
int
myErrno;
49
int
myExitStatus;
50
pid_t myPid;
51
#ifdef WIN32
52
void
*myPipe;
53
void
*myHProcess;
54
#endif
55
};
56
57
#endif
58
UT_API.h
UT_API
#define UT_API
Definition:
UT_API.h:14
close
void close() override
UT_ReadPipe::getFilePtr
FILE * getFilePtr()
Definition:
UT_ReadPipe.h:34
UT_ReadPipe::getStatus
int getStatus() const
Definition:
UT_ReadPipe.h:41
open
int open(float queuesize) override
UT_NON_COPYABLE
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
Definition:
UT_NonCopyable.h:31
UT_NonCopyable.h
UT_ReadPipe
Definition:
UT_ReadPipe.h:22
UT_ReadPipe::getPid
pid_t getPid() const
Definition:
UT_ReadPipe.h:44
UT_ReadPipe::getErrno
int getErrno() const
Definition:
UT_ReadPipe.h:37
UT_SysClone.h
UT
UT_ReadPipe.h
Generated on Tue Dec 17 2024 03:42:15 for HDK by
1.8.6