{"id":22153598,"url":"https://github.com/kamranaghlami/libtlvcpp","last_synced_at":"2025-07-07T11:06:20.130Z","repository":{"id":219154587,"uuid":"726367934","full_name":"KamranAghlami/libtlvcpp","owner":"KamranAghlami","description":"libtlvcpp is a modern C++ ASN.1 tree manipulating \u0026 encoding/decoding library with a focus on performance, and a clean interface.","archived":false,"fork":false,"pushed_at":"2024-09-15T19:26:30.000Z","size":82,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T22:23:00.262Z","etag":null,"topics":["asn1","cpp","deserializer","modern-cpp","serializer"],"latest_commit_sha":null,"homepage":"","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/KamranAghlami.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":"2023-12-02T07:13:45.000Z","updated_at":"2025-01-22T15:24:56.000Z","dependencies_parsed_at":"2024-04-25T19:36:07.158Z","dependency_job_id":"9d4c490f-d21d-44af-aebe-246f09170dc0","html_url":"https://github.com/KamranAghlami/libtlvcpp","commit_stats":null,"previous_names":["kamranaghlami/libtlvcpp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KamranAghlami/libtlvcpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KamranAghlami%2Flibtlvcpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KamranAghlami%2Flibtlvcpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KamranAghlami%2Flibtlvcpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KamranAghlami%2Flibtlvcpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KamranAghlami","download_url":"https://codeload.github.com/KamranAghlami/libtlvcpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KamranAghlami%2Flibtlvcpp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264067137,"owners_count":23552150,"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":["asn1","cpp","deserializer","modern-cpp","serializer"],"created_at":"2024-12-02T01:22:19.761Z","updated_at":"2025-07-07T11:06:20.066Z","avatar_url":"https://github.com/KamranAghlami.png","language":"C++","readme":"# libtlvcpp\n\n`libtlvcpp` is a modern C++ ASN.1 tree manipulating \u0026 encoding/decoding library with a focus on a clean interface and automatic memory management. The library consists of three main components: `tree_node`, `tlv`, and `tlv_tree_node`. The `tree_node` represents a generic tree structure, `tlv` represents a TLV element, and `tlv_tree_node` is a specialized tree node for TLV elements.\n\n## Features\n\n- **Clean Interface**: Provides a simple and intuitive interface for working with TLV data structures.\n- **Automatic Memory Management**: Utilizes modern C++ features to handle memory management automatically.\n- **Flexible Tree Structure**: The `tree_node` class allows you to create a flexible tree structure for organizing TLV elements.\n- **Works on**: Windows, Linux, macOS, ESP-IDF, and Webassembly using Emscripten.\n\n## Usage\n\n### Including the Library\n\n```cpp\n#include \"tlv_tree.h\"\n```\n\n### Creating a TLV Tree\n\n```cpp\n// Create a TLV tree node\ntlvcpp::tlv_tree_node root;\n\n// Add TLV elements to the tree\nroot.add_child(1, \"Value1\");\nauto\u0026 childNode = root.add_child(2, \"Value2\");\n\n// Add child elements to a node\nchildNode.add_child(3, \"Value3\");\n\n// Dump the tree structure\nroot.dump();\n```\n\n### Serializing and Deserializing\n\n```cpp\n// Serialize the TLV tree to a vector\nstd::vector\u003cuint8_t\u003e buffer;\nroot.serialize(buffer);\n\n// Deserialize the TLV tree from a vector\ntlvcpp::tlv_tree_node newRoot;\nnewRoot.deserialize(buffer);\n```\n\n### Finding Elements\n\n```cpp\n// Find a TLV element by tag\ntlvcpp::tlv* foundElement = root.find(2);\n\n// Find an immediate child TLV element by tag\ntlvcpp::tlv* foundImmediateElement = root.find_immediate(2);\n```\n\n## Build Process\n\n`libtlvcpp` uses CMake for its build process. Follow these steps to build the library:\n\n1. Create a build directory:\n\n   ```bash\n   mkdir build\n   cd build\n   ```\n\n2. Generate build files with CMake:\n\n   ```bash\n   cmake ..\n   ```\n\n3. Build the library:\n\n   ```bash\n   cmake --build .\n   ```\n\n## License\n\nThis library is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nFeel free to contribute by opening issues or pull requests on the [GitHub repository](https://github.com/your-username/libtlvcpp).\n\nHappy coding!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamranaghlami%2Flibtlvcpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamranaghlami%2Flibtlvcpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamranaghlami%2Flibtlvcpp/lists"}