JSON Voorhees
Killer JSON for C++
string_view.hpp
Go to the documentation of this file.
1 /** \file jsonv/string_view.hpp
2  * Pulls in an implementation of \c string_view.
3  *
4  * Copyright (c) 2014 by Travis Gockel. All rights reserved.
5  *
6  * This program is free software: you can redistribute it and/or modify it under the terms of the Apache License
7  * as published by the Apache Software Foundation, either version 2 of the License, or (at your option) any later
8  * version.
9  *
10  * \author Travis Gockel (travis@gockelhut.com)
11 **/
12 #ifndef __JSONV_STRING_VIEW_HPP_INCLUDED__
13 #define __JSONV_STRING_VIEW_HPP_INCLUDED__
14 
15 #include <jsonv/config.hpp>
16 
17 /** \def JSONV_STRING_VIEW_TYPE
18  * The type to use for \c jsonv::string_view. By default, this is \c jsonv::detail::string_view.
19  *
20  * \def JSONV_STRING_VIEW_INCLUDE
21  * The file to include to get the implementation for \c string_view. If you define \c JSONV_STRING_VIEW_TYPE, you must
22  * also define this.
23  *
24  * \def JSONV_STRING_VIEW_USE_STD
25  * Set this to 1 to use \c std::string_view as the backing type for \c jsonv::string_view.
26  *
27  * \def JSONV_STRING_VIEW_USE_BOOST
28  * Set this to 1 to use \c boost::string_ref as the backing type for \c jsonv::string_view.
29 **/
30 #ifndef JSONV_STRING_VIEW_TYPE
31 # if defined(JSONV_STRING_VIEW_USE_STD) && JSONV_STRING_VIEW_USE_STD
32 # define JSONV_STRING_VIEW_TYPE std::string_view
33 # define JSONV_STRING_VIEW_INCLUDE <string_view>
34 # elif defined(JSONV_STRING_VIEW_USE_BOOST) && JSONV_STRING_VIEW_USE_BOOST
35 # define JSONV_STRING_VIEW_TYPE boost::string_ref
36 # define JSONV_STRING_VIEW_INCLUDE <boost/utility/string_ref.hpp>
37 # else
38 # define JSONV_STRING_VIEW_TYPE jsonv::detail::string_view
39 # define JSONV_STRING_VIEW_INCLUDE <jsonv/detail/string_view.hpp>
40 # endif
41 #endif
42 
43 #include JSONV_STRING_VIEW_INCLUDE
44 
45 namespace jsonv
46 {
47 
48 /** A non-owning reference to a string.
49  *
50  * \see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3442.html
51 **/
53 
54 }
55 
56 #endif/*__JSONV_STRING_REF_HPP_INCLUDED__*/
Copyright (c) 2014-2019 by Travis Gockel.
#define JSONV_STRING_VIEW_TYPE
The type to use for jsonv::string_view.
Definition: string_view.hpp:38
JSONV_STRING_VIEW_TYPE string_view
A non-owning reference to a string.
Definition: string_view.hpp:52