TpProcess 类
V0.2.1TpUtils
2025-11-14
基础信息
| 头文件: | include <TpProcess.h> |
|---|---|
| Cmake: | None |
| 发布版本: | V0.2.1 |
| 继承类: | |
| 派生类: |
Public 类型
enum TpProcess::ProcessState
| 名称 | 值 | 描述 |
|---|---|---|
| NotRunning | 0 | |
| Starting | 1 | |
| Running | 2 |
Public 成员函数
| TpProcess() | ||
|---|---|---|
| ~TpProcess() | ||
| start(const TpString &program, const TpVector< TpString > &arguments) | 启动一个进程 | |
| start(const TpString &command) | 启动一个进程 | |
| ProcessState | state() const | 获取启动进程当前状态 |
| waitForFinished(int msecs=30000) | ||
| waitForStarted(int msecs=30000) | ||
| launchProcessID() | 获取启动进程ID | |
| lauanchProcessPID() | 获取启动进程PID | |
| virtual TpString | launchProcessName() | 获取启动进程名称 |
成员函数说明
TpProcess::TpProcess()
暂无注释...
TpProcess::~TpProcess()
暂无注释...
void TpProcess::start(const TpString &program, const TpVector< TpString > &arguments)
启动一个进程...
启动一个进程
参数:program: 进程文件所在全路径
参数:arguments: 进程传入参数,可为空
void TpProcess::start(const TpString &command)
启动一个进程...
启动一个进程
参数:command: 启动进程cmd命令
ProcessState TpProcess::state() const
获取启动进程当前状态...
获取启动进程当前状态
返回值:状态枚举
bool TpProcess::waitForFinished(int msecs=30000)
暂无注释...
bool TpProcess::waitForStarted(int msecs=30000)
暂无注释...
virtual int32_t TpProcess::launchProcessID()
获取启动进程ID...
获取启动进程ID
返回值:进程ID,如果进程为空返回-1
virtual pid_t TpProcess::lauanchProcessPID()
获取启动进程PID...
获取启动进程PID
返回值:进程PID,如果进程为空返回-1
virtual TpString TpProcess::launchProcessName()
获取启动进程名称...
获取启动进程名称
返回值:进程名称
