{"id":48652446,"url":"https://github.com/reybits/easy-profile","last_synced_at":"2026-04-10T08:52:10.730Z","repository":{"id":319296543,"uuid":"1078258599","full_name":"reybits/easy-profile","owner":"reybits","description":"Flexible profile storage for any data, any type, any amount.","archived":false,"fork":false,"pushed_at":"2026-03-19T20:22:58.000Z","size":53,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-10T08:52:09.065Z","etag":null,"topics":["age","cpp","modules","profile"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reybits.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":"2025-10-17T12:59:43.000Z","updated_at":"2026-03-19T20:23:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"6dd56a0b-f306-45b9-8417-5e1b2f6f6d9c","html_url":"https://github.com/reybits/easy-profile","commit_stats":null,"previous_names":["reybits/easy-profile"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/reybits/easy-profile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reybits%2Feasy-profile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reybits%2Feasy-profile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reybits%2Feasy-profile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reybits%2Feasy-profile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reybits","download_url":"https://codeload.github.com/reybits/easy-profile/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reybits%2Feasy-profile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31635969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"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":["age","cpp","modules","profile"],"created_at":"2026-04-10T08:52:10.003Z","updated_at":"2026-04-10T08:52:10.711Z","avatar_url":"https://github.com/reybits.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Easy Profile library\n\nThe main idea of this library is to provide a simple and efficient way to manage profile settings using enums as keys, enabling type-safe access and modification of profile data.\nThis implementation is blazing fast, easy to use, and highly extensible.\n\nDefault values and storage are managed on the developer side, giving you full control over memory management and data persistence.\n\n## Example usage\n\nDefine your enums.\n\n```cpp\nenum class BOOL\n{\n    ValueOne,\n    ValueTwo,\n\n    Count,\n};\n\nenum class U32\n{\n    ValueOne,\n    ValueTwo,\n\n    Count,\n};\n\nenum class STR\n{\n    ValueOne,\n    ValueTwo,\n\n    Count\n};\n```\n\nAnd define containers for them.\n\n```cpp\n#define PROFILE_TYPES                                                    \\\n    PROFILE_TYPE(BOOL, Bool, bool, static_cast\u003csize_t\u003e(BOOL::Count))     \\\n    PROFILE_TYPE(U32, U32, uint32_t, static_cast\u003csize_t\u003e(U32::Count))    \\\n    PROFILE_TYPE(STR, Str, std::string, static_cast\u003csize_t\u003e(STR::Count))\n\n#include \"EasyProfile.h\"\n```\n\nDefault values.\n\n```cpp\nconst std::array\u003cbool, 2\u003e defaultBool = {\n    true,\n    false\n};\n\nconst std::array\u003cuint32_t, 2\u003e defaultU32{\n    123u,\n    456u\n};\n\nconst std::array\u003cstd::string, 2\u003e defaultStr{\n    std::string{ \"StrOne\" },\n    std::string{ \"StrTwo\" }\n};\n```\n\nDefine your profile by inheriting from easyprofile::Profile.\n\n```cpp\nclass MyProfile : public easyprofile::Profile\n{\npublic:\n    MyProfile()\n        : easyprofile::Profile(defaultBool, defaultU32, defaultStr)\n    {\n    }\n};\n```\n\nDefine a listener by inheriting from easyprofile::Profile::Listener.\n\n```cpp\nclass MyListener final : public easyprofile::Profile::Listener\n{\npublic:\n    MyListener(easyprofile::Profile* profile)\n        : easyprofile::Profile::Listener(profile, \"MyListener\")\n    {\n    }\n\n    void onProfile(BOOL e, const bool\u0026 value) override\n    {\n        auto title = std::string(getName()) + \": \";\n        ::printf(\"%s = %s\\n\", title.c_str(), value ? \"true\" : \"false\");\n    }\n\n    void onProfile(U32 e, const uint32_t\u0026 value) override\n    {\n        auto title = std::string(getName()) + \": \";\n        ::printf(\"%s = %u\\n\", title.c_str(), value);\n    }\n\n    void onProfile(STR e, const std::string\u0026 value) override\n    {\n        auto title = std::string(getName()) + \": \";\n        ::printf(\"%s = %s\\n\", title.c_str(), value.c_str());\n    }\n};\n```\n\nInitialize profile and listener, and change some values.\n\n```cpp\nvoid InitilizeProfile()\n{\n    // Create profile instance.\n    MyProfile myProfile;\n\n    // Create listener instance and register it to the profile.\n    MyListener myListener(\u0026myProfile);\n\n    // Change some values in the profile.\n    myProfile.set(BOOL::ValueOne, false); // This will trigger MyListener's onProfile for BOOL.\n    myProfile.set(U32::ValueTwo, 789u);   // This will trigger MyListener's onProfile for U32.\n    myProfile.set(STR::ValueOne, std::string{ \"NewStringOne\" }); // This will trigger MyListener's onProfile for STR.\n\n    std::println(\"BOOL ValueOne: {}\", myProfile.get(BOOL::ValueOne));\n    std::println(\"U32 ValueTwo: {}\", myProfile.get(U32::ValueTwo));\n    std::println(\"STR ValueOne: {}\", myProfile.get(STR::ValueOne));\n}\n```\n\n## Use preprocessor\n\nYou can also use preprocessor to create human and debugger friendly source.\n\nCreate file `make_profile.h` with the following content:\n\n```cpp\nenum class BOOL\n{\n    ValueOne,\n    ValueTwo,\n\n    Count,\n};\n\nenum class U32\n{\n    ValueOne,\n    ValueTwo,\n\n    Count,\n};\n\nenum class STR\n{\n    ValueOne,\n    ValueTwo,\n\n    Count\n};\n\n#define PROFILE_TYPES                                                    \\\n    PROFILE_TYPE(BOOL, Bool, bool, static_cast\u003csize_t\u003e(BOOL::Count))     \\\n    PROFILE_TYPE(U32, U32, uint32_t, static_cast\u003csize_t\u003e(U32::Count))    \\\n    PROFILE_TYPE(STR, Str, std::string, static_cast\u003csize_t\u003e(STR::Count))\n\n#include \"EasyProfile.h\"\n```\n\nRun the following command to generate `MyEasyProfile.h`:\n\n```bash\ng++ -E -P make_profile.cpp | clang-format \u003e MyEasyProfile.h\n```\n\nOr with a copyright header comment and C++ include guard:\n\n```bash\n(echo \"/*\\n* Easy Profile library\\n* by Andrey A. Ugolnik\\n* https://github.com/reybits\\n*/\\n\\n\\#pragma once\\n\" ; g++ -E -P make_profile.cpp) | clang-format \u003e MyEasyProfile.h\n```\n\nInclude `MyEasyProfile.h` in your project and use it as usual.\n\n\n```\nby Andrey A. Ugolnik\nand@reybits.dev\nhttps://github.com/reybits\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freybits%2Feasy-profile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freybits%2Feasy-profile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freybits%2Feasy-profile/lists"}