Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
main.cpp File Reference

(34178100a3cf97a8875c200bc0500cbdd97bb8b7)

#include <QtCore/qcoreapplication.h>
#include <QtCore/qcommandlineparser.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qfileinfo.h>
#include <QtCore/qprocess.h>
#include <QtCore/qthread.h>
#include <QtCore/qelapsedtimer.h>
#include <atomic>
#include <csignal>
#include <cstdio>
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

static QString runHdc (const QString &hdcPath, const QStringList &args, bool printOnFailure=false)
static void sigHandler (int sig)
static bool isProcessAlive (const QString &hdc, const QString &bundleName)
static void waitForProcessDeath (const QString &hdc, const QString &bundleName, int timeoutSecs=15)
static bool waitForProcessStart (const QString &hdc, const QString &bundleName, const QString &shellExitCodePath, int timeoutSecs=30)
static bool waitForStdoutFile (const QString &hdc, const QString &shellStdoutPath, int timeoutSecs=10)
static bool setupStdoutLogger (QProcess &stdoutLogger, const QString &hdc, const QString &shellStdoutPath)
int main (int argc, char *argv[])

Variables

static constexpr int EXIT_ERROR = 254
static constexpr int EXIT_NOEXITCODE = 253
static constexpr int EXIT_CRASH = 252
static constexpr int EXIT_TIMEOUT = 251
static QString g_hdcConnectKey
static std::atomic< bool > g_interrupted { false }

Function Documentation

◆ isProcessAlive()

bool isProcessAlive ( const QString & hdc,
const QString & bundleName )
static

Definition at line 121 of file main.cpp.

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 205 of file main.cpp.

References EXIT_CRASH, EXIT_ERROR, EXIT_NOEXITCODE, EXIT_TIMEOUT, g_hdcConnectKey, g_interrupted, and sigHandler().

Here is the call graph for this function:

◆ runHdc()

QString runHdc ( const QString & hdcPath,
const QStringList & args,
bool printOnFailure = false )
static

Definition at line 36 of file main.cpp.

◆ setupStdoutLogger()

bool setupStdoutLogger ( QProcess & stdoutLogger,
const QString & hdc,
const QString & shellStdoutPath )
static

Definition at line 184 of file main.cpp.

◆ sigHandler()

void sigHandler ( int sig)
static

Definition at line 110 of file main.cpp.

References g_interrupted.

Referenced by main().

Here is the caller graph for this function:

◆ waitForProcessDeath()

void waitForProcessDeath ( const QString & hdc,
const QString & bundleName,
int timeoutSecs = 15 )
static

Definition at line 128 of file main.cpp.

References g_interrupted.

◆ waitForProcessStart()

bool waitForProcessStart ( const QString & hdc,
const QString & bundleName,
const QString & shellExitCodePath,
int timeoutSecs = 30 )
static

Definition at line 144 of file main.cpp.

References g_interrupted.

◆ waitForStdoutFile()

bool waitForStdoutFile ( const QString & hdc,
const QString & shellStdoutPath,
int timeoutSecs = 10 )
static

Definition at line 165 of file main.cpp.

References g_interrupted.

Variable Documentation

◆ EXIT_CRASH

constexpr int EXIT_CRASH = 252
staticconstexpr

Definition at line 30 of file main.cpp.

Referenced by main().

◆ EXIT_ERROR

constexpr int EXIT_ERROR = 254
staticconstexpr

Definition at line 28 of file main.cpp.

◆ EXIT_NOEXITCODE

constexpr int EXIT_NOEXITCODE = 253
staticconstexpr

Definition at line 29 of file main.cpp.

◆ EXIT_TIMEOUT

constexpr int EXIT_TIMEOUT = 251
staticconstexpr

Definition at line 31 of file main.cpp.

Referenced by main().

◆ g_hdcConnectKey

QString g_hdcConnectKey
static

Definition at line 34 of file main.cpp.

Referenced by main().

◆ g_interrupted

std::atomic< bool > g_interrupted { false }
static