{"id":13730930,"url":"https://github.com/Alairion/not-enough-standards","last_synced_at":"2025-05-08T03:32:14.033Z","repository":{"id":38419150,"uuid":"189410372","full_name":"Alairion/not-enough-standards","owner":"Alairion","description":"A modern header-only C++ library that provides platform-independent utilities.","archived":false,"fork":false,"pushed_at":"2023-12-14T14:40:56.000Z","size":115,"stargazers_count":229,"open_issues_count":2,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-14T00:40:36.358Z","etag":null,"topics":["cpp","cpp17","cpp20","mutex","named-mutex","named-pipes","pipes","process","semaphores","shared-library","thread-pool","utility-library"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Alairion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-30T12:32:01.000Z","updated_at":"2024-10-02T00:42:57.000Z","dependencies_parsed_at":"2024-09-29T00:00:48.688Z","dependency_job_id":"0f60773d-6eb9-4369-8e5d-fa483f98de17","html_url":"https://github.com/Alairion/not-enough-standards","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alairion%2Fnot-enough-standards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alairion%2Fnot-enough-standards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alairion%2Fnot-enough-standards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alairion%2Fnot-enough-standards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alairion","download_url":"https://codeload.github.com/Alairion/not-enough-standards/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224695795,"owners_count":17354482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cpp17","cpp20","mutex","named-mutex","named-pipes","pipes","process","semaphores","shared-library","thread-pool","utility-library"],"created_at":"2024-08-03T02:01:21.588Z","updated_at":"2024-11-14T21:31:49.637Z","avatar_url":"https://github.com/Alairion.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# Not Enough Standards\n\nNot 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.\n\n## Features\n\nNot Enough Standards works on any posix-compliant system and also on Windows.\n\n* [Shared library loading](https://github.com/Alairion/not-enough-standards/wiki/shared_library.hpp)\n* [Process management](https://github.com/Alairion/not-enough-standards/wiki/process.hpp)\n* Inter-process communication ([pipes](https://github.com/Alairion/not-enough-standards/wiki/pipe.hpp), [shared memory](https://github.com/Alairion/not-enough-standards/wiki/shared_memory.hpp))\n* Inter-process synchronization ([named mutexes](https://github.com/Alairion/not-enough-standards/wiki/named_mutex.hpp), [named semaphores](https://github.com/Alairion/not-enough-standards/wiki/names_semaphore.hpp))\n* Synchronization primitives ([semaphores](https://github.com/Alairion/not-enough-standards/wiki/semaphore.hpp))\n* [Thread pools](https://github.com/Alairion/not-enough-standards/wiki/thread_pool.hpp)\n\nCheck out the [Wiki](https://github.com/Alairion/not-enough-standards/wiki) for more informations.\n\n## Installation\n\nNot Enough Standards requires a C++17 compiler, and a C++20 compiler for thread pools.\n\nAs 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.\n\nYou may also use it as a CMake subproject using `add_subdirectory`, or by find package, and use it as any other library:\n```\ntarget_link_libraries(xxx PRIVATE NotEnoughStandards::NotEnoughStandards)\n```\n\nThe 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.   \nActually the only file with a dependency is `process.hpp` which defines more features if `pipe.hpp` is available.\n\n## Usage\n\nHere is a short example using Not Enough Standards:\n\n#### main.cpp\n```cpp\n#include \u003ciostream\u003e\n#include \u003cnes/process.hpp\u003e\n\nint main()\n{\n    //nes::this_process namespace can be used to modify current process or get informations about it.\n    std::cout \u003c\u003c \"Current process has id \" \u003c\u003c nes::this_process::get_id() \u003c\u003c std::endl; \n    std::cout \u003c\u003c \"Its current directory is \\\"\" \u003c\u003c nes::this_process::working_directory() \u003c\u003c \"\\\"\" \u003c\u003c std::endl;\n\n    //Create a child process\n    nes::process other{\"other_process\", {\"Hey!\", \"\\\\\\\"12\\\"\\\"\\\\\\\\\", \"\\\\42\\\\\", \"It's \\\"me\\\"!\"}, nes::process_options::grab_stdout};\n    \n    //Read the entire standard output of the child process. (nes::process_options::grab_stdout must be specified on process creation)\n    std::cout \u003c\u003c other.stdout_stream().rdbuf() \u003c\u003c std::endl;\n\n    //As a std::thread, a nes::process must be joined if it is not detached.\n    if(other.joinable())\n        other.join();\n\n    //Once joined, we can check its return code.\n    std::cout \u003c\u003c \"Other process ended with code: \" \u003c\u003c other.return_code() \u003c\u003c std::endl;\n}\n```\n\n#### other.cpp\n\n```cpp\n#include \u003ciostream\u003e\n#include \u003cnes/process.hpp\u003e\n\nint main(int argc, char** argv)\n{\n    //Output some informations about this process\n    std::cout \u003c\u003c \"Hello world! I'm Other!\\n\";\n    std::cout \u003c\u003c \"You gave me \" \u003c\u003c argc \u003c\u003c \" arguments:\";\n    for(int i{}; i \u003c argc; ++i)\n        std::cout \u003c\u003c \"[\" \u003c\u003c argv[i] \u003c\u003c \"] \";\n    std::cout \u003c\u003c '\\n';\n    std::cout \u003c\u003c \"My working directory is \\\"\" \u003c\u003c nes::this_process::working_directory() \u003c\u003c \"\\\"\" \u003c\u003c std::endl;\n}\n```\n\n#### Output\n\n```\nCurrent process has id 3612\nIts current directory is \"/...\"\nHello world! I'm Other!\nYou gave me 5 arguments:[not_enough_standards_other.exe] [Hey!] [\\\"12\"\"\\\\\\] [\\42\\] [It's \"me\"!] \nMy working directory is \"/...\"\n\nOther process ended with code: 0\n```\n\n## License\n\nNot Enough Standards use the [MIT license](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlairion%2Fnot-enough-standards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAlairion%2Fnot-enough-standards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlairion%2Fnot-enough-standards/lists"}