{"id":17793189,"url":"https://github.com/jcbhmr/platformdirs-cpp","last_synced_at":"2025-04-02T02:17:32.075Z","repository":{"id":251450718,"uuid":"836935538","full_name":"jcbhmr/platformdirs-cpp","owner":"jcbhmr","description":"📂 Python's platformdirs module for C++","archived":false,"fork":false,"pushed_at":"2024-08-16T22:50:27.000Z","size":65,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T17:13:58.069Z","etag":null,"topics":["cmake","cpp","cpp-library","platformdirs","port","xdg"],"latest_commit_sha":null,"homepage":"https://jcbhmr.me/platformdirs-cpp","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/jcbhmr.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":"2024-08-01T21:42:11.000Z","updated_at":"2024-11-15T22:08:06.000Z","dependencies_parsed_at":"2024-10-27T11:06:25.693Z","dependency_job_id":"46467c75-cd18-4ad1-b7fd-3ce8ded1d7ac","html_url":"https://github.com/jcbhmr/platformdirs-cpp","commit_stats":null,"previous_names":["jcbhmr/platformdirs-cpp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcbhmr%2Fplatformdirs-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcbhmr%2Fplatformdirs-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcbhmr%2Fplatformdirs-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcbhmr%2Fplatformdirs-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcbhmr","download_url":"https://codeload.github.com/jcbhmr/platformdirs-cpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246741120,"owners_count":20826067,"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","cpp-library","platformdirs","port","xdg"],"created_at":"2024-10-27T11:05:10.983Z","updated_at":"2025-04-02T02:17:31.376Z","avatar_url":"https://github.com/jcbhmr.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# platformdirs for C++\n\n📂 Python's [platformdirs](https://pypi.org/project/platformdirs/) module for C++\n\n\u003ctable align=center\u003e\u003ctd\u003e\n\n```cpp\nauto dirs = platformdirs::platform_dirs(app_name, app_author, \"1.0\");\nstd::println(\"user_data_dir: {}\", dirs.user_data_dir());\nstd::println(\"user_config_dir: {}\", dirs.user_config_dir());\nstd::println(\"user_cache_dir: {}\", dirs.user_cache_dir());\nstd::println(\"user_state_dir: {}\", dirs.user_state_dir());\nstd::println(\"user_log_dir: {}\", dirs.user_log_dir());\nstd::println(\"...and more!\");\n```\n\n```\nuser_data_dir: ~/.local/share/MyApp/1.0\nuser_config_dir: ~/.config/MyApp/1.0\nuser_cache_dir: ~/.cache/MyApp/1.0\nuser_state_dir: ~/.local/state/MyApp/1.0\nuser_log_dir: ~/.local/state/MyApp/1.0/log\n...and more!\n```\n\n\u003c/table\u003e\n\n🐍 Same API surface as [platformdirs](https://pypi.org/project/platformdirs/) \\\n🔺 Works great with CMake \\\n💅 Uses platformdirs' opinionated directories \\\n**🟦 Works on Windows** \\\n🌌 Works with [cosmocc](https://github.com/jart/cosmopolitan/tree/master/tool/cosmocc)!\n\n## Installation\n\n![CMake](https://img.shields.io/static/v1?style=for-the-badge\u0026message=CMake\u0026color=064F8C\u0026logo=CMake\u0026logoColor=FFFFFF\u0026label=)\n\n\u003cdl\u003e\n\u003cdt\u003eCMake \u003ccode\u003efind_package()\u003c/code\u003e with \u003ccode\u003eFetchContent\u003c/code\u003e fallback\n\u003cdd\u003e\n\n```cmake\ninclude(FetchContent)\nFetchContent_Declare(platformdirs\n    GIT_REPOSITORY https://github.com/jcbhmr/platformdirs-cpp.git\n    GIT_TAG v0.1.0\n    FIND_PACKAGE_ARGS 0.1.0...\u003c1)\n# Will try find_package(platformdirs 0.1.0...\u003c1) first\nFetchContent_MakeAvailable(platformdirs)\n\n# ...\n\n# Now link it into your app/lib target\ntarget_link_libraries(myapp platformdirs::platformdirs)\ntarget_link_libraries(mylib platformdirs::platformdirs)\n```\n\n\u003c/dl\u003e\n\n## Usage\n\n![C++](https://img.shields.io/static/v1?style=for-the-badge\u0026message=C%2B%2B\u0026color=00599C\u0026logo=C%2B%2B\u0026logoColor=FFFFFF\u0026label=)\n\n\u003cdiv\u003e\u003ccode\u003emain.cpp\u003c/code\u003e\u003c/div\u003e\n\n```cpp\n#include \u003cprint\u003e\n#include \u003cplatformdirs.h\u003e\n\nint main() {\n    std::println(\"my app config: {}\", platformdirs::user_config_dir(\"myapp\", \"me\", \"1.2.3\"));\n    return 0;\n}\n```\n\n[📚 See the complete API surface on the website](https://jcbhmr.me/platformdirs/)\n\n💡 Pro tip: there's an included `platformdirs` executable which prints a report of all the config dirs for you. It's great for debugging! 😉\n\n## Development\n\n![CMake](https://img.shields.io/static/v1?style=for-the-badge\u0026message=CMake\u0026color=064F8C\u0026logo=CMake\u0026logoColor=FFFFFF\u0026label=)\n\n```sh\ncmake --workflow --preset default\ncmake --workflow --preset test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcbhmr%2Fplatformdirs-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcbhmr%2Fplatformdirs-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcbhmr%2Fplatformdirs-cpp/lists"}