{"id":30424840,"url":"https://github.com/ricardoboss/Flaggen","last_synced_at":"2025-08-22T11:04:23.640Z","repository":{"id":286294187,"uuid":"961007529","full_name":"ricardoboss/Flaggen","owner":"ricardoboss","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-07T13:29:34.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-16T12:38:11.367Z","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/ricardoboss.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2025-04-05T14:55:46.000Z","updated_at":"2025-06-07T13:29:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"08503502-ea0b-4a16-b5ff-7777efbe9c85","html_url":"https://github.com/ricardoboss/Flaggen","commit_stats":null,"previous_names":["ricardoboss/flaggen"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ricardoboss/Flaggen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardoboss%2FFlaggen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardoboss%2FFlaggen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardoboss%2FFlaggen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardoboss%2FFlaggen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricardoboss","download_url":"https://codeload.github.com/ricardoboss/Flaggen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardoboss%2FFlaggen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271628166,"owners_count":24792821,"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","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-08-22T11:02:18.319Z","updated_at":"2025-08-22T11:04:23.627Z","avatar_url":"https://github.com/ricardoboss.png","language":"C#","funding_links":[],"categories":["Content"],"sub_categories":["205. [Flaggen](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Flaggen) , in the [Enum](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enum) category"],"readme":"# Flaggen\n\nA C# source generator that generates extension methods for flags enums.\n\n## Usage\n\nInstall the package:\n\n```shell\ndotnet add package Flaggen\n```\n\nSuppose we have this enum:\n\n```csharp\nusing System;\n\n[Flags]\npublic enum LovelyColors {\n    RoseGold = 1 \u003c\u003c 0,\n    SeaGreen = 1 \u003c\u003c 1,\n    SunshineYellow = 1 \u003c\u003c 2,\n    BrightRed = 1 \u003c\u003c 3,\n}\n```\n\nThe source generator will notice the `[Flags]` attribute and generate extension methods\nfor this enum:\n\n```csharp\n// initalize with some value\nvar myColors = LovelyColors.RoseGold | LovelyColors.SeaGreen;\n\n// manipulate the flags\nmyColors.Add(LovelyColors.BrightRed);\nmyColors.Remove(LovelyColors.RoseGold);\nmyColors.Toggle(LovelyColors.SeaGreen);\n\n// check for flags\nif (myColors.Has(LovelyColors.SunshineYellow))\n    Console.WriteLine(\"So shiny!\");\n\n```\n\nAll the extension methods using bitwise operators (so no reflection!), which makes them pretty fast (I will not prove\nthis, but you get my trust-me-bro™️ guarantee).\n\n## License\n\n[MIT](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardoboss%2FFlaggen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricardoboss%2FFlaggen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardoboss%2FFlaggen/lists"}