All Projects → Alairion → not-enough-standards

Alairion / not-enough-standards

Licence: MIT license
A modern header-only C++ library that provides platform-independent utilities.

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to not-enough-standards

bash-streams-handbook
💻 Learn Bash streams, pipelines and redirection, from beginner to advanced.
Stars: ✭ 153 (-22.34%)
Mutual labels:  named-pipes, pipes
thread-pool
A modern thread pool implementation based on C++20
Stars: ✭ 104 (-47.21%)
Mutual labels:  thread-pool, cpp20
jobflow
runs stuff in parallel (like GNU parallel, but much faster and memory-efficient)
Stars: ✭ 67 (-65.99%)
Mutual labels:  process, pipes
programming-with-cpp20
Companion source code for "Programming with C++20 - Concepts, Coroutines, Ranges, and more"
Stars: ✭ 142 (-27.92%)
Mutual labels:  cpp20
mango
Core utility library & data connectors designed for simpler usage in Scala
Stars: ✭ 41 (-79.19%)
Mutual labels:  utility-library
apecs
A petite entity component system
Stars: ✭ 17 (-91.37%)
Mutual labels:  cpp20
labeledpipe
Lazypipe with labels.
Stars: ✭ 15 (-92.39%)
Mutual labels:  pipes
banana
🍌 Modern C++ Telegram Bot API library
Stars: ✭ 30 (-84.77%)
Mutual labels:  cpp20
pipes
Elixir–style pipes for Python
Stars: ✭ 51 (-74.11%)
Mutual labels:  pipes
Hypr
Hypr is a tiling window manager written in modern C++.
Stars: ✭ 659 (+234.52%)
Mutual labels:  cpp20
HULK-v3
Asynchronous HTTP Botnet for Distributed Denial of Service (DDoS)
Stars: ✭ 152 (-22.84%)
Mutual labels:  named-pipes
Biblioteca-DDR-Java
Funciones java con utilidades para distintos proyectos
Stars: ✭ 19 (-90.36%)
Mutual labels:  utility-library
go-lock
go-lock is a lock library implementing read-write mutex and read-write trylock without starvation
Stars: ✭ 78 (-60.41%)
Mutual labels:  mutex
leek
Distributed task redisqueue(最简单python分布式函数调度框架)
Stars: ✭ 60 (-69.54%)
Mutual labels:  thread-pool
Jenkins-Pipeline-Utils
Global Jenkins Pipeline Library with common utilities.
Stars: ✭ 36 (-81.73%)
Mutual labels:  shared-library
cxx
🔌 Configuration-free utility for building, testing and packaging executables written in C++. Can auto-detect compilation flags based on includes, via the package system and pkg-config.
Stars: ✭ 87 (-55.84%)
Mutual labels:  cpp20
LFTPool
Lock-Free Thread Pool
Stars: ✭ 69 (-64.97%)
Mutual labels:  thread-pool
java-sdk
一些常用的java sdk和工具类(日期工具类,分布式锁,redis缓存,二叉树,反射工具类,线程池,对称/非对称/分段加解密,json序列化,http工具,雪花算法,字符串相似度,集合操作工具,xml解析,重试Retry工具类,Jvm监控等)
Stars: ✭ 26 (-86.8%)
Mutual labels:  thread-pool
util
封装了一些Java常用的功能
Stars: ✭ 19 (-90.36%)
Mutual labels:  thread-pool
CLU
The OpenCL Utility library
Stars: ✭ 18 (-90.86%)
Mutual labels:  utility-library

Not Enough Standards

Not Enough Standards is a modern header-only C++17 and C++20 library that provides platform-independent utilities. The goal of this library is to extend the standard library with recurent features, such as process management, shared library loading or thread pools. To reach that goal the library is written in a very standard compliant way, from the coding-style to the naming convention.

Features

Not Enough Standards works on any posix-compliant system and also on Windows.

Check out the Wiki for more informations.

Installation

Not Enough Standards requires a C++17 compiler, and a C++20 compiler for thread pools.

As any header only library, Not Enough Standards is designed to be directly included in your project, by copying the files you need in your project's directory.

You may also use it as a CMake subproject using add_subdirectory, and use it as any other library:

target_link_libraries(xxx NotEnoughStandards)
target_include_directories(xxx PRIVATE ${NES_INCLUDE_DIR})

The files of the library are independent from each others, so if you only need one specific feature, you can use only the header that contains it.
Actually the only file with a dependency is process.hpp which defines more features if pipe.hpp is available.

Usage

Here is a short example using Not Enough Standards:

main.cpp

#include <iostream>
#include <nes/process.hpp>

int main()
{
    //nes::this_process namespace can be used to modify current process or get informations about it.
    std::cout << "Current process has id " << nes::this_process::get_id() << std::endl; 
    std::cout << "Its current directory is \"" << nes::this_process::working_directory() << "\"" << std::endl;

    //Create a child process
    nes::process other{"other_process", {"Hey!", "\\\"12\"\"\\\\", "\\42\\", "It's \"me\"!"}, nes::process_options::grab_stdout};
    
    //Read the entire standard output of the child process. (nes::process_options::grab_stdout must be specified on process creation)
    std::cout << other.stdout_stream().rdbuf() << std::endl;

    //As a std::thread, a nes::process must be joined if it is not detached.
    if(other.joinable())
        other.join();

    //Once joined, we can check its return code.
    std::cout << "Other process ended with code: " << other.return_code() << std::endl;
}

other.cpp

#include <iostream>
#include <nes/process.hpp>

int main(int argc, char** argv)
{
    //Output some informations about this process
    std::cout << "Hello world! I'm Other!\n";
    std::cout << "You gave me " << argc << " arguments:";
    for(int i{}; i < argc; ++i)
        std::cout << "[" << argv[i] << "] ";
    std::cout << '\n';
    std::cout << "My working directory is \"" << nes::this_process::working_directory() << "\"" << std::endl;
}

Output

Current process has id 3612
Its current directory is "/..."
Hello world! I'm Other!
You gave me 5 arguments:[not_enough_standards_other.exe] [Hey!] [\"12""\\\] [\42\] [It's "me"!] 
My working directory is "/..."

Other process ended with code: 0

License

Not Enough Standards use the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].