Gaudi Framework, version v22r0

Home   Generated: 9 Feb 2011

PipeReader Class Reference

Collaboration diagram for PipeReader:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PipeReader (const char *cmd)
 ~PipeReader (void)
std::istringstreamoutput (void)

Private Attributes

FILE * pipe
std::istringstreamiss

Detailed Description

Definition at line 88 of file pfm_gen_analysis.cpp.


Constructor & Destructor Documentation

PipeReader::PipeReader ( const char *  cmd  )  [inline]

Definition at line 91 of file pfm_gen_analysis.cpp.

00092   {
00093    pipe = popen(cmd, "r");
00094    if(!pipe)
00095    {
00096     printf("Cannot open pipe. Exiting...\n");
00097     exit(1);
00098    }
00099    char buffer[PIPE_BUFFER_LENGTH];
00100    bzero(buffer, PIPE_BUFFER_LENGTH);
00101    std::string result = "";
00102    while(!feof(pipe))
00103    {
00104     if(fgets(buffer, PIPE_BUFFER_LENGTH, pipe)!=NULL)
00105     {
00106      result += buffer;
00107     }
00108     bzero(buffer, PIPE_BUFFER_LENGTH);
00109    }
00110    iss = new std::istringstream(result, std::istringstream::in);
00111   }

PipeReader::~PipeReader ( void   )  [inline]

Definition at line 113 of file pfm_gen_analysis.cpp.

00114   {
00115    pclose(pipe);
00116    delete iss;
00117   }


Member Function Documentation

std::istringstream& PipeReader::output ( void   )  [inline]

Definition at line 119 of file pfm_gen_analysis.cpp.

00120   {
00121    return *iss;
00122   }


Member Data Documentation

Definition at line 125 of file pfm_gen_analysis.cpp.

FILE* PipeReader::pipe [private]

Definition at line 124 of file pfm_gen_analysis.cpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Wed Feb 9 16:31:32 2011 for Gaudi Framework, version v22r0 by Doxygen version 1.6.2 written by Dimitri van Heesch, © 1997-2004