nginxconfig
C++libraryforparsingandprintingnginx.conf
|
00001 00012 #ifndef __NGINXCONFIG_PARSE_HPP_INCLUDED__ 00013 #define __NGINXCONFIG_PARSE_HPP_INCLUDED__ 00014 00015 #include <nginxconfig/config.hpp> 00016 00017 #include <iosfwd> 00018 #include <string> 00019 #include <stdexcept> 00020 00021 namespace nginxconfig 00022 { 00023 00024 class ast_entry; 00025 00026 class NGINXCONFIG_PUBLIC parse_error : 00027 public std::runtime_error 00028 { 00029 public: 00030 using size_type = std::size_t; 00031 00035 static constexpr size_type no_column = ~0; 00036 00037 public: 00038 explicit parse_error(size_type line, size_type column, size_type character, std::string message); 00039 00040 virtual ~parse_error() noexcept; 00041 00043 size_type line() const { return _line; } 00044 00046 size_type column() const { return _column; } 00047 00049 size_type character() const { return _character; } 00050 00052 const std::string& message() const { return _message; } 00053 00054 private: 00055 size_type _line; 00056 size_type _column; 00057 size_type _character; 00058 std::string _message; 00059 }; 00060 00062 ast_entry parse(std::istream& input); 00063 00065 ast_entry parse_file(const std::string& filename); 00066 00067 } 00068 00069 #endif/*__NGINXCONFIG_PARSE_HPP_INCLUDED__*/