|
MythTV master
|
#include <libmythtv/recorders/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) |
| QByteArray | 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 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} |
Static Private Attributes | |
| static constexpr uint8_t | kMaxErrorCnt { 20 } |
Definition at line 29 of file ExternalStreamHandler.h.
| ExternIO::ExternIO | ( | const QString & | app, |
| const QStringList & | args | ||
| ) |
Definition at line 41 of file ExternalStreamHandler.cpp.
| ExternIO::~ExternIO | ( | void | ) |
Definition at line 70 of file ExternalStreamHandler.cpp.
|
inline |
Definition at line 44 of file ExternalStreamHandler.h.
|
inline |
Definition at line 42 of file ExternalStreamHandler.h.
Referenced by ExternalStreamHandler::CheckForError(), Fork(), GetStatus(), ExternalStreamHandler::OpenApp(), ExternalStreamHandler::ProcessJson(), ExternalStreamHandler::ProcessVer1(), ExternalStreamHandler::ProcessVer2(), Read(), ExternalStreamHandler::run(), and Write().
|
inline |
Definition at line 43 of file ExternalStreamHandler.h.
Referenced by ExternalStreamHandler::CheckForError(), ExternalStreamHandler::OpenApp(), ExternalStreamHandler::ProcessJson(), ExternalStreamHandler::ProcessVer1(), ExternalStreamHandler::ProcessVer2(), and ExternalStreamHandler::run().
|
private |
Definition at line 300 of file ExternalStreamHandler.cpp.
Referenced by Run().
| QByteArray ExternIO::GetStatus | ( | std::chrono::milliseconds | timeout = 2500ms | ) |
Definition at line 177 of file ExternalStreamHandler.cpp.
Referenced by ExternalStreamHandler::CheckForError(), ExternalStreamHandler::ProcessJson(), ExternalStreamHandler::ProcessVer1(), ExternalStreamHandler::ProcessVer2(), ExternalStreamHandler::PurgeBuffer(), and Run().
|
static |
Definition at line 250 of file ExternalStreamHandler.cpp.
Referenced by ExternalStreamHandler::CloseApp(), and Fork().
| int ExternIO::Read | ( | QByteArray & | buffer, |
| int | maxlen, | ||
| std::chrono::milliseconds | timeout = 2500ms |
||
| ) |
Definition at line 114 of file ExternalStreamHandler.cpp.
Referenced by ExternalStreamHandler::PurgeBuffer(), and ExternalStreamHandler::run().
| bool ExternIO::Ready | ( | int | fd, |
| std::chrono::milliseconds | timeout, | ||
| const QString & | what | ||
| ) |
Definition at line 80 of file ExternalStreamHandler.cpp.
Referenced by GetStatus(), and Read().
| bool ExternIO::Run | ( | void | ) |
Definition at line 239 of file ExternalStreamHandler.cpp.
Referenced by ExternalStreamHandler::OpenApp().
| int ExternIO::Write | ( | const QByteArray & | buffer | ) |
Definition at line 206 of file ExternalStreamHandler.cpp.
Referenced by ExternalStreamHandler::ProcessJson(), ExternalStreamHandler::ProcessVer1(), and ExternalStreamHandler::ProcessVer2().
|
staticconstexprprivate |
Definition at line 31 of file ExternalStreamHandler.h.
Referenced by Read().
|
private |
Definition at line 51 of file ExternalStreamHandler.h.
Referenced by ExternIO(), and Fork().
|
private |
Definition at line 55 of file ExternalStreamHandler.h.
Referenced by Fork(), GetStatus(), and ~ExternIO().
|
private |
Definition at line 53 of file ExternalStreamHandler.h.
Referenced by Fork(), Write(), and ~ExternIO().
|
private |
Definition at line 54 of file ExternalStreamHandler.h.
Referenced by Fork(), Read(), and ~ExternIO().
|
private |
Definition at line 52 of file ExternalStreamHandler.h.
Referenced by ExternIO(), and Fork().
|
private |
Definition at line 60 of file ExternalStreamHandler.h.
Referenced by Read(), and ~ExternIO().
|
private |
Definition at line 59 of file ExternalStreamHandler.h.
Referenced by Read().
|
private |
Definition at line 64 of file ExternalStreamHandler.h.
Referenced by Read().
|
private |
Definition at line 57 of file ExternalStreamHandler.h.
Referenced by ClearError(), Error(), ErrorString(), ExternIO(), Fork(), GetStatus(), Read(), Ready(), and Write().
|
private |
Definition at line 56 of file ExternalStreamHandler.h.
Referenced by Fork().
|
private |
Definition at line 63 of file ExternalStreamHandler.h.
Referenced by ExternIO(), and GetStatus().
|
private |
Definition at line 62 of file ExternalStreamHandler.h.
Referenced by ExternIO().