jmespath.cpp
C++ implementation of JMESPath, a query language for JSON http://jmespath.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
exceptions.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Author: Róbert Márki <gsmiko@gmail.com>
4 ** Copyright (c) 2016 Róbert Márki
5 **
6 ** This file is part of the jmespath.cpp project which is distributed under
7 ** the MIT License (MIT).
8 **
9 ** Permission is hereby granted, free of charge, to any person obtaining a copy
10 ** of this software and associated documentation files (the "Software"), to
11 ** deal in the Software without restriction, including without limitation the
12 ** rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
13 ** sell copies of the Software, and to permit persons to whom the Software is
14 ** furnished to do so, subject to the following conditions:
15 **
16 ** The above copyright notice and this permission notice shall be included in
17 ** all copies or substantial portions of the Software.
18 **
19 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 ** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 ** DEALINGS IN THE SOFTWARE.
26 **
27 ****************************************************************************/
28 #ifndef EXCEPTIONS_H
29 #define EXCEPTIONS_H
30 #include <stdexcept>
31 #include <boost/exception/all.hpp>
32 
33 namespace jmespath {
43  = boost::error_info<struct tag_search_expression, std::string>;
50  = boost::error_info<struct tag_syntax_error_location, long>;
55 using InfoFunctionName
56  = boost::error_info<struct tag_function_name, std::string>;
57 
67 struct Exception : virtual boost::exception, virtual std::exception
68 {
69 private:
73  virtual void anchor();
74 };
80 struct SyntaxError : virtual Exception
81 {
82 private:
86  virtual void anchor();
87 };
93 struct InvalidAgrument : virtual Exception
94 {
95 private:
99  virtual void anchor();
100 };
106 struct InvalidValue : virtual Exception
107 {
108 private:
112  virtual void anchor();
113 };
119 struct UnknownFunction : virtual Exception
120 {
121 private:
125  virtual void anchor();
126 };
133 {
134 private:
138  virtual void anchor();
139 };
146 {
147 private:
151  virtual void anchor();
152 };
153 } // namespace jmespath
154 #endif // EXCEPTIONS_H
boost::error_info< struct tag_function_name, std::string > InfoFunctionName
InfoFunctionName contains the name of the built in JMESpath function.
Definition: exceptions.h:56
virtual void anchor()
A virtual function used to pin vtable to a transaltion unit.
Definition: exceptions.cpp:48
virtual void anchor()
A virtual function used to pin vtable to a transaltion unit.
Definition: exceptions.cpp:32
virtual void anchor()
A virtual function used to pin vtable to a transaltion unit.
Definition: exceptions.cpp:44
The UnknownFunction struct represents a call to a JMESPath built in function which doesn't exists...
Definition: exceptions.h:119
boost::error_info< struct tag_syntax_error_location, long > InfoSyntaxErrorLocation
InfoSyntaxErrorLocation contains the location of the syntax error in the JMESPath expression...
Definition: exceptions.h:50
The InvalidFunctionArgumentArity struct signals the a JMESPath built in function was called with an u...
Definition: exceptions.h:132
virtual void anchor()
A virtual function used to pin vtable to a transaltion unit.
Definition: exceptions.cpp:52
virtual void anchor()
A virtual function used to pin vtable to a transaltion unit.
Definition: exceptions.cpp:40
The InvalidFunctionArgumentType struct represents a call to a JMESPath built in function with an unex...
Definition: exceptions.h:145
The InvalidValue struct represents an invalid value in the JMESPath expression.
Definition: exceptions.h:106
boost::error_info< struct tag_search_expression, std::string > InfoSearchExpression
InfoSearchExpression contains the JMESPath expression being evaluated.
Definition: exceptions.h:43
virtual void anchor()
A virtual function used to pin vtable to a transaltion unit.
Definition: exceptions.cpp:56
The SyntaxError struct represents a syntax error in the evaluated expression.
Definition: exceptions.h:80
virtual void anchor()
A virtual function used to pin vtable to a transaltion unit.
Definition: exceptions.cpp:36
The Exception struct is the common base class for for all the exceptions thrown by the library...
Definition: exceptions.h:67
The InvalidAgrument struct signals a function call with illegal arguments.
Definition: exceptions.h:93