Console Library 8.0.0
A header-only library that makes C++ simple
Loading...
Searching...
No Matches
syscmd.h File Reference

跨平台系统命令执行模块。 More...

#include <array>
#include <cstdlib>
#include <map>
#include <memory>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

class  console::CmdResult
 命令执行结果封装类。 More...

Namespaces

namespace  console
 本库所有组件所在的顶层命名空间。

Macros

#define POPEN   popen
#define PCLOSE   pclose

Functions

CmdResult console::syscmd (const std::string &exe, const std::vector< std::string > &args={}, const std::map< std::string, std::string > &kwargs={})
 执行系统命令并捕获输出。

Detailed Description

跨平台系统命令执行模块。

封装 popen/_popen 函数,支持命令行参数和关键字参数,自动合并 stderr 到 stdout。

Author
MrXie1109
Date
2026

Macro Definition Documentation

◆ PCLOSE

#define PCLOSE   pclose

◆ POPEN

#define POPEN   popen