{"id":18546065,"url":"https://github.com/coralkashri/file-pool","last_synced_at":"2026-07-08T16:31:09.552Z","repository":{"id":132160839,"uuid":"144337989","full_name":"coralkashri/file-pool","owner":"coralkashri","description":"Files manager api for c++","archived":false,"fork":false,"pushed_at":"2019-10-13T09:55:57.000Z","size":135,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T06:08:00.914Z","etag":null,"topics":["api","cpp","cpp11","files","manager"],"latest_commit_sha":null,"homepage":null,"language":"C++","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/coralkashri.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":"2018-08-10T22:36:00.000Z","updated_at":"2019-10-13T09:56:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"a77f22b4-ae86-46aa-894d-3829051ea46a","html_url":"https://github.com/coralkashri/file-pool","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/coralkashri/file-pool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coralkashri%2Ffile-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coralkashri%2Ffile-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coralkashri%2Ffile-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coralkashri%2Ffile-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coralkashri","download_url":"https://codeload.github.com/coralkashri/file-pool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coralkashri%2Ffile-pool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35271852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","response_time":61,"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":["api","cpp","cpp11","files","manager"],"created_at":"2024-11-06T20:23:28.272Z","updated_at":"2026-07-08T16:31:09.535Z","avatar_url":"https://github.com/coralkashri.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FilePool C++\nFilePool gives you an easy files collection manager, which take care for all of ifstream, ofstream issues. An easy way to read and write complex and simple structures to files in C++.\n\n## OS\nThis API built in linux os (ubuntu 16.04) and haven't been checked on other OS.\n\n## Examples\n#### Simple use - write and read single simple value\nInit FilesManager object:\n```cpp\nFilesManager fm;\nfm.add(\"fileID\", \"../TestFiles/test_file.bin\");\n```\nWrite data\n```cpp\nint a = 12, b;\nfm.get(\"fileID\").write(\u0026a);\n```\nRead data\n```cpp\nfm.get(\"fileID\").read(\u0026b);\ncout \u003c\u003c b \u003c\u003c endl; // 12\n```\n\n#### Simple use - write and read single simple value using operators\nInit FilesManager object:\n```cpp\nFilesManager fm;\nfm[\"fileID\"] = \"../TestFiles/test_file.bin\";\n```\nWrite data\n```cpp\nint a = 12, b;\n//Option 1\nfm[\"fileID\"] \u003c\u003c rw_s\u003cint\u003e(\u0026a/*, 1 \u003cdefault is 1\u003e*/);\n//Option 2\nfm[\"fileID\"] \u003c\u003c rw_s\u003cint\u003e(a);\n//Option 3\nfm[\"fileID\"] \u003c\u003c rw_soft(\u0026a);\n//Option 4 (Recommended)\nfm[\"fileID\"] \u003c\u003c rw_soft(a);\n```\nRead data\n```cpp\n// As same as Write, but with operator \u003e\u003e\nfm[\"fileID\"] \u003e\u003e rw_soft(b);\ncout \u003c\u003c b \u003c\u003c endl; // 12\n```\n\n#### Simple use - write and read single vector using operators\nWrite data\n```cpp\nvector\u003cint\u003e a = {1, 2, 3};\nvector\u003cint\u003e b(a.size());\nfm[\"fileID\"] \u003c\u003c a;\n```\nRead data\n```cpp\nfm[\"fileID\"] \u003e\u003e b;\nfor (auto\u0026 val : b) {\n    cout \u003c\u003c val \u003c\u003c \" \";\n} // 1 2 3\n```\n\n#### Simple use - remove file from manager object\nInsert file to manager\n```cpp\nFilesManager fm;\nfm.add(\"5\", \"../TestFiles/test_file.bin\");\n```\nWrite/Read methods\n```cpp\nint a = 12;\nint b;\nfm.get(\"5\") \u003c\u003c rw_soft(a); // Work\nfm.get(\"5\").write(\u0026a); // Work\nfm.get(\"5\") \u003e\u003e rw_soft(b); // Work\ncout \u003c\u003c b \u003c\u003c endl; // Prints 12\n```\nRemove file from manager\n```cpp\nfm.remove(\"5\");\n```\nTry Write/Read methods\n```cpp\nfm.get(\"5\") \u003c\u003c rw_soft(a); // Error\nfm.get(\"5\").write(\u0026a); // Error\nfm.get(\"5\") \u003e\u003e rw_soft(b); // Error\n```\n\n#### Simple use - remove file from manager object using operators\nInsert file to manager\n```cpp\nFilesManager fm(false, 0, \"../TestFiles/\");\nfm += add_data(\"5\", \"test_file.bin\");\n```\nRemove file from manager\n```cpp\nfm -= \"5\";\n```\n\n#### Use case - Insert multiple data to file and read into array or into vector\nWrite data to file\n```cpp\nfm[\"2\"].init_read_write_mode(ReadWriteMode::MULTIPLE);\nconst size_t array_size = 100;\nfor (size_t i = 0; i \u003c array_size; i++) {\n    fm[\"2\"] \u003c\u003c rw_soft(i);\n}\n```\nRead data to array\n```cpp\nsize_t b[array_size];\nfm[\"2\"].init_read_write_mode(ReadWriteMode::SINGLE_AND_DONE);\n// Option 1\nfm[\"2\"] \u003e\u003e rw_soft(b, array_size);\n// Option 2\nfm[\"2\"] \u003e\u003e rw_soft(*b, array_size);\n// Option 3\nfm[\"2\"] \u003e\u003e rw_soft(b[0], array_size);\n// Option 4 - Read with offset from the array\nsize_t offset = 5;\nfm[\"2\"] \u003e\u003e rw_soft(b[offset], array_size - offset);\nfor (size_t i = 0; i \u003c array_size - offset; i++) {\n    cout \u003c\u003c b[offset + i] \u003c\u003c \" \";\n} // 0...99 (Or with offset - 0...(99-offset))\n```\nRead data to vector\n```cpp\nvector\u003csize_t\u003e c(array_size);\nfm[\"2\"] \u003e\u003e c;\nfor (size_t i = 0; i \u003c array_size; i++) {\n    cout \u003c\u003c c[i] \u003c\u003c \" \";\n} // 0...99\n```\n\n#### Use case - Write and read vector of vectors\nInit vectors\n```cpp\nFile f(\"../TestFiles/test_file.bin\");\nvector\u003cvector\u003ccomplex\u003cfloat\u003e\u003e\u003e wdata = {\n        {{1, 9}, {3, 75}, {213.34, 21.4}, {153.1, 15.85}},\n        {{1, 2}, {3, 4},  {5,      6},    {7,     8.156}},\n        {{1, 9}, {3, 75}, {213.34, 21.4}, {153.1, 15.85}},\n        {{1, 9}, {3, 75}, {213.34, 21.4}, {153.1, 15.85}},\n        {{1, 9}, {3, 75}, {213.34, 21.4}, {153.1, 15.85}},\n        {{1, 9}, {3, 75}, {9999,   21.4}, {153.1, 15.85}},\n        {{1, 2}, {3, 4},  {5,      6},    {7,     8.156}}\n};\nvector\u003cvector\u003ccomplex\u003cfloat\u003e\u003e\u003e rdata(wdata.size());\nfor (size_t i = 0; i \u003c wdata.size(); i++) {\n    rdata[i] = vector\u003ccomplex\u003cfloat\u003e\u003e(wdata[i].size());\n}\n```\nWrite to file\n```cpp\n//f.init_read_write_mode(ReadWriteMode::SINGLE_AND_DONE); // not necessary\nf \u003c\u003c wdata;\n```\nRead from file\n```cpp\n//f.init_read_write_mode(ReadWriteMode::SINGLE_AND_DONE); // not necessary\nf \u003e\u003e rdata;\n```\nPrint values\n```cpp\nfor (size_t i = 0; i \u003c rdata.size(); i++) {\n    for (size_t k = 0; k \u003c rdata[i].size(); k++) {\n        cout \u003c\u003c rdata[i][k] \u003c\u003c endl;\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoralkashri%2Ffile-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoralkashri%2Ffile-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoralkashri%2Ffile-pool/lists"}