Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
tests/ | H | 03-May-2022 | - | 261 | 234 | |
.clang-format | H A D | 29-Nov-2020 | 223 | 10 | 9 | |
.gitignore | H A D | 29-Nov-2020 | 643 | 51 | 42 | |
.gitlab-ci.yml | H A D | 29-Nov-2020 | 327 | 15 | 12 | |
LICENSE | H A D | 29-Nov-2020 | 1.1 KiB | 23 | 17 | |
README.md | H A D | 29-Nov-2020 | 2.2 KiB | 70 | 60 | |
examples.cpp | H A D | 29-Nov-2020 | 8.6 KiB | 235 | 189 | |
process.cpp | H A D | 29-Nov-2020 | 2.3 KiB | 56 | 46 | |
process.hpp | H A D | 29-Nov-2020 | 6.2 KiB | 170 | 128 | |
process_unix.cpp | H A D | 29-Nov-2020 | 9.9 KiB | 377 | 324 | |
process_win.cpp | H A D | 29-Nov-2020 | 10.1 KiB | 351 | 300 |
README.md
1# tiny-process-library 2A small platform independent library making it simple to create and stop new processes in C++, as well as writing to stdin and reading from stdout and stderr of a new process. 3 4This library was created for, and is used by the C++ IDE project [juCi++](https://gitlab.com/cppit/jucipp). 5 6### Features 7* No external dependencies 8* Simple to use 9* Platform independent 10 * Creating processes using executables is supported on all platforms 11 * Creating processes using functions is only possible on Unix-like systems 12* Read separately from stdout and stderr using anonymous functions 13* Write to stdin 14* Kill a running process (SIGTERM is supported on Unix-like systems) 15* Correctly closes file descriptors/handles 16 17### Usage 18See [examples.cpp](examples.cpp). 19 20### Get, compile and run 21 22#### Unix-like systems 23```sh 24git clone http://gitlab.com/eidheim/tiny-process-library 25cd tiny-process-library 26mkdir build 27cd build 28cmake .. 29make 30./examples 31``` 32 33#### Windows with MSYS2 (https://msys2.github.io/) 34```sh 35git clone http://gitlab.com/eidheim/tiny-process-library 36cd tiny-process-library 37mkdir build 38cd build 39cmake -G"MSYS Makefiles" .. 40make 41./examples 42``` 43 44### Coding style 45Due to poor lambda support in clang-format, a custom clang-format is used with the following patch applied: 46```diff 47diff --git a/lib/Format/ContinuationIndenter.cpp b/lib/Format/ContinuationIndenter.cpp 48index bb8efd61a3..e80a487055 100644 49--- a/lib/Format/ContinuationIndenter.cpp 50+++ b/lib/Format/ContinuationIndenter.cpp 51@@ -276,6 +276,8 @@ LineState ContinuationIndenter::getInitialState(unsigned FirstIndent, 52 } 53 54 bool ContinuationIndenter::canBreak(const LineState &State) { 55+ if(Style.ColumnLimit==0) 56+ return true; 57 const FormatToken &Current = *State.NextToken; 58 const FormatToken &Previous = *Current.Previous; 59 assert(&Previous == Current.Previous); 60@@ -325,6 +327,8 @@ bool ContinuationIndenter::canBreak(const LineState &State) { 61 } 62 63 bool ContinuationIndenter::mustBreak(const LineState &State) { 64+ if(Style.ColumnLimit==0) 65+ return false; 66 const FormatToken &Current = *State.NextToken; 67 const FormatToken &Previous = *Current.Previous; 68 if (Current.MustBreakBefore || Current.is(TT_InlineASMColon)) 69``` 70