{"id":18898328,"url":"https://github.com/brainstone/string-tomfoolery","last_synced_at":"2025-07-19T05:06:46.514Z","repository":{"id":197176122,"uuid":"698074323","full_name":"BrainStone/String-Tomfoolery","owner":"BrainStone","description":"A silly little library that explores what fun stuff you could do with strings and operators in C++...","archived":false,"fork":false,"pushed_at":"2024-07-03T03:24:31.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-10T13:03:26.155Z","etag":null,"topics":["cmake","cpp","cpp23","library","string","string-manipulation","template"],"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/BrainStone.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":"2023-09-29T05:20:08.000Z","updated_at":"2024-07-03T03:24:34.000Z","dependencies_parsed_at":"2023-09-29T10:27:44.690Z","dependency_job_id":"6b6bb71c-aad7-4adb-b590-f772e97aa0a7","html_url":"https://github.com/BrainStone/String-Tomfoolery","commit_stats":null,"previous_names":["brainstone/string-tomfoolery"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/BrainStone/String-Tomfoolery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainStone%2FString-Tomfoolery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainStone%2FString-Tomfoolery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainStone%2FString-Tomfoolery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainStone%2FString-Tomfoolery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrainStone","download_url":"https://codeload.github.com/BrainStone/String-Tomfoolery/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainStone%2FString-Tomfoolery/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265892051,"owners_count":23844958,"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":["cmake","cpp","cpp23","library","string","string-manipulation","template"],"created_at":"2024-11-08T08:42:01.900Z","updated_at":"2025-07-19T05:06:46.470Z","avatar_url":"https://github.com/BrainStone.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# String-Tomfoolery\n\nA silly little library that explores what fun stuff you could do with strings and operators in C++...\n\n## What you can do with it\n\nI mean did you never want to multiply strings? This library is *exactly* this concept but taken a bit further!  \nWe have multiplication and division in various variations!\n\nNow you can do all of this:\n\n```cpp\n#include \"stomfoolery.hpp\"\n\n// To allow the nifty `\"foobar\"s` syntax that creates `std::string` objects in place\nusing namespace std::string_literals;\n\n\"Hello World! \"s * 3; // -\u003e \"Hello World! Hello World! Hello World! \"s\n\"Hello World! Hello World! Hello World! \"s / 3; // -\u003e std::vector\u003cstd::string\u003e{\"Hello World! \"s, \"Hello World! \"s, \"Hello World! \"s}\n\nstd::vector\u003cstd::string\u003e{\"Hello World!\"s, \"Hello Bjarne!\"s} * \" \"s; // -\u003e \"Hello World! Hello Bjarne!\"s\n\"Hello World! Hello Bjarne!\"s / \" \"s; // -\u003e std::vector\u003cstd::string\u003e{\"Hello World!\"s, \"Hello Bjarne!\"s}\n\"Hello World! \\tHello Bjarne!\"s / std::regex{R\"(\\s+)\"}; // -\u003e std::vector\u003cstd::string\u003e{\"Hello World!\"s, \"Hello Bjarne!\"s}\n```\n\nThis is really just playing around, and honestly you shouldn't be using this in production code. The idea behind is more\nseeing what you can do with the language.  \nThe only really usable part for something like production code are the named alternatives. If you only want to use them,\nset the preprocessor flag `STOMFOOLERY_DISABLE_OPERATORS`, which does in fact disable the operators.\n\n## Using this lib\n\nThis is a CMake library, and you can use it as you would any other CMake library. See Instructions further down on how\nto use it without CMake too.\n\n### CMake\n\nYou can use the `FetchContent` module to let CMake download the lib for you:\n\n```cmake\n# Download stomfoolery\ninclude(FetchContent)\nFetchContent_Declare(\n        stomfoolery\n        GIT_REPOSITORY https://github.com/BrainStone/String-Tomfoolery.git\n        GIT_TAG v1.0.0\n)\n\nFetchContent_MakeAvailable(stomfoolery)\n\n# Use stomfoolery\nproject(${PROJECT_NAME} CXX)\ntarget_link_libraries(${PROJECT_NAME} PRIVATE stomfoolery)\n```\n\n### Without CMake\n\nEssentially you have two options:\n\n- Add `$stomfoolery_base_path/src` to your include paths.\n- Copy `src/stomfoolery.{hpp,inc}` into an already in use include path.\n\n## Building\n\nFirst of all there's no actual library to build. The only thing that can be build and executed are the test.  \nNow this is a CMake project, so just follow standard build procedure:\n\n```bash\n# Build\ncmake -B build\ncmake --build build\n\n# Run tests\ncd build\nctest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainstone%2Fstring-tomfoolery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrainstone%2Fstring-tomfoolery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainstone%2Fstring-tomfoolery/lists"}