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
types.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 TYPES_H
29 #define TYPES_H
30 #include <string>
31 #include <limits>
32 #include <boost/regex/pending/unicode_iterator.hpp>
33 #include <boost/multiprecision/cpp_int.hpp>
34 #include <nlohmann/json.hpp>
35 
36 namespace jmespath {
40 using Char = char;
44 using String = std::basic_string<Char>;
48 using UnicodeChar = char32_t;
52 using UnicodeString = std::basic_string<UnicodeChar>;
57  = boost::u8_to_u32_iterator<String::const_iterator>;
62  = boost::u32_to_u8_iterator<UnicodeString::const_iterator>;
66 using Json = nlohmann::json;
71 using Index = boost::multiprecision::number<
72  boost::multiprecision::cpp_int_backend<
73  std::numeric_limits<size_t>::digits,
74  std::numeric_limits<size_t>::digits,
75  boost::multiprecision::signed_magnitude,
76  boost::multiprecision::checked,
77  void> >;
78 } // namespace jmespath
79 #endif // TYPES_H
nlohmann::json Json
JSON data type.
Definition: types.h:66
boost::u32_to_u8_iterator< UnicodeString::const_iterator > StringIteratorAdaptor
UTF-8 string iterator adaptor.
Definition: types.h:62
std::basic_string< Char > String
UTF-8 encoded string type.
Definition: types.h:44
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< std::numeric_limits< size_t >::digits, std::numeric_limits< size_t >::digits, boost::multiprecision::signed_magnitude, boost::multiprecision::checked, void > > Index
Signed integer type that can hold all values in the range of numeric_limits<size_t>::max() * -1 ...
Definition: types.h:77
std::basic_string< UnicodeChar > UnicodeString
UTF-32 encoded string type.
Definition: types.h:52
char32_t UnicodeChar
32 bit character type
Definition: types.h:48
char Char
8 bit character type
Definition: types.h:40
boost::u8_to_u32_iterator< String::const_iterator > UnicodeIteratorAdaptor
UTF-32 string iterator adaptor.
Definition: types.h:57