MythTV  master
Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
MythSystemLegacy Class Reference

#include <mythsystemlegacy.h>

Inheritance diagram for MythSystemLegacy:
Inheritance graph
[legend]
Collaboration diagram for MythSystemLegacy:
Collaboration graph
[legend]

Signals

void started (void)
 
void finished (void)
 
void error (uint status)
 
void readDataReady (int fd)
 

Public Member Functions

 MythSystemLegacy (QObject *parent=nullptr)
 
 MythSystemLegacy (const QString &command, uint flags, QObject *parent=nullptr)
 
 MythSystemLegacy (const QString &command, const QStringList &args, uint flags, QObject *parent=nullptr)
 
 ~MythSystemLegacy (void) override
 
void SetCommand (const QString &command, uint flags)
 Resets an existing MythSystemLegacy object to a new command. More...
 
void SetCommand (const QString &command, const QStringList &args, uint flags)
 Resets an existing MythSystemLegacy object to a new command. More...
 
void SetDirectory (const QString &directory)
 
bool SetNice (int nice)
 
bool SetIOPrio (int prio)
 
void Run (std::chrono::seconds timeout=0s)
 Runs a command inside the /bin/sh shell. Returns immediately. More...
 
uint Wait (std::chrono::seconds timeout=0s)
 
int Write (const QByteArray &ba)
 This writes to the standard input of the program being run. More...
 
QByteArray Read (int size)
 
QByteArray ReadErr (int size)
 
QByteArray & ReadAll ()
 
QByteArray & ReadAllErr ()
 
void Term (bool force=false)
 
void Signal (MythSignal sig)
 
bool isBackground (void)
 
bool doAutoCleanup (void)
 
bool onlyLowExitVal (void)
 
void HandlePreRun (void)
 
void HandlePostRun (void)
 
uint GetStatus (void) const
 
void SetStatus (uint status)
 
QString & GetLogCmd (void)
 
QString & GetDirectory (void)
 
bool GetSetting (const char *setting)
 
QString & GetCommand (void)
 
void SetCommand (const QString &cmd)
 
QStringList & GetArgs (void)
 
void SetArgs (const QStringList &args)
 
int GetNice (void) const
 
int GetIOPrio (void) const
 
QBuffer * GetBuffer (int index)
 
void Unlock (void)
 

Static Public Member Functions

static QString ShellEscape (const QString &in)
 

Protected Member Functions

void ProcessFlags (uint flags)
 

Protected Attributes

uint m_status {GENERIC_EXIT_OK}
 
QSemaphore m_semReady
 
QString m_command
 
QString m_logcmd
 
QStringList m_args
 
QString m_directory
 
int m_nice {0}
 
int m_ioprio {0}
 
Setting m_settings
 
std::array< QBuffer, 3 > m_stdbuff
 

Private Member Functions

void initializePrivate (void)
 

Private Attributes

MythSystemLegacyPrivated {nullptr}
 

Friends

class MythSystemLegacyPrivate
 

Detailed Description

Definition at line 67 of file mythsystemlegacy.h.

Constructor & Destructor Documentation

◆ MythSystemLegacy() [1/3]

MythSystemLegacy::MythSystemLegacy ( QObject *  parent = nullptr)
explicit

Definition at line 67 of file mythsystemlegacy.cpp.

◆ MythSystemLegacy() [2/3]

MythSystemLegacy::MythSystemLegacy ( const QString &  command,
uint  flags,
QObject *  parent = nullptr 
)

Definition at line 75 of file mythsystemlegacy.cpp.

◆ MythSystemLegacy() [3/3]

MythSystemLegacy::MythSystemLegacy ( const QString &  command,
const QStringList &  args,
uint  flags,
QObject *  parent = nullptr 
)

Definition at line 119 of file mythsystemlegacy.cpp.

◆ ~MythSystemLegacy()

MythSystemLegacy::~MythSystemLegacy ( void  )
override

Definition at line 178 of file mythsystemlegacy.cpp.

Member Function Documentation

◆ SetCommand() [1/3]

void MythSystemLegacy::SetCommand ( const QString &  command,
uint  flags 
)

Resets an existing MythSystemLegacy object to a new command.

Definition at line 88 of file mythsystemlegacy.cpp.

Referenced by Search::executeSearch(), and MythSystemLegacy().

◆ SetCommand() [2/3]

void MythSystemLegacy::SetCommand ( const QString &  command,
const QStringList &  args,
uint  flags 
)

Resets an existing MythSystemLegacy object to a new command.

Definition at line 133 of file mythsystemlegacy.cpp.

◆ SetDirectory()

void MythSystemLegacy::SetDirectory ( const QString &  directory)

◆ SetNice()

bool MythSystemLegacy::SetNice ( int  nice)

Definition at line 194 of file mythsystemlegacy.cpp.

Referenced by ThumbThread< ImageDbSg >::CreateThumbnail().

◆ SetIOPrio()

bool MythSystemLegacy::SetIOPrio ( int  prio)

Definition at line 203 of file mythsystemlegacy.cpp.

Referenced by ThumbThread< ImageDbSg >::CreateThumbnail().

◆ Run()

void MythSystemLegacy::Run ( std::chrono::seconds  timeout = 0s)

◆ Wait()

uint MythSystemLegacy::Wait ( std::chrono::seconds  timeout = 0s)

◆ Write()

int MythSystemLegacy::Write ( const QByteArray &  ba)

This writes to the standard input of the program being run.

All calls to this must be done before Run() is called. All calls after Run() is called are silently ignored.

Definition at line 416 of file mythsystemlegacy.cpp.

◆ Read()

QByteArray MythSystemLegacy::Read ( int  size)

Definition at line 392 of file mythsystemlegacy.cpp.

◆ ReadErr()

QByteArray MythSystemLegacy::ReadErr ( int  size)

Definition at line 397 of file mythsystemlegacy.cpp.

◆ ReadAll()

QByteArray & MythSystemLegacy::ReadAll ( )

◆ ReadAllErr()

QByteArray & MythSystemLegacy::ReadAllErr ( )

Definition at line 407 of file mythsystemlegacy.cpp.

Referenced by MediaMonitorUnix::GetDeviceFile(), and FillData::GrabData().

◆ Term()

void MythSystemLegacy::Term ( bool  force = false)

◆ Signal()

void MythSystemLegacy::Signal ( MythSignal  sig)

Definition at line 296 of file mythsystemlegacy.cpp.

Referenced by WeatherSource::~WeatherSource().

◆ isBackground()

bool MythSystemLegacy::isBackground ( void  )
inline

Definition at line 108 of file mythsystemlegacy.h.

◆ doAutoCleanup()

bool MythSystemLegacy::doAutoCleanup ( void  )
inline

Definition at line 110 of file mythsystemlegacy.h.

◆ onlyLowExitVal()

bool MythSystemLegacy::onlyLowExitVal ( void  )
inline

Definition at line 113 of file mythsystemlegacy.h.

◆ HandlePreRun()

void MythSystemLegacy::HandlePreRun ( void  )

Definition at line 424 of file mythsystemlegacy.cpp.

Referenced by Run().

◆ HandlePostRun()

void MythSystemLegacy::HandlePostRun ( void  )

Definition at line 455 of file mythsystemlegacy.cpp.

◆ GetStatus()

uint MythSystemLegacy::GetStatus ( void  ) const
inline

◆ SetStatus()

void MythSystemLegacy::SetStatus ( uint  status)
inline

Definition at line 124 of file mythsystemlegacy.h.

◆ GetLogCmd()

QString& MythSystemLegacy::GetLogCmd ( void  )
inline

Definition at line 128 of file mythsystemlegacy.h.

◆ GetDirectory()

QString& MythSystemLegacy::GetDirectory ( void  )
inline

Definition at line 130 of file mythsystemlegacy.h.

◆ GetSetting()

bool MythSystemLegacy::GetSetting ( const char *  setting)
inline

Definition at line 134 of file mythsystemlegacy.h.

Referenced by HandlePostRun(), HandlePreRun(), ProcessFlags(), SetCommand(), Wait(), and Write().

◆ GetCommand()

QString& MythSystemLegacy::GetCommand ( void  )
inline

Definition at line 138 of file mythsystemlegacy.h.

◆ SetCommand() [3/3]

void MythSystemLegacy::SetCommand ( const QString &  cmd)
inline

Definition at line 141 of file mythsystemlegacy.h.

◆ GetArgs()

QStringList& MythSystemLegacy::GetArgs ( void  )
inline

Definition at line 145 of file mythsystemlegacy.h.

◆ SetArgs()

void MythSystemLegacy::SetArgs ( const QStringList &  args)
inline

Definition at line 148 of file mythsystemlegacy.h.

◆ GetNice()

int MythSystemLegacy::GetNice ( void  ) const
inline

Definition at line 150 of file mythsystemlegacy.h.

◆ GetIOPrio()

int MythSystemLegacy::GetIOPrio ( void  ) const
inline

Definition at line 151 of file mythsystemlegacy.h.

◆ GetBuffer()

QBuffer* MythSystemLegacy::GetBuffer ( int  index)
inline

Definition at line 154 of file mythsystemlegacy.h.

◆ Unlock()

void MythSystemLegacy::Unlock ( void  )
inline

Definition at line 157 of file mythsystemlegacy.h.

◆ ShellEscape()

QString MythSystemLegacy::ShellEscape ( const QString &  in)
static

Definition at line 482 of file mythsystemlegacy.cpp.

Referenced by Search::executeSearch().

◆ started

void MythSystemLegacy::started ( void  )
signal

◆ finished

void MythSystemLegacy::finished ( void  )
signal

◆ error

void MythSystemLegacy::error ( uint  status)
signal

◆ readDataReady

void MythSystemLegacy::readDataReady ( int  fd)
signal

◆ initializePrivate()

void MythSystemLegacy::initializePrivate ( void  )
private

Definition at line 58 of file mythsystemlegacy.cpp.

Referenced by MythSystemLegacy().

◆ ProcessFlags()

void MythSystemLegacy::ProcessFlags ( uint  flags)
protected

Definition at line 339 of file mythsystemlegacy.cpp.

Referenced by SetCommand().

Friends And Related Function Documentation

◆ MythSystemLegacyPrivate

friend class MythSystemLegacyPrivate
friend

Definition at line 159 of file mythsystemlegacy.h.

Member Data Documentation

◆ d

MythSystemLegacyPrivate* MythSystemLegacy::d {nullptr}
private

◆ m_status

uint MythSystemLegacy::m_status {GENERIC_EXIT_OK}
protected

Definition at line 182 of file mythsystemlegacy.h.

Referenced by ProcessFlags(), Run(), SetCommand(), Signal(), Term(), and Wait().

◆ m_semReady

QSemaphore MythSystemLegacy::m_semReady
protected

Definition at line 183 of file mythsystemlegacy.h.

Referenced by MythSystemLegacy(), Run(), and Wait().

◆ m_command

QString MythSystemLegacy::m_command
protected

Definition at line 185 of file mythsystemlegacy.h.

Referenced by ProcessFlags(), and SetCommand().

◆ m_logcmd

QString MythSystemLegacy::m_logcmd
protected

Definition at line 186 of file mythsystemlegacy.h.

Referenced by SetCommand().

◆ m_args

QStringList MythSystemLegacy::m_args
protected

Definition at line 187 of file mythsystemlegacy.h.

Referenced by SetCommand().

◆ m_directory

QString MythSystemLegacy::m_directory
protected

Definition at line 188 of file mythsystemlegacy.h.

Referenced by SetDirectory().

◆ m_nice

int MythSystemLegacy::m_nice {0}
protected

Definition at line 190 of file mythsystemlegacy.h.

Referenced by SetNice().

◆ m_ioprio

int MythSystemLegacy::m_ioprio {0}
protected

Definition at line 191 of file mythsystemlegacy.h.

Referenced by SetIOPrio().

◆ m_settings

Setting MythSystemLegacy::m_settings
protected

Definition at line 193 of file mythsystemlegacy.h.

Referenced by ProcessFlags(), SetCommand(), and SetDirectory().

◆ m_stdbuff

std::array<QBuffer,3> MythSystemLegacy::m_stdbuff
protected

Definition at line 194 of file mythsystemlegacy.h.

Referenced by Read(), ReadAll(), ReadAllErr(), ReadErr(), SetCommand(), and Write().


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