项目作者: cjgdev

项目描述 :
A C++, header-only, standard compliant HTTP request parser 👻
高级语言: C++
项目地址: git://github.com/cjgdev/hyperspirit.git
创建时间: 2017-05-05T17:08:38Z
项目社区:https://github.com/cjgdev/hyperspirit

开源协议:Other

下载


hyperspirit

A header-only, RFC compliant, HTTP parser in C++

Overview

Hyperspirit is built with Boost.Spirit (“hypertext transfer protocol” + “boost spirit” = hyperspirit), a library for
creating parser grammars.

Features:

  • Dependent only on Boost (1.46+).
  • Runtime performance of a recursive descent parser.

How to Build

There is no build step required as the library is header-only, but the following steps can be followed to build the unit
test suite.

Requirements

  • CMake
  • Boost 1.46+

OSX

  1. brew install cmake boost

Debian

  1. # apt-get install cmake libboost

RHEL (5 or above)

  1. # yum install cmake libboost

Instructions

  1. $ git clone git@github.com:cjgdev/hyperspirit.git
  2. $ mkdir build && cd build
  3. $ cmake ../ && make test

Usage

  1. #include <hyperspirit/hyperspirit.hpp>
  2. namespace hyperspirit::http = http;
  3. // ...
  4. // parse the `input` string
  5. http::request req;
  6. http::request_parser<string::const_iterator> grammar;
  7. if (parse(input.begin(), input.end(), grammar, data)) {
  8. // the parsed data is in `req`
  9. }

Documentation

Please refer to the wiki for the latest documentation.

Authors

License

The library is licensed under the BSD license. A copy can be found here.