Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Ruin0x11/microhcl
C++14 header-only parser for HCL (Hashicorp Configuration Language)
https://github.com/Ruin0x11/microhcl
hcl
Last synced: 6 days ago
JSON representation
C++14 header-only parser for HCL (Hashicorp Configuration Language)
- Host: GitHub
- URL: https://github.com/Ruin0x11/microhcl
- Owner: Ruin0x11
- License: mit
- Created: 2018-05-26T03:15:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-03T02:58:30.000Z (over 6 years ago)
- Last Synced: 2024-10-15T06:07:24.925Z (30 days ago)
- Topics: hcl
- Language: C++
- Homepage:
- Size: 135 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# microhcl [![AppVeyor Build Status][appveyor-build-status-svg]][appveyor-build-status] [![Travis CI Build Status][travis-build-status-svg]][travis-build-status]
C++14 header-only parser for the [Hashicorp Configuration Language](https://www.github.com/hashicorp/hcl).## Requirements
- C++14-compliant compiler
- CMake >= 2.8.12## Usage
```c++
std::ifstream ifs("foo.hcl");
hcl::ParseResult parseResult = hcl::parse(ifs);if (!parseResult.valid()) {
std::cout << parseResult.errorReason << std::endl;
return;
}const hcl::Value& value = parseResult.value;
```## Running the tests
```
mkdir out/Debug
cd out/Debug
cmake ../../tests
make
./test_runner
```## Incompatibilities
- Block comments are unsupported.
- Negative float numbers without a leading 0 are not recognized.
- Some unprintable escape sequences (like `\a`) are not recognized.
- Object items can be output in any order when writing. (can be turned off by passing `MICROHCL_USE_MAP` as a compile definition)
- Comments are not preserved when writing.
- There are currently no implicit type conversions. The type retrieved must be the one specified in the original HCL code.[appveyor-build-status]: https://ci.appveyor.com/project/Ruin0x11/microhcl/branch/master
[appveyor-build-status-svg]: https://ci.appveyor.com/api/projects/status/fi2su01yo2eah7wf/branch/master?svg=true
[travis-build-status]: https://travis-ci.org/Ruin0x11/microhcl?branch=master
[travis-build-status-svg]: https://travis-ci.org/Ruin0x11/microhcl.svg?branch=master