{"id":19350815,"url":"https://github.com/terroo/utilscpp","last_synced_at":"2025-07-17T06:32:45.336Z","repository":{"id":96860341,"uuid":"220350347","full_name":"terroo/utilscpp","owner":"terroo","description":"My C++ Utility Library","archived":false,"fork":false,"pushed_at":"2019-12-27T18:39:45.000Z","size":152,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-23T07:37:31.776Z","etag":null,"topics":["clang","cmake","cpp","gnu","llvm","make","makefile"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terroo.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-11-07T23:51:28.000Z","updated_at":"2021-11-12T08:20:26.000Z","dependencies_parsed_at":"2023-03-30T11:36:48.748Z","dependency_job_id":null,"html_url":"https://github.com/terroo/utilscpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/terroo/utilscpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terroo%2Futilscpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terroo%2Futilscpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terroo%2Futilscpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terroo%2Futilscpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terroo","download_url":"https://codeload.github.com/terroo/utilscpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terroo%2Futilscpp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265573470,"owners_count":23790438,"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":["clang","cmake","cpp","gnu","llvm","make","makefile"],"created_at":"2024-11-10T04:33:58.410Z","updated_at":"2025-07-17T06:32:45.305Z","avatar_url":"https://github.com/terroo.png","language":"C++","readme":"# C++ Utils Terminal Root\n\n\u003e `./utilscpp`\n\nMy C++ Utility Library\n\n![C++ Utils Terminal Root](img/utilscpp.png)\n\n---\n\n# [Colors C++](https://github.com/terroo/utilscpp/tree/master/colors) `colors`\n\nLibrary to print your strings with a single function (object)\n\n## How to use\n\n+ 1. Add the library and vector to your header\n\n```cpp\n#include \u003cvector\u003e\n#include \"libcolors.h\"\n```\n\n+ 2. Instantiate the class\n\n```cpp\nColors c;\n```\n\n+ 3. Then just call the member function, example:\n\n\u003e You must pass 3 arguments to the function, in the following order/prototype:\n\n`c.colors( COLOR , CONTENT , INTEGER[ 0 or 1 ] )`\n\n```cpp\nstd::cout \u003c\u003c c.colors( \"red\" , \"My cool string\" , 1  ) \u003c\u003c '\\n';\n//                     ^^^^    ^^^^^^^^^^^^^^^   ^^^\n//                     Color        Content      Bold\n```\n\nUse `1` if you want **bold** output and `0` for *normal* output, complete example:\n\n```cpp\n#include \u003ciostream\u003e\n#include \u003cvector\u003e\n#include \"libcolors.h\"\n\nint main(){\n  Colors c;\n  std::cout \u003c\u003c c.colors( \"red\" , \"My cool string\" , 1 ) \u003c\u003c '\\n';\n  return 0;\n}\n```\n\n## Ready example\nIf you wanted to see an application working, compile the example:\n\n+ First option, compiling with [CMake](https://cmake.org/):\n```sh\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n```\n\nThen just run: `./colors \"My phrase\" --bold --cyan`\n\n+ Second option, compiling with [GNU Make](https://www.gnu.org/software/make/):\n```sh\nmake\n```\n\nThen just run: `./colors \"My phrase\" --bold --purple`\n\n## Help\nUse the `-h` or `--help` option to see available colors and other information. Exemplo:\n```sh\n./colors --help\n```\n\n---\n\n# [Help C++](https://github.com/terroo/utilscpp/tree/master/help) `help`\n\nEasily add help to your program\n\n## How to use\n\n+ 1. Include library header\n```cpp\n#include \"help.hh\"\n```\n\u003e If it is on a different path, indicate the full path, for example: `#include \"path/to/help.hh\"`\n\n+ 2. Pass the command line arguments: `int argc` and `char** argv` to the `main()` function, for example:\n\n+ 3. Instantiate the `Help` class and call the `help.m_help (argc, argv)` and `m_dhelp()` methods/members, for example:\n```cpp\nHelp help;\nhelp.m_help(argc, argv);\nhelp.m_dhelp();\n```\n\u003e Remove `help.m_dhelp()` if you wish.\n\nEdit/modify the `usage()` and `m_dhelp()` member functions as usability for your program.\n\nBasic example of use `vim main.cpp`:\n\n```cpp\n#include \"help.hh\"\nint main(int argc, char** argv){\n    Help help;\n    help.m_help(argc, argv);\n    help.m_dhelp();\n    std::cout \u003c\u003c \"Start my program ...\" \u003c\u003c '\\n';\n    return 0;\n}\n```\n\nTo compile this test, run:\n```sh\nmake install clean\n./help\n./help --help\n```\n\n---\n\n# [Decimal to binary](https://github.com/terroo/utilscpp/tree/master/dec2bin) `dec2bin`\nConvert decimal to binary\n\n## Compiling\n\n```sh\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n./dec2bin 81\n1010001\n```\n\n---\n\n# [Binary to decimal](https://github.com/terroo/utilscpp/tree/master/bin2dec) `bin2dec`\nConvert binary to decimal\n\n## Compiling\n\n```sh\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n./bin2dec 111010\n# 58\n```\n\nAlternatively use GNU Make\n```sh\n./bin2dec 10110\n# 22\n```\n\n---\n\n# [Decimal to hexdecimal](https://github.com/terroo/utilscpp/tree/master/dec2hex) `dec2hex`\nConvert decimal to hexadecimal\n\n## Compiling\n\n```sh\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n./dec2hex 8041979\n# 7AB5FB\n./dec2hex 13021952\n# C6B300\n```\n\n---\n\n# [Hexadecimal to decimal](https://github.com/terroo/utilscpp/tree/master/dec2hex) `hex2dec`\nConvert hexadecimal to decimal\n\n## Compiling\n\n```sh\nmake\n./hex2dec A82EB9\n# 11022009\n./hex2dec 10542C5\n# 17121989\n```\n\n---\n\n# [Convert ASCII to Decimal](https://github.com/terroo/utilscpp/tree/master/ascii2dec) `ascii2dec`\nConvert ASCII to decimal\n\n## Compiling\n\n```sh\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n```\n\n## Use\n\u003e **Use quotes!** \n\n```sh\n./ascii2dec \"Welcome to C ++ Utils\"\n# 87 101 108 99 111 109 101 32 116 111 32 67 32 43 43 32 85 116 105 108 115\n```\n\n---\n\n# [Convert Decimal to ASCII](https://github.com/terroo/utilscpp/tree/master/dec2ascii) `dec2ascii`\nConvert Decimal to ASCII\n\n## Compiling\n\n```sh\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n```\n\n## Use\n\u003e To know the order of numbers use the [ascii2dec](https://github.com/terroo/utilscpp/tree/master/ascii2dec) tool first\n\u003e \n\u003e **Do not use quotes!**\n\n```sh\n./dec2ascii 87 101 108 99 111 109 101 32 116 111 32 67 32 43 43 32 85 116 105 108 115\n# Welcome to C++ Utils\n```\n\n---\n\n# [Leap Year](https://github.com/terroo/utilscpp/tree/master/leap-year) `leap-year`\nChecks one or more years are leap or not\n\n## Compiling\n\n```sh\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n```\n\n## Use\nRun the program entering one or more years as parameter.\n```sh\n./leap-year 1900 2019 2400 2020\n1900 is NOT a leap year.\n2019 is NOT a leap year.\n2400 is a leap year.\n2020 is a leap year.\n```\n\n---\n\nBy [Marcos Oliveira](https://terminalroot.com.br)\n\nBy \u003chttps://en.terminalroot.com.br\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterroo%2Futilscpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterroo%2Futilscpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterroo%2Futilscpp/lists"}