{"id":26235171,"url":"https://github.com/hedzr/trie-cxx","last_synced_at":"2026-04-25T00:37:10.278Z","repository":{"id":269762731,"uuid":"908389500","full_name":"hedzr/trie-cxx","owner":"hedzr","description":"a trie-tree in c++17/c++20, template and header only","archived":false,"fork":false,"pushed_at":"2026-03-06T00:21:18.000Z","size":215,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-06T04:33:24.732Z","etag":null,"topics":["config","configuration","configuration-management","cpp17","cpp20","cpp20-lib","cpp20-library","key-value-store","trie-tree"],"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/hedzr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","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},"funding":{"custom":"https://paypal.me/hezr/5"}},"created_at":"2024-12-26T00:30:30.000Z","updated_at":"2026-03-06T00:21:21.000Z","dependencies_parsed_at":"2024-12-26T01:20:35.104Z","dependency_job_id":"0bd11c91-ff43-401f-a5cf-00ce4317835c","html_url":"https://github.com/hedzr/trie-cxx","commit_stats":null,"previous_names":["hedzr/trie-cxx"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/hedzr/trie-cxx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedzr%2Ftrie-cxx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedzr%2Ftrie-cxx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedzr%2Ftrie-cxx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedzr%2Ftrie-cxx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hedzr","download_url":"https://codeload.github.com/hedzr/trie-cxx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedzr%2Ftrie-cxx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32246396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"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":["config","configuration","configuration-management","cpp17","cpp20","cpp20-lib","cpp20-library","key-value-store","trie-tree"],"created_at":"2025-03-13T02:35:22.095Z","updated_at":"2026-04-25T00:37:10.260Z","avatar_url":"https://github.com/hedzr.png","language":"C++","funding_links":["https://paypal.me/hezr/5"],"categories":[],"sub_categories":[],"readme":"# trie-cxx and store-cxx\n\n[![CMake Build Matrix](https://github.com/hedzr/trie-cxx/actions/workflows/cmake.yml/badge.svg)](https://github.com/hedzr/trie-cxx/actions/workflows/cmake.yml)\n[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/hedzr/trie-cxx.svg?label=release)](https://github.com/hedzr/trie-cxx/releases)\n\n`trie-cxx` is a c++20 header-only library, which implements a extensible Trie-tree container.\n\n`trie-cxx` allows accessing the target node data via a dotted key path. This is almost a in-memory key-value store.\n\n## Features\n\nThe released codes allowes the extras data attached to the Trie-tree nodes/leaves, such as data (with any type), comment, descriptions, and tags, etc..\n\n```cpp\nauto build_trie() -\u003e trie::trie_t\u003ctrie::value_t\u003e {\n\ttrie::trie_t\u003ctrie::value_t\u003e tt;\n\n\ttt.set(\"app.debug\", true);\n\ttt.set(\"app.verbose\", true);\n\ttt.set(\"app.dump\", 3);\n\ttt.set(\"app.logging.file\", \"~/.trie.log\");\n\ttt.set(\"app.server.start\", 5);\n\ttt.set(\"app.logging.rotate\", (unsigned long) (6));\n\t// tt.set(\"app.logging.words\", std::vector\u003cstd::string\u003e{\"a\", 1, false});\n\ttt.set(\"app.logging.words\", std::vector\u003cstd::string\u003e{\"a\", \"1\", \"false\"});\n\ttt.set(\"app.server.sites\", 1);\n\tfloat f = 2.718f;\n\ttt.set(\"app.ref-types.float\", std::move(f));\n\ttt.set(\"app.ref-types.double\", M_PI);\n\ttt.set(\"app.ref-types.string\", std::string(\"hello, trie.\"));\n\ttt.set(\"app.ref-types.intvec\", std::vector\u003cint\u003e{3, 5, 7, 9});\n\n\treturn tt;\n}\n```\n\nHere is an earlier pre-release for sharing the common codes and structures in my mind.\nIt's certain an unstable encapsulations, which might be updated in the future.\nThese codes are and will be released under Apache 2.0 for free. So referring to it or copying from it would be okay.\n\n## For Developers\n\n`trie-cxx` needs a c++-20 compliant compiler such as gcc-13.\n\nFrom v0.3.1, `trie-cxx` was compiled passed under macOS (clang), Linux (gcc-13) and Windows (msvc).\n\n### CMake Standard\n\ntrie-cxx is findable via CMake Modules.\n\nYou could install trie-cxx manually:\n\n```bash\ngit clone https://github.com/hedzr/trie-cxx.git\ncd trie-cxx\ncmake -DCMAKE_VERBOSE_DEBUG=ON -DCMAKE_AUTOMATE_TESTS=OFF -S . -B build/ -G Ninja\n# Or:\n#    cmake -S . -B build/\ncmake --build build/\ncmake --install build/\n# Or:\n#   cmake --build build/ --target install\n#\n# Sometimes sudo it:\n#   sudo cmake --build build/ --target install\n# Or:\n#   cmake --install build/ --prefix ./dist/install --strip\n#   sudo cp -R ./dist/install/include/* /usr/local/include/\n#   sudo cp -R ./dist/install/lib/cmake/* /usr/local/lib/cmake/\nrm -rf ./build\ncd ..\n```\n\n### More cmake commands\n\n```bash\n# clean (all targets files, but the immedieted files)\ncmake --build build/ --target clean\n# clean and build (just relinking all targets without recompiling)\ncmake --build build/ --clean-first\n\n# clean deeply\nrm -rf build/\n\n# clean deeply since cmake 3.24.0\n# (your custom settings from command-line will lost.\n#   For example, if you ever run `cmake -DCMAKE_VERBOSE_DEBUG=ON -S . -B build',\n#   and now cmake --fresh -B build/ will ignore `CMAKE_VERBOSE_DEBUG = ON' \n#   and reconfigure to default state.\n# )\ncmake --fresh -B build/\n\n# recompiling and relinking (simply passing `-B' to `make')\ncmake --build build/ -- -B\n\n# reconfigure\nrm ./build/CMakeCache.txt \u0026\u0026 cmake -DENABLE_AUTOMATE_TESTS=OFF -S . -B build/\n\n# print compiling command before exeuting them\ncmake --build build/ -- VERBOSE=1\n# Or:\nVERBOSE=1 cmake --build build/\n# Or:\ncmake --build build --verbose\n\n# Run CTest\ncmake -E chdir build ctest\n# Run a special ctest\ncmake -E chdir build ctest -R name_of_your_test\n```\n\ndetect running in CTest by env var `CTEST_INTERACTIVE_DEBUG_MODE`:\n\n```c++\n#include \u003cstdlib.h\u003e\nchar const *ev1 = getenv(\"CTEST_INTERACTIVE_DEBUG_MODE\");\nif (ev1 \u0026\u0026 (*ev1 == '0' || *ev1 == '1'))\n    return 0;\n```\n\n### Preparing Catch2 v3.x\n\nfor testing, catch2 v3.7+ is necessary.\n\nopenSUSE,\n\n```bash\nsudo zypper install catch2-devel # don't install catch2-2-devel\n```\n\nUbuntu 22.04/24.04,\n\n```bash\ngit clone -b v3.7.1 https://github.com/catchorg/Catch2.git\ncd Catch2\nmkdir build\ncmake -S . -B build\ncmake --build build\ncmake --install build --prefix ./dist/install --strip\nsudo cp -R ./dist/install/include/* /usr/local/include/\nsudo cp -R ./dist/install/lib/cmake/* /usr/local/lib/cmake/\n```\n\nmacOS,\n\n```bash\nbrew install catch2\n```\n\nWindows (x86_64)\n\n```powershell\nvcpkg install catch2:x64-windows\n```\n\nIf catch2 not installed via package manager, cmake will try downloading it from github and use it as a child target.\n\n## License\n\nApache 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhedzr%2Ftrie-cxx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhedzr%2Ftrie-cxx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhedzr%2Ftrie-cxx/lists"}