{"id":25665328,"url":"https://github.com/puppetlabs/cpp-hocon","last_synced_at":"2025-08-25T17:05:44.202Z","repository":{"id":35533484,"uuid":"39804492","full_name":"puppetlabs/cpp-hocon","owner":"puppetlabs","description":"A C++ port of the Typesafe Config library.","archived":false,"fork":false,"pushed_at":"2025-01-14T23:54:27.000Z","size":1248,"stargazers_count":83,"open_issues_count":0,"forks_count":57,"subscribers_count":151,"default_branch":"master","last_synced_at":"2025-05-24T20:05:49.201Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/puppetlabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-28T00:23:00.000Z","updated_at":"2025-03-05T04:28:05.000Z","dependencies_parsed_at":"2025-01-19T22:43:23.658Z","dependency_job_id":null,"html_url":"https://github.com/puppetlabs/cpp-hocon","commit_stats":{"total_commits":195,"total_committers":34,"mean_commits":5.735294117647059,"dds":0.6820512820512821,"last_synced_commit":"aea1f52b33c3222f13e002550256558d01021d1d"},"previous_names":["puppetlabs-toy-chest/cpp-hocon","puppetlabs/cpp-hocon"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/puppetlabs/cpp-hocon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fcpp-hocon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fcpp-hocon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fcpp-hocon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fcpp-hocon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/puppetlabs","download_url":"https://codeload.github.com/puppetlabs/cpp-hocon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Fcpp-hocon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272100683,"owners_count":24873442,"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","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"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":[],"created_at":"2025-02-24T07:08:53.339Z","updated_at":"2025-08-25T17:05:44.103Z","avatar_url":"https://github.com/puppetlabs.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C++ HOCON Parser\n\nThis repository is archived and Perforce will no longer be updating this repository. For more information, see [this Puppet blog post](https://www.puppet.com/blog/open-source-puppet-updates-2025).\n\n![Travis CI](https://travis-ci.org/puppetlabs/cpp-hocon.svg)\n![Appveyor](https://ci.appveyor.com/api/projects/status/github/puppetlabs/cpp-hocon?svg=true)\n\nThis is a port of the TypesafeConfig library to C++.\n\nThe library provides C++ support for the [HOCON configuration file format](https://github.com/typesafehub/config/blob/master/HOCON.md).\n\n```\n          MMMMMMMMMMMMMMMMMMMM\n         .====================.\n         MMMMMMMMMMMMMMMMMMMMMM\n        .MMMMMMMMMMMMMMMMMMMMMM.\n    ===.7MMMIN7NMMMMMMMMM7M=MMMM,===\n    MMM.7MM:     DMMMMM7    :MMM=MMM\n    MMM.7MM,     DMMMMM?    ~MMM=MMM\n    MMM.7MMM~++~?MMMMMMM~++~MMMM=MMM\n        .MMMMMMMMMMMMMMMMMMMMMM.\n         MMMMMMMMMMMMMMMMMMMMMM\n         MMMMMMMMMMMMMMMMMMMMMM\n         MMM      HOCON     MMM\n         MMMMMMMMMMMMMMMMMMMMMM\n          .MMMMMMMMMMMMMMMMMM.\n          .MMMMMMMMMMMMMMMMMM.\n       .MMMMMMMMMMMMMMMMMMMMMMMM\n .    MMMMMMMMMMMMM88MMMMMMMMMM8MM    .\n7=MMMMMMMM++ A CONFIG FILE  ++M8MMMMMM7=\nM=MMMMMMMM+ FORMAT DESIGNED  +M8MMMMMM7M\nM=MMMMMMMM++  FOR HUMANS   ++M8MMMMMM7M\n =MMMMMMMMMMMMMMMMM88MMMMMMMMMM8MMMMMM7\n  7MM.88MMMMMMMMMMM88MMMMMMMMMMO88 MM8\n  7MM   MMMMMMMMMMM88MMMMMMMMMM8   MM8\n  7MM   MMMMMMMMMMM88MMMMMMMMMM8   MM8\n  7MM   MMMDMMMM?MM88MM?MMMMOMM8   MM8\n```\n\nTo get started, [install it](#install), then to parse a file:\n```\n#include \u003chocon/parser/config_document_factory.hpp\u003e\n#include \u003cfstream\u003e\n\nusing hocon::config_document_factory::parse_file;\n\nint main(int argc, char** argv) {\n    auto doc = parse_file(\"file.conf\");\n    doc = doc-\u003ewith_value_text(\"a\", \"42\");\n\n    std::ofstream out(\"file.conf\");\n    out \u003c\u003c doc-\u003erender();\n    return 0;\n}\n```\n\nIf you build cpp-hocon with `-DBUILD_SHARED_LIBS=ON`, then the example can be built with\n```\nc++ example.cc -o example -std=c++11 -lcpp-hocon\n```\n\nYou can use `hocon::config_document_factory::parse_string` to parse a string. [config_document](lib/inc/hocon/parser/config_document.hpp) is used to modify a file while preserving all formatting. Use [config](lib/inc/hocon/config.hpp) to read from the config or if you don't care about preserving formatting.\n\nNote that file extensions matter. A `.conf` file will be parsed as HOCON, a `.json` file will be parsed as JSON, and other extensions will be ignored.\n\nSee the [docs](https://puppetlabs.github.io/cpp-hocon) for more.\n\n## Caveats\n\nThis is a mostly complete implementation of the HOCON format. It currently has some known limitations\n\n* Include requires the location specifier, i.e. `include \"foo\"` won't work but `include file(\"foo\")` will. URL is not yet implemented, and classpath won't be supported as it makes less sense outside of the JVM.\n* Unicode testing is absent so support is unknown. There are likely things that won't work.\n\n## Install\n\n### Build Requirements\n\n* OSX or Linux\n* GCC \u003e= 4.8 or Clang \u003e= 3.4 (with libc++)\n* CMake \u003e= 3.2.2\n* Boost Libraries \u003e= 1.54\n* [Leatherman](https://github.com/puppetlabs/leatherman)\n\n### Pre-Build\n\nPrepare the cmake release environment:\n\n    $ mkdir release\n    $ cd release\n    $ cmake ..\n\nOptionally, also prepare the debug environment:\n\n    $ mkdir debug\n    $ cd debug\n    $ cmake -DCMAKE_BUILD_TYPE=Debug ..\n\n### Building\n\n1. Enter your build environment of choice, i.e. `cd release` or `cd debug`\n2. `make`\n3. (optional) install with `make install`\n\n### Testing\n\nRun tests with `make test`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuppetlabs%2Fcpp-hocon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpuppetlabs%2Fcpp-hocon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuppetlabs%2Fcpp-hocon/lists"}