{"id":29538711,"url":"https://github.com/noahgwood/platformdirs","last_synced_at":"2025-07-17T05:15:23.352Z","repository":{"id":304841296,"uuid":"1020205391","full_name":"NoahGWood/PlatformDirs","owner":"NoahGWood","description":"A lightweight single-header C++17+ library for getting OS-specific config, data, cache, and log directories.","archived":false,"fork":false,"pushed_at":"2025-07-15T14:28:40.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-16T07:38:45.125Z","etag":null,"topics":["cpp","cross-platform","filesystem","filesystem-library","utility-library"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NoahGWood.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}},"created_at":"2025-07-15T13:57:56.000Z","updated_at":"2025-07-15T14:28:43.000Z","dependencies_parsed_at":"2025-07-16T11:49:55.673Z","dependency_job_id":"83b39979-b46d-4d1d-b94f-578b8009ef40","html_url":"https://github.com/NoahGWood/PlatformDirs","commit_stats":null,"previous_names":["noahgwood/platformdirs"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/NoahGWood/PlatformDirs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoahGWood%2FPlatformDirs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoahGWood%2FPlatformDirs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoahGWood%2FPlatformDirs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoahGWood%2FPlatformDirs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NoahGWood","download_url":"https://codeload.github.com/NoahGWood/PlatformDirs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NoahGWood%2FPlatformDirs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265567401,"owners_count":23789472,"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":["cpp","cross-platform","filesystem","filesystem-library","utility-library"],"created_at":"2025-07-17T05:15:20.884Z","updated_at":"2025-07-17T05:15:23.343Z","avatar_url":"https://github.com/NoahGWood.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PlatformDirs\n\nA single-header C++17+ library for retrieving cross-platform application directories such as config, cache, data, and log folders. Supports Windows, macOS, Linux, Android (via JNI), and iOS (via Foundation).\n\n\n[![CI Ubuntu](https://github.com/NoahGWood/PlatformDirs/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/NoahGWood/PlatformDirs/actions/workflows/test.yml)\n[![CI macOS](https://github.com/NoahGWood/PlatformDirs/actions/workflows/mactest.yml/badge.svg?branch=main)](https://github.com/NoahGWood/PlatformDirs/actions/workflows/mactest.yml)\n[![CI Windows](https://github.com/NoahGWood/PlatformDirs/actions/workflows/wintest.yml/badge.svg?branch=main)](https://github.com/NoahGWood/PlatformDirs/actions/workflows/wintest.yml)\n\n\n## Features\n\n- Cross-platform: Windows, macOS, Linux, Android, iOS\n- Clean `std::filesystem::path` API\n- Header-only, zero external dependencies\n- Supports app-specific folder resolution\n- JNI and Objective-C++ hooks for mobile\n\n## Usage\n\n```cpp\n#include \"platform_dirs.hpp\"\n\nauto config_path = platform_dirs::get_app_dir(\"MyApp\");\n```\n\n### Android Setup\n\nYou **must call `platform_dirs::init()`** with the JNI context before using `get_app_dir()`:\n\n```cpp\nextern \"C\" JNIEXPORT void JNICALL\nJava_com_example_MainActivity_init(JNIEnv* env, jobject ctx) {\n    platform_dirs::init(env, ctx);\n}\n```\n\n### iOS\n\nInclude the file in an Objective-C++ (`.mm`) file if using iOS.\n\n## Utility Methods\n\n- `get_app_dir(app_name)` \n- `get_config_dir(app_name)`\n- `get_cache_dir(app_name)`\n- `get_data_dir(app_name)`\n- `get_log_dir(app_name)`\n- `get_temp_dir()` (no app name needed)\n\n## Design Notes\n\n- Falls back to `$HOME/.config` or platform-specific conventions\n- Uses `getenv()` for desktop env vars\n- Android and iOS use system APIs via JNI and Foundation respectively\n- Returns empty path or `/tmp` if fallback is needed\n\n## Build\n\nNo build system needed — just include the header. For CMake:\n\n```cmake\ntarget_include_directories(your_target PRIVATE vendor/PlatformDirs/include)\n```\n\n## License\n\nLicensed under GPLv3","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoahgwood%2Fplatformdirs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoahgwood%2Fplatformdirs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoahgwood%2Fplatformdirs/lists"}