{"id":15874910,"url":"https://github.com/rudifa/rudifautilpkg","last_synced_at":"2025-03-16T05:31:03.059Z","repository":{"id":37818643,"uuid":"290266225","full_name":"rudifa/RudifaUtilPkg","owner":"rudifa","description":"Small Swift extensions that make my life easier, see the  docs.","archived":false,"fork":false,"pushed_at":"2024-09-16T14:45:17.000Z","size":390,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-27T05:12:08.529Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rudifa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-08-25T16:28:02.000Z","updated_at":"2024-09-16T14:42:41.000Z","dependencies_parsed_at":"2024-10-27T09:13:01.042Z","dependency_job_id":null,"html_url":"https://github.com/rudifa/RudifaUtilPkg","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudifa%2FRudifaUtilPkg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudifa%2FRudifaUtilPkg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudifa%2FRudifaUtilPkg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudifa%2FRudifaUtilPkg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rudifa","download_url":"https://codeload.github.com/rudifa/RudifaUtilPkg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806122,"owners_count":20350773,"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-10-06T01:41:49.405Z","updated_at":"2025-03-16T05:31:02.510Z","avatar_url":"https://github.com/rudifa.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RudifaUtilPkg \u0026nbsp; \u0026nbsp;\n\n![XCtests](https://github.com/rudifa/RudifaUtilPkg/workflows/build_and_test/badge.svg)\n![XCtests](https://github.com/rudifa/RudifaUtilPkg/workflows/build_jazzy_docs/badge.svg)\n\n[RudifaUtilPkg](https://rudifa.github.io/RudifaUtilPkg/) contains swift extensions and utility methods.\n\n\n## Highlights\n\n### FileBackedDictionary\n\n\n `struct FileBackedDictionary`  encapsulates a `[String:T]` dictionary whose values are automatically persisted, each in its own file.\n\n `FileBackedDictionary` exposes methods and properties similar to those of the Swift Dictionary.\n\n At its initialization (typically at the application start), an instance of `FileBackedDictionary` recovers the keys and values from the file storage (if any have been stored in previous application runs).\n\n### Usage examples ###\n\n Create a `FileBackedDictionary` instance, with a directory named `MyResources` and `struct Resource` as type of the values to store.\n\n```\n        let directoryName = \"MyResources\"\n        var fbDict = FileBackedDictionary\u003cResource\u003e(directoryName: directoryName)\n```\n\n Add `Resource` instances\n\n```\n        fbDict[\"apples\"] = Resource(name: \"apples\", value: 1, quantity: 1)\n        fbDict[\"oranges\"] = Resource(name: \"oranges\", value: 2, quantity: 2)\n        fbDict[\"mangos\"] = Resource(name: \"mangos\", value: 3, quantity: 3)\n```\n\n Look up the resource info\n\n```\n        let count = fbDict.count\t\t\t// 3\n        let keys = fbDict.keys\t\t\t// [\"apples\", \"oranges\", \"mangos\"])\n        let values = fbDict.values \t\t// [...]\n        let myOranges = fbDict[\"oranges\"]\n```\n\n Remove resources\n\n```\n        fbDict[\"oranges\"] = nil\n        fbDict.removeAll()\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudifa%2Frudifautilpkg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frudifa%2Frudifautilpkg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudifa%2Frudifautilpkg/lists"}