{"id":17961693,"url":"https://github.com/vittorioromeo/ssvutils","last_synced_at":"2026-04-01T22:08:37.073Z","repository":{"id":7513192,"uuid":"8863513","full_name":"vittorioromeo/SSVUtils","owner":"vittorioromeo","description":"[HEADER-ONLY] C++14 multi-purpose utility library that only depends on the STL.","archived":false,"fork":false,"pushed_at":"2026-03-09T12:29:34.000Z","size":2244,"stargazers_count":62,"open_issues_count":4,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-03-09T17:17:39.752Z","etag":null,"topics":["c-plus-plus","cpp","cpp11","cpp14","library","stl"],"latest_commit_sha":null,"homepage":"http://vittorioromeo.info","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vittorioromeo.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2013-03-18T20:30:00.000Z","updated_at":"2026-03-09T12:29:38.000Z","dependencies_parsed_at":"2025-09-07T19:33:04.460Z","dependency_job_id":"bf1b5dfa-5baf-42f3-bdd2-aeeebfea02b1","html_url":"https://github.com/vittorioromeo/SSVUtils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vittorioromeo/SSVUtils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vittorioromeo%2FSSVUtils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vittorioromeo%2FSSVUtils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vittorioromeo%2FSSVUtils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vittorioromeo%2FSSVUtils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vittorioromeo","download_url":"https://codeload.github.com/vittorioromeo/SSVUtils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vittorioromeo%2FSSVUtils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31018566,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T03:51:26.850Z","status":"ssl_error","status_checked_at":"2026-03-27T03:51:09.693Z","response_time":164,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["c-plus-plus","cpp","cpp11","cpp14","library","stl"],"created_at":"2024-10-29T11:11:05.171Z","updated_at":"2026-03-27T04:23:31.091Z","avatar_url":"https://github.com/vittorioromeo.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSVUtils [![Build Status](https://travis-ci.org/SuperV1234/SSVUtils.svg)](https://travis-ci.org/SuperV1234/SSVUtils)\n\nC++14 multi-purpose utility library that only depends on the STL.\n\n*The code examples below are currently outdated.*\n\n---\n\n### CommandLine\n--\n```cpp\n```\n\n### Delegates\n\n```cpp\nint result{0};\nssvu::Delegate\u003cvoid(int)\u003e onSomething;\nonSomething += [\u0026](int mValue){ result += mValue; };\nonSomething += [\u0026](int mValue){ result += mValue * 2; };\nonSomething(2);\nassert(result == 6);\n```\n\n### Encoding\n```cpp\nstring source{\"encode me!\"};\nauto encoded = ssvu::Encoding::encode\u003cEncoding::Type::Base64\u003e(source);\nauto decoded = ssvu::Encoding::decode\u003cEncoding::Type::Base64\u003e(encoded);\nassert(source == decoded);\n```\n\n### FileSystem\n```cpp\nstring myPath{\"/home/folder\"};\nssvu::FileSystem::normalizePath(myPath);\nassert(myPath == \"/home/folder/\");\n\nif(!ssvu::FileSystem::exists(myPath)) ssvu::FileSystem::createFolder(myPath);\n\nssvu::FileSystem::removeFile(myPath + \"garbage_file\");\n\nstring homePath{ssvu::FileSystem::getParentPath(myPath)};\nassert(homePath == \"/home/\");\n\nfor(const auto\u0026 filePath : ssvu::FileSystem::getScan\u003cMode::Recurse, Type::File\u003e(myPath))\n\t// Iterate on all file paths (recursively)\n\nfor(const auto\u0026 subFolderPath : ssvu::FileSystem::getScan\u003cMode::Recurse, Type::Folder\u003e(myPath))\n\t// Iterate on all sub folder paths (recursively)\n\n// and more...\n```\n\n### Global\n```cpp\n// std::unique_ptr is verbose\nusing namespace ssvu;\n\nUptr\u003cint\u003e test{new int};\nUptr\u003cint, SomeCustomDeleter\u003e{new int};\n```\n\n### Log\n```cpp\nusing namespace ssvu;\n\nlo \u003c\u003c lt(\"Testing log\") \u003c\u003c \"Hello!\" \u003c\u003c endl;\n// Prints to console: \"[Testing log]\tHello!\"\n\nsaveLogToFile(\"log.txt\");\n// Saves everything that was logged to \"log.txt\"\n```\n\n### MemoryManager\n--\n```cpp\n```\n\n### PreAlloc\n--\n```cpp\n```\n\n### String\n```cpp\nstring test{\"abcdef\"};\n\nassert(ssvu::beginsWith(test, \"abc\"));\nassert(ssvu::endsWith(test, \"def\"));\n\nstring test2{\"ABCDEF\"};\nassert(ssvu::toLower(test2) == test);\n\nssvu::replaceAll(test, \"abc\", \"ABC\");\nassert(ssvu::beginsWith(test, \"ABC\"));\n\ntest += ssvu::toStr(100);\nassert(test == \"ABCdef100\");\n\n// and more...\n```\n\n### TemplateSystem\n```cpp\n// Example 1\nusing namespace ssvu::TemplateSystem;\nDictionary dict{{\"key1\", \"value1\"}, {\"key2\", \"value2\"}};\nstring toExpand{\".{{key1}}.{{key2}}.\"};\nassert(dict.getExpanded(toExpand) == \".value1.value2.\");\n\n// Example 2\nusing namespace ssvu::TemplateSystem;\nDictionary dict;\nDictionary subdict1{{\"key\", \"value1\"}};\nDictionary subdict2{{\"key\", \"value2\"}};\ndict += {\"section\", subdict1};\ndict += {\"section\", subdict2};\nstring toExpand{\"{{#section}}.{{key}}.{{/section}}\"};\nassert(dict.getExpanded(toExpand) == \".value1..value2.\");\n```\n\n### Timeline\n--\n```cpp\n```\n\n### Utils\n```cpp\nauto i = ssvu::getRnd(0, 5); // get random int [0, 5)\nauto f = ssvu::getRndF(0.f, 5.f); // get random float [0.f, 5.f)\n\nauto x = ssvu::getRnd(0, 100);\nauto clamped = ssvu::getClamped(x, 40, 60); // gets x clamped between 40 and 60\n\nauto rr = ssvu::toRadians(720.f);\nauto dd = ssvu::toDegrees(rr);\nassert(ssvu::wrapDegrees(dd) == 360.f);\n\nstd::vector\u003cint\u003e container{0, 5, 10, 15};\nssvu::eraseRemove(container, 10);\n// container is now = {0, 5, 15}\n\nssvu::eraseRemoveIf(container, [\u0026](const int\u0026 mValue){ return mValue \u003e 0; });\n// container is now = {0}\n\nassert(ssvu::contains(container, 0));\nassert(!ssvu::contains(container, 5));\nassert(!ssvu::containsAny(container, {10, 15}));\n\n// and more...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvittorioromeo%2Fssvutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvittorioromeo%2Fssvutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvittorioromeo%2Fssvutils/lists"}