MythTV  master
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ExternIO Class Reference

#include <ExternalStreamHandler.h>

Public Member Functions

 ExternIO (const QString &app, const QStringList &args)
 
 ~ExternIO (void)
 
bool Ready (int fd, int timeout, const QString &what)
 
int Read (QByteArray &buffer, int maxlen, int timeout=2500)
 
QString GetStatus (int timeout=2500)
 
int Write (const QByteArray &buffer)
 
bool Run (void)
 
bool Error (void) const
 
QString ErrorString (void) const
 
void ClearError (void)
 
bool KillIfRunning (const QString &cmd)
 

Private Types

enum  constants { kMaxErrorCnt = 20 }
 

Private Member Functions

void Fork (void)
 

Private Attributes

QFileInfo m_app
 
QStringList m_args
 
int m_appin {-1}
 
int m_appout {-1}
 
int m_apperr {-1}
 
pid_t m_pid {-1}
 
QString m_error
 
int m_bufsize {0}
 
char * m_buffer {nullptr}
 
QString m_status_buf
 
QTextStream m_status
 
int m_errcnt {0}
 

Detailed Description

Definition at line 20 of file ExternalStreamHandler.h.

Member Enumeration Documentation

◆ constants

enum ExternIO::constants
private
Enumerator
kMaxErrorCnt 

Definition at line 22 of file ExternalStreamHandler.h.

Constructor & Destructor Documentation

◆ ExternIO()

ExternIO::ExternIO ( const QString &  app,
const QStringList &  args 
)

Definition at line 33 of file ExternalStreamHandler.cpp.

◆ ~ExternIO()

ExternIO::~ExternIO ( void  )

Definition at line 63 of file ExternalStreamHandler.cpp.

Member Function Documentation

◆ Ready()

bool ExternIO::Ready ( int  fd,
int  timeout,
const QString &  what 
)

Definition at line 73 of file ExternalStreamHandler.cpp.

Referenced by GetStatus(), and Read().

◆ Read()

int ExternIO::Read ( QByteArray &  buffer,
int  maxlen,
int  timeout = 2500 
)

◆ GetStatus()

QString ExternIO::GetStatus ( int  timeout = 2500)

◆ Write()

int ExternIO::Write ( const QByteArray &  buffer)

◆ Run()

bool ExternIO::Run ( void  )

Definition at line 229 of file ExternalStreamHandler.cpp.

Referenced by ExternalStreamHandler::OpenApp().

◆ Error()

bool ExternIO::Error ( void  ) const
inline

◆ ErrorString()

QString ExternIO::ErrorString ( void  ) const
inline

◆ ClearError()

void ExternIO::ClearError ( void  )
inline

Definition at line 35 of file ExternalStreamHandler.h.

◆ KillIfRunning()

bool ExternIO::KillIfRunning ( const QString &  cmd)

Definition at line 240 of file ExternalStreamHandler.cpp.

Referenced by ExternalStreamHandler::CloseApp(), and Fork().

◆ Fork()

void ExternIO::Fork ( void  )
private

Definition at line 296 of file ExternalStreamHandler.cpp.

Referenced by Run().

Member Data Documentation

◆ m_app

QFileInfo ExternIO::m_app
private

Definition at line 42 of file ExternalStreamHandler.h.

Referenced by ExternIO(), and Fork().

◆ m_args

QStringList ExternIO::m_args
private

Definition at line 43 of file ExternalStreamHandler.h.

Referenced by ExternIO(), and Fork().

◆ m_appin

int ExternIO::m_appin {-1}
private

Definition at line 44 of file ExternalStreamHandler.h.

Referenced by Fork(), Write(), and ~ExternIO().

◆ m_appout

int ExternIO::m_appout {-1}
private

Definition at line 45 of file ExternalStreamHandler.h.

Referenced by Fork(), Read(), and ~ExternIO().

◆ m_apperr

int ExternIO::m_apperr {-1}
private

Definition at line 46 of file ExternalStreamHandler.h.

Referenced by Fork(), GetStatus(), and ~ExternIO().

◆ m_pid

pid_t ExternIO::m_pid {-1}
private

Definition at line 47 of file ExternalStreamHandler.h.

Referenced by Fork().

◆ m_error

QString ExternIO::m_error
private

Definition at line 48 of file ExternalStreamHandler.h.

Referenced by ExternIO(), Fork(), GetStatus(), Read(), Ready(), and Write().

◆ m_bufsize

int ExternIO::m_bufsize {0}
private

Definition at line 50 of file ExternalStreamHandler.h.

Referenced by Read().

◆ m_buffer

char* ExternIO::m_buffer {nullptr}
private

Definition at line 51 of file ExternalStreamHandler.h.

Referenced by Read(), and ~ExternIO().

◆ m_status_buf

QString ExternIO::m_status_buf
private

Definition at line 53 of file ExternalStreamHandler.h.

Referenced by ExternIO().

◆ m_status

QTextStream ExternIO::m_status
private

Definition at line 54 of file ExternalStreamHandler.h.

Referenced by ExternIO(), and GetStatus().

◆ m_errcnt

int ExternIO::m_errcnt {0}
private

Definition at line 55 of file ExternalStreamHandler.h.

Referenced by Read().


The documentation for this class was generated from the following files: