{"id":22819518,"url":"https://github.com/bdfoster/flags","last_synced_at":"2025-03-30T23:13:52.768Z","repository":{"id":147886292,"uuid":"55455097","full_name":"bdfoster/flags","owner":"bdfoster","description":"C++ library to easily and efficiently add boolean flags to your code.","archived":false,"fork":false,"pushed_at":"2016-09-10T03:38:37.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T04:41:25.911Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/bdfoster.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":"2016-04-05T00:26:26.000Z","updated_at":"2016-04-05T00:27:06.000Z","dependencies_parsed_at":"2023-05-27T20:00:15.238Z","dependency_job_id":null,"html_url":"https://github.com/bdfoster/flags","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdfoster%2Fflags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdfoster%2Fflags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdfoster%2Fflags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdfoster%2Fflags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bdfoster","download_url":"https://codeload.github.com/bdfoster/flags/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246390872,"owners_count":20769478,"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":[],"created_at":"2024-12-12T15:12:43.168Z","updated_at":"2025-03-30T23:13:52.761Z","avatar_url":"https://github.com/bdfoster.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Flags is a simple C++ script you can use to keep your boolean values for\nyour software. It is extremely simple, so much so that you may be\nwondering why I even made it (I needed it... and a simple array wasn't\ngoing to cut it).\n\nAnyway, here's how to use it.\n\n```\nFlags flags = new Flags();\n```\n\nInventive, I know...\n\nTo set a flag:\n```\nflags.set(\"logIt\");\nflags.read(\"logIt\"); // true\nflags.unset(\"logIt\");\nflags.read(\"logIt\"); // false\n```\nThat's great, but what if I didn't already set the flag?\nWell, then it's false.\n```\nflags.read(\"noLog\"); // false\n```\n\nNow, use it in our premade class:\n```\nclass MyClass {\n    public:\n        Flags flag;\n\n\tMyClass (void): flags (new Flags()) {\n\t    // Preset some flags\n            flag.set(\"readOnly\");\n            flag.set(\"async\");\n            flag.set(\"nonBlocking\");\n\n\t    // Go on about your day...\n\t}\n\n        void open (std::string, flags) {\n            if (flag.read(\"readOnly\") {\n                ...\n            } else {\n                ...\n            }\n            ...\n        }\n};\n```\nAnd... that's it! Really simple, you don't need to know anything else.\n\nTake a look at the well documented code in Flags.h\n\nI'm always looking to do some optimization whilist making it easier to\nuse. You can open an issue at https://github.com/bdfoster/flags/issues\nor send a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdfoster%2Fflags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbdfoster%2Fflags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdfoster%2Fflags/lists"}