annotate DEPENDENCIES/generic/include/boost/spirit/home/classic/utility/chset.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents 2665513ce2d3
children
rev   line source
Chris@16 1 /*=============================================================================
Chris@16 2 Copyright (c) 2001-2003 Joel de Guzman
Chris@16 3 Copyright (c) 2001-2003 Daniel Nuffer
Chris@16 4 http://spirit.sourceforge.net/
Chris@16 5
Chris@16 6 Distributed under the Boost Software License, Version 1.0. (See accompanying
Chris@16 7 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Chris@16 8 =============================================================================*/
Chris@16 9 #ifndef BOOST_SPIRIT_CHSET_HPP
Chris@16 10 #define BOOST_SPIRIT_CHSET_HPP
Chris@16 11
Chris@16 12 ///////////////////////////////////////////////////////////////////////////////
Chris@16 13 #include <boost/shared_ptr.hpp>
Chris@16 14 #include <boost/spirit/home/classic/namespace.hpp>
Chris@16 15 #include <boost/spirit/home/classic/core/primitives/primitives.hpp>
Chris@16 16 #include <boost/spirit/home/classic/utility/impl/chset/basic_chset.hpp>
Chris@16 17
Chris@16 18 ///////////////////////////////////////////////////////////////////////////////
Chris@16 19 namespace boost { namespace spirit {
Chris@16 20
Chris@16 21 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
Chris@16 22
Chris@16 23 namespace utility { namespace impl {
Chris@16 24
Chris@16 25 // This is here because some compilers choke on out-of-line member
Chris@16 26 // template functions. And we don't want to put the whole algorithm
Chris@16 27 // in the chset constructor in the class definition.
Chris@16 28 template <typename CharT, typename CharT2>
Chris@16 29 void construct_chset(boost::shared_ptr<basic_chset<CharT> >& ptr,
Chris@16 30 CharT2 const* definition);
Chris@16 31
Chris@16 32 }} // namespace utility::impl
Chris@16 33
Chris@16 34 ///////////////////////////////////////////////////////////////////////////////
Chris@16 35 //
Chris@16 36 // chset class
Chris@16 37 //
Chris@16 38 ///////////////////////////////////////////////////////////////////////////////
Chris@16 39 template <typename CharT = char>
Chris@16 40 class chset: public char_parser<chset<CharT> > {
Chris@16 41
Chris@16 42 public:
Chris@16 43 chset();
Chris@16 44 chset(chset const& arg_);
Chris@16 45 explicit chset(CharT arg_);
Chris@16 46 explicit chset(anychar_parser arg_);
Chris@16 47 explicit chset(nothing_parser arg_);
Chris@16 48 explicit chset(chlit<CharT> const& arg_);
Chris@16 49 explicit chset(range<CharT> const& arg_);
Chris@16 50 explicit chset(negated_char_parser<chlit<CharT> > const& arg_);
Chris@16 51 explicit chset(negated_char_parser<range<CharT> > const& arg_);
Chris@16 52
Chris@16 53 template <typename CharT2>
Chris@16 54 explicit chset(CharT2 const* definition)
Chris@16 55 : ptr(new basic_chset<CharT>())
Chris@16 56 {
Chris@16 57 utility::impl::construct_chset(ptr, definition);
Chris@16 58 }
Chris@16 59 ~chset();
Chris@16 60
Chris@16 61 chset& operator=(chset const& rhs);
Chris@16 62 chset& operator=(CharT rhs);
Chris@16 63 chset& operator=(anychar_parser rhs);
Chris@16 64 chset& operator=(nothing_parser rhs);
Chris@16 65 chset& operator=(chlit<CharT> const& rhs);
Chris@16 66 chset& operator=(range<CharT> const& rhs);
Chris@16 67 chset& operator=(negated_char_parser<chlit<CharT> > const& rhs);
Chris@16 68 chset& operator=(negated_char_parser<range<CharT> > const& rhs);
Chris@16 69
Chris@16 70 void set(range<CharT> const& arg_);
Chris@16 71 void set(negated_char_parser<chlit<CharT> > const& arg_);
Chris@16 72 void set(negated_char_parser<range<CharT> > const& arg_);
Chris@16 73
Chris@16 74 void clear(range<CharT> const& arg_);
Chris@16 75 void clear(negated_char_parser<range<CharT> > const& arg_);
Chris@16 76 bool test(CharT ch) const;
Chris@16 77 chset& inverse();
Chris@16 78 void swap(chset& x);
Chris@16 79
Chris@16 80 chset& operator|=(chset const& x);
Chris@16 81 chset& operator&=(chset const& x);
Chris@16 82 chset& operator-=(chset const& x);
Chris@16 83 chset& operator^=(chset const& x);
Chris@16 84
Chris@16 85 private:
Chris@16 86
Chris@16 87 boost::shared_ptr<basic_chset<CharT> > ptr;
Chris@16 88 };
Chris@16 89
Chris@16 90 ///////////////////////////////////////////////////////////////////////////////
Chris@16 91 //
Chris@16 92 // Generator functions
Chris@16 93 //
Chris@16 94 ///////////////////////////////////////////////////////////////////////////////
Chris@16 95 template <typename CharT>
Chris@16 96 inline chset<CharT>
Chris@16 97 chset_p(chlit<CharT> const& arg_)
Chris@16 98 { return chset<CharT>(arg_); }
Chris@16 99
Chris@16 100 //////////////////////////////////
Chris@16 101 template <typename CharT>
Chris@16 102 inline chset<CharT>
Chris@16 103 chset_p(range<CharT> const& arg_)
Chris@16 104 { return chset<CharT>(arg_); }
Chris@16 105
Chris@16 106 template <typename CharT>
Chris@16 107 inline chset<CharT>
Chris@16 108 chset_p(negated_char_parser<chlit<CharT> > const& arg_)
Chris@16 109 { return chset<CharT>(arg_); }
Chris@16 110
Chris@16 111 template <typename CharT>
Chris@16 112 inline chset<CharT>
Chris@16 113 chset_p(negated_char_parser<range<CharT> > const& arg_)
Chris@16 114 { return chset<CharT>(arg_); }
Chris@16 115
Chris@16 116 //////////////////////////////////
Chris@16 117 inline chset<char>
Chris@16 118 chset_p(char const* init)
Chris@16 119 { return chset<char>(init); }
Chris@16 120
Chris@16 121 //////////////////////////////////
Chris@16 122 inline chset<wchar_t>
Chris@16 123 chset_p(wchar_t const* init)
Chris@16 124 { return chset<wchar_t>(init); }
Chris@16 125
Chris@16 126 //////////////////////////////////
Chris@16 127 inline chset<char>
Chris@16 128 chset_p(char ch)
Chris@16 129 { return chset<char>(ch); }
Chris@16 130
Chris@16 131 //////////////////////////////////
Chris@16 132 inline chset<wchar_t>
Chris@16 133 chset_p(wchar_t ch)
Chris@16 134 { return chset<wchar_t>(ch); }
Chris@16 135
Chris@16 136 //////////////////////////////////
Chris@16 137 inline chset<int>
Chris@16 138 chset_p(int ch)
Chris@16 139 { return chset<int>(ch); }
Chris@16 140
Chris@16 141 //////////////////////////////////
Chris@16 142 inline chset<unsigned int>
Chris@16 143 chset_p(unsigned int ch)
Chris@16 144 { return chset<unsigned int>(ch); }
Chris@16 145
Chris@16 146 //////////////////////////////////
Chris@16 147 inline chset<short>
Chris@16 148 chset_p(short ch)
Chris@16 149 { return chset<short>(ch); }
Chris@16 150
Chris@16 151 #if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
Chris@16 152 //////////////////////////////////
Chris@16 153 inline chset<unsigned short>
Chris@16 154 chset_p(unsigned short ch)
Chris@16 155 { return chset<unsigned short>(ch); }
Chris@16 156 #endif
Chris@16 157 //////////////////////////////////
Chris@16 158 inline chset<long>
Chris@16 159 chset_p(long ch)
Chris@16 160 { return chset<long>(ch); }
Chris@16 161
Chris@16 162 //////////////////////////////////
Chris@16 163 inline chset<unsigned long>
Chris@16 164 chset_p(unsigned long ch)
Chris@16 165 { return chset<unsigned long>(ch); }
Chris@16 166
Chris@16 167 #ifdef BOOST_HAS_LONG_LONG
Chris@16 168 //////////////////////////////////
Chris@16 169 inline chset< ::boost::long_long_type>
Chris@16 170 chset_p( ::boost::long_long_type ch)
Chris@16 171 { return chset< ::boost::long_long_type>(ch); }
Chris@16 172
Chris@16 173 //////////////////////////////////
Chris@16 174 inline chset< ::boost::ulong_long_type>
Chris@16 175 chset_p( ::boost::ulong_long_type ch)
Chris@16 176 { return chset< ::boost::ulong_long_type>(ch); }
Chris@16 177 #endif
Chris@16 178
Chris@16 179 ///////////////////////////////////////////////////////////////////////////////
Chris@16 180 BOOST_SPIRIT_CLASSIC_NAMESPACE_END
Chris@16 181
Chris@16 182 }} // namespace BOOST_SPIRIT_CLASSIC_NS
Chris@16 183
Chris@16 184 #endif
Chris@16 185
Chris@16 186 #include <boost/spirit/home/classic/utility/impl/chset.ipp>
Chris@16 187 #include <boost/spirit/home/classic/utility/chset_operators.hpp>