An open API service indexing awesome lists of open source software.

https://github.com/udovin/wilcotcpp

A C++ library that helps in developing Linux applications.
https://github.com/udovin/wilcotcpp

linux-namespaces option-parser

Last synced: 11 months ago
JSON representation

A C++ library that helps in developing Linux applications.

Awesome Lists containing this project

README

          

# Wilcot Cpp

Wilcot Cpp — a C++ library that helps in developing Linux applications.

## What's supported?

* Process creation;
* Linux container creation;
* Convenient testing utils;
* Convenient working with filesystem;
* Convenient working with console;
* Streams and ring buffer.

## Examples

### Options parsing

```cpp
// Create new option parser
wilcot::cli::OptionParser parser;
// Create arguments for options
wilcot::cli::ValueOption inputFile("--input");
wilcot::cli::ValueOption outputFile("--output");
// Add options to option parser
parser.addOption(inputFile.setArgument("path"));
parser.addOption(outputFile.setArgument("path"));
// Parse arguments passed to main
parser.parse(argc, argv);
```

### Process creation

```cpp
// Create new process instance
wilcot::os::Process process;
// Create an array for arguments
std::vector arguments;
arguments.push_back("/bin/bash");
// Set path to program and execute arguments
process.setProgram("/bin/bash");
process.setArguments(arguments);
// Start process
process.start();
// Wait for process exit
process.wait();
```