MythTV
master
|
#include <ExternalStreamHandler.h>
Public Member Functions | |
ExternIO (const QString &app, const QStringList &args) | |
~ExternIO (void) | |
bool | Ready (int fd, std::chrono::milliseconds timeout, const QString &what) |
int | Read (QByteArray &buffer, int maxlen, std::chrono::milliseconds timeout=2500ms) |
QString | GetStatus (std::chrono::milliseconds timeout=2500ms) |
int | Write (const QByteArray &buffer) |
bool | Run (void) |
bool | Error (void) const |
QString | ErrorString (void) const |
void | ClearError (void) |
Static Public Member Functions | |
static 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_statusBuf |
QTextStream | m_status |
int | m_errCnt {0} |
Definition at line 28 of file ExternalStreamHandler.h.
|
private |
Enumerator | |
---|---|
kMaxErrorCnt |
Definition at line 30 of file ExternalStreamHandler.h.
ExternIO::ExternIO | ( | const QString & | app, |
const QStringList & | args | ||
) |
Definition at line 36 of file ExternalStreamHandler.cpp.
ExternIO::~ExternIO | ( | void | ) |
Definition at line 65 of file ExternalStreamHandler.cpp.
bool ExternIO::Ready | ( | int | fd, |
std::chrono::milliseconds | timeout, | ||
const QString & | what | ||
) |
Definition at line 75 of file ExternalStreamHandler.cpp.
Referenced by GetStatus(), and Read().
int ExternIO::Read | ( | QByteArray & | buffer, |
int | maxlen, | ||
std::chrono::milliseconds | timeout = 2500ms |
||
) |
Definition at line 109 of file ExternalStreamHandler.cpp.
Referenced by ExternalStreamHandler::PurgeBuffer(), and ExternalStreamHandler::run().
QString ExternIO::GetStatus | ( | std::chrono::milliseconds | timeout = 2500ms | ) |
Definition at line 170 of file ExternalStreamHandler.cpp.
Referenced by ExternalStreamHandler::CheckForError(), ExternalStreamHandler::ProcessVer1(), ExternalStreamHandler::ProcessVer2(), ExternalStreamHandler::PurgeBuffer(), and Run().
int ExternIO::Write | ( | const QByteArray & | buffer | ) |
Definition at line 199 of file ExternalStreamHandler.cpp.
Referenced by ExternalStreamHandler::ProcessVer1(), and ExternalStreamHandler::ProcessVer2().
bool ExternIO::Run | ( | void | ) |
Definition at line 232 of file ExternalStreamHandler.cpp.
Referenced by ExternalStreamHandler::OpenApp().
|
inline |
Definition at line 41 of file ExternalStreamHandler.h.
Referenced by ExternalStreamHandler::CheckForError(), Fork(), GetStatus(), ExternalStreamHandler::OpenApp(), ExternalStreamHandler::ProcessVer1(), ExternalStreamHandler::ProcessVer2(), Read(), ExternalStreamHandler::run(), and Write().
|
inline |
Definition at line 42 of file ExternalStreamHandler.h.
Referenced by ExternalStreamHandler::CheckForError(), ExternalStreamHandler::OpenApp(), ExternalStreamHandler::ProcessVer1(), ExternalStreamHandler::ProcessVer2(), and ExternalStreamHandler::run().
|
inline |
Definition at line 43 of file ExternalStreamHandler.h.
|
static |
Definition at line 243 of file ExternalStreamHandler.cpp.
Referenced by ExternalStreamHandler::CloseApp(), and Fork().
|
private |
Definition at line 295 of file ExternalStreamHandler.cpp.
Referenced by Run().
|
private |
Definition at line 50 of file ExternalStreamHandler.h.
Referenced by ExternIO(), and Fork().
|
private |
Definition at line 51 of file ExternalStreamHandler.h.
Referenced by ExternIO(), and Fork().
|
private |
Definition at line 52 of file ExternalStreamHandler.h.
Referenced by Fork(), Write(), and ~ExternIO().
|
private |
Definition at line 53 of file ExternalStreamHandler.h.
Referenced by Fork(), Read(), and ~ExternIO().
|
private |
Definition at line 54 of file ExternalStreamHandler.h.
Referenced by Fork(), GetStatus(), and ~ExternIO().
|
private |
Definition at line 55 of file ExternalStreamHandler.h.
Referenced by Fork().
|
private |
Definition at line 56 of file ExternalStreamHandler.h.
Referenced by ClearError(), Error(), ErrorString(), ExternIO(), Fork(), GetStatus(), Read(), Ready(), and Write().
|
private |
Definition at line 58 of file ExternalStreamHandler.h.
Referenced by Read().
|
private |
Definition at line 59 of file ExternalStreamHandler.h.
Referenced by Read(), and ~ExternIO().
|
private |
Definition at line 61 of file ExternalStreamHandler.h.
Referenced by ExternIO().
|
private |
Definition at line 62 of file ExternalStreamHandler.h.
Referenced by ExternIO(), and GetStatus().
|
private |
Definition at line 63 of file ExternalStreamHandler.h.
Referenced by Read().