|
||||
File indexing completed on 2025-01-18 09:53:27
0001 // 0002 // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) 0003 // 0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying 0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 0006 // 0007 // Official repository: https://github.com/boostorg/url 0008 // 0009 0010 #ifndef BOOST_URL_GRAMMAR_ERROR_HPP 0011 #define BOOST_URL_GRAMMAR_ERROR_HPP 0012 0013 #include <boost/url/detail/config.hpp> 0014 #include <boost/url/error_types.hpp> 0015 0016 namespace boost { 0017 namespace urls { 0018 namespace grammar { 0019 0020 /** Error codes returned when using rules 0021 0022 @see 0023 @ref condition, 0024 @ref parse. 0025 */ 0026 enum class error 0027 { 0028 // VFALCO 3 space indent or 0029 // else Doxygen malfunctions 0030 0031 // 0032 // (informational) 0033 // 0034 0035 /** 0036 * More input is needed to match the rule 0037 * 0038 * A rule reached the end of the input, 0039 * resulting in a partial match. The error 0040 * is recoverable; the caller may obtain 0041 * more input if possible and attempt to 0042 * parse the character buffer again. 0043 * Custom rules should only return this 0044 * error if it is completely unambiguous 0045 * that the rule cannot be matched without 0046 * more input. 0047 */ 0048 need_more = 1, 0049 0050 /** 0051 * The rule did not match the input. 0052 * 0053 * This error is returned when a rule fails 0054 * to match the input. The error is recoverable; 0055 * the caller may rewind the input pointer and 0056 * attempt to parse again using a different rule. 0057 */ 0058 mismatch, 0059 0060 /** 0061 * A rule reached the end of a range 0062 * 0063 * This indicates that the input was consumed 0064 * when parsing a @ref range. The @ref range_rule 0065 * avoids rewinding the input buffer when 0066 * this error is returned. Thus the consumed 0067 * characters are be considered part of the 0068 * range without contributing additional 0069 * elements. 0070 */ 0071 end_of_range, 0072 0073 /** 0074 * Leftover input remaining after match. 0075 */ 0076 leftover, 0077 0078 //-------------------------------------------- 0079 // 0080 // condition::fatal 0081 // 0082 //-------------------------------------------- 0083 0084 /** 0085 * A rule encountered unrecoverable invalid input. 0086 * 0087 * This error is returned when input is matching 0088 * but one of the requirements is violated. For 0089 * example if a percent escape is found, but 0090 * one or both characters that follow are not 0091 * valid hexadecimal digits. This is usually an 0092 * unrecoverable error. 0093 */ 0094 invalid, 0095 0096 /** An integer overflowed during parsing. 0097 */ 0098 out_of_range, 0099 0100 /** 0101 * An unspecified syntax error was found. 0102 */ 0103 syntax 0104 }; 0105 0106 //------------------------------------------------ 0107 0108 /** Error conditions for errors received from rules 0109 0110 @see 0111 @ref error, 0112 @ref parse. 0113 */ 0114 enum class condition 0115 { 0116 /** 0117 * A fatal error in syntax was encountered. 0118 0119 This indicates that parsing cannot continue. 0120 */ 0121 fatal = 1 0122 }; 0123 0124 } // grammar 0125 } // urls 0126 } // boost 0127 0128 #include <boost/url/grammar/impl/error.hpp> 0129 0130 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |