{"id":25463108,"url":"https://github.com/mnoomnoo/staticresourceassert","last_synced_at":"2025-11-03T20:30:29.893Z","repository":{"id":276248486,"uuid":"928701444","full_name":"mnoomnoo/StaticResourceAssert","owner":"mnoomnoo","description":"Static Resource Assert generates a header file containing an API that allows for statically asserting the existence of a directory or file.","archived":false,"fork":false,"pushed_at":"2025-02-16T03:22:37.000Z","size":197,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T03:23:39.241Z","etag":null,"topics":["api","api-generation","build-step","cpp","cpp17","filesystem","static-assert","static-assertions"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mnoomnoo.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","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":"2025-02-07T04:39:11.000Z","updated_at":"2025-02-08T17:40:13.000Z","dependencies_parsed_at":"2025-02-08T15:30:54.882Z","dependency_job_id":null,"html_url":"https://github.com/mnoomnoo/StaticResourceAssert","commit_stats":null,"previous_names":["mnoomnoo/staticresourceassert"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnoomnoo%2FStaticResourceAssert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnoomnoo%2FStaticResourceAssert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnoomnoo%2FStaticResourceAssert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnoomnoo%2FStaticResourceAssert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnoomnoo","download_url":"https://codeload.github.com/mnoomnoo/StaticResourceAssert/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239418577,"owners_count":19635208,"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":["api","api-generation","build-step","cpp","cpp17","filesystem","static-assert","static-assertions"],"created_at":"2025-02-18T06:19:34.831Z","updated_at":"2025-11-03T20:30:29.861Z","avatar_url":"https://github.com/mnoomnoo.png","language":"C++","readme":"# StaticResourceAssert\nStaticResourceAssert (sra) generates a header file containing an API that allows for statically asserting the existence of a directory or file.\n\nThe API is updated only when StaticResourceAssert runs, so any changes to the filesystem after the header is generated cannot be statically asserted.\n\nThis project is just an experiment. Its use cases are probably minimal at best. Please enjoy.\n\n# Using\n\n## sra\n\n### Command line arguments\n- -d : Required. The directory to recursively search through and catalog entries\n- -o : Name of the output api header. Always include the .h extention. Default is: static_resource_assert_api.h\n- -h : Print version and command line options\n\n    ### Example usage\n    `sra -d inputDir -o outputDir/output_header.h`\n\n## sra generated header\nInclude the generated header to get the static assert API.\n\n### API reference\n`STATIC_RESOURCE_ASSERT(\"file_or_directory\")` Statically asserts that the file or directory path is in the API header.\n\n`STATIC_RESOURCE_ASSERT_MSG(\"file_or_directory\", \"assert message\")`  Statically asserts that the file or directory path is in the API header. Custom assert message is printed if assert fails.\n\n`STATIC_RESOURCE_FIND(\"file_or_directory\")` Statically searches for `file_or_directory` and returns true if the file or directory was found, else false.\n\nExample:\n```c++\nSTATIC_RESOURCE_ASSERT(\"dir0/file0\");\nSTATIC_RESOURCE_ASSERT(\"dir0/file1\");\nSTATIC_RESOURCE_ASSERT(\"dir0/other_dir\");\n\nSTATIC_RESOURCE_ASSERT_MSG(\"dir0/file0\", \"file 0 not found!\");\nSTATIC_RESOURCE_ASSERT_MSG(\"dir0/file1\", \"file 1 not found!\");\nSTATIC_RESOURCE_ASSERT_MSG(\"dir0/other_dir\", \"other_dir not found!\");\n\nconstexpr bool val_true = STATIC_RESOURCE_FIND(\"dir0/file0\");\nconstexpr bool val_false = STATIC_RESOURCE_FIND(\"dir0/file5\");\nconstexpr bool val_true = STATIC_RESOURCE_FIND(\"dir0/other_dir\");\nconstexpr bool val_false = STATIC_RESOURCE_FIND(\"dir0/other_dir123\");\n```\n\n# Building\n## sra\n1) Open StaticResourceAssert directory in VSCode or use cmake from the command line\n2) Use cmake to configure\n3) Build target `sra`\n\n## UnitTests\n1) Run `sra -d StaticResourceAssertUnitTests/exampleDirectory` from the repo root. This will generate the static API header needed by unit tests\n2) Build target `StaticResourceAssertUnitTests`\n\n\n# Limits\nIn cases where the directory cataloged is large, the compiler may display errors like: `fatal error: template instantiation depth exceeds maximum of X`.\nWhen this occurs use the following GCC flags to change constexpr evaluation limits.\n- `-ftemplate-depth=X` set the maximum instantiation depth for template classes to X.\n- `-fconstexpr-ops-limit=X` sets the maximum number of operations during a single constexpr evaluation to X.\n- `-fconstexpr-depth=X` sets the maximum nested evaluation depth for C++11 constexpr functions to X\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnoomnoo%2Fstaticresourceassert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnoomnoo%2Fstaticresourceassert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnoomnoo%2Fstaticresourceassert/lists"}