| 1 | /*
|
|---|
| 2 | * Copyright (c) 2017 Jaroslav Jindrak
|
|---|
| 3 | * All rights reserved.
|
|---|
| 4 | *
|
|---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
|---|
| 6 | * modification, are permitted provided that the following conditions
|
|---|
| 7 | * are met:
|
|---|
| 8 | *
|
|---|
| 9 | * - Redistributions of source code must retain the above copyright
|
|---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
|---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
|---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
|---|
| 13 | * documentation and/or other materials provided with the distribution.
|
|---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
|---|
| 15 | * derived from this software without specific prior written permission.
|
|---|
| 16 | *
|
|---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|---|
| 27 | */
|
|---|
| 28 |
|
|---|
| 29 | #ifndef LIBCPP_INTERNAL_LOCALE_NUM_GET
|
|---|
| 30 | #define LIBCPP_INTERNAL_LOCALE_NUM_GET
|
|---|
| 31 |
|
|---|
| 32 | #include <internal/locale.hpp>
|
|---|
| 33 | #include <ios>
|
|---|
| 34 | #include <iterator>
|
|---|
| 35 |
|
|---|
| 36 | namespace std
|
|---|
| 37 | {
|
|---|
| 38 | /**
|
|---|
| 39 | * 22.4.2.1, class template num_get:
|
|---|
| 40 | */
|
|---|
| 41 |
|
|---|
| 42 | template<class Char, class InputIterator = istreambuf_iterator<Char>>
|
|---|
| 43 | class num_get: public locale::facet
|
|---|
| 44 | {
|
|---|
| 45 | public:
|
|---|
| 46 | using char_type = Char;
|
|---|
| 47 | using iter_type = InputIterator;
|
|---|
| 48 |
|
|---|
| 49 | explicit num_get(size_t refs = 0);
|
|---|
| 50 |
|
|---|
| 51 | iter_type get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 52 | ios_base::iostate& err, bool& v) const
|
|---|
| 53 | {
|
|---|
| 54 | return do_get(in, end, base, err, v);
|
|---|
| 55 | }
|
|---|
| 56 |
|
|---|
| 57 | iter_type get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 58 | ios_base::iostate& err, long& v) const
|
|---|
| 59 | {
|
|---|
| 60 | return do_get(in, end, base, err, v);
|
|---|
| 61 | }
|
|---|
| 62 |
|
|---|
| 63 | iter_type get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 64 | ios_base::iostate& err, long long& v) const
|
|---|
| 65 | {
|
|---|
| 66 | return do_get(in, end, base, err, v);
|
|---|
| 67 | }
|
|---|
| 68 |
|
|---|
| 69 | iter_type get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 70 | ios_base::iostate& err, unsigned short& v) const
|
|---|
| 71 | {
|
|---|
| 72 | return do_get(in, end, base, err, v);
|
|---|
| 73 | }
|
|---|
| 74 |
|
|---|
| 75 | iter_type get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 76 | ios_base::iostate& err, unsigned int& v) const
|
|---|
| 77 | {
|
|---|
| 78 | return do_get(in, end, base, err, v);
|
|---|
| 79 | }
|
|---|
| 80 |
|
|---|
| 81 | iter_type get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 82 | ios_base::iostate& err, unsigned long& v) const
|
|---|
| 83 | {
|
|---|
| 84 | return do_get(in, end, base, err, v);
|
|---|
| 85 | }
|
|---|
| 86 |
|
|---|
| 87 | iter_type get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 88 | ios_base::iostate& err, unsigned long long& v) const
|
|---|
| 89 | {
|
|---|
| 90 | return do_get(in, end, base, err, v);
|
|---|
| 91 | }
|
|---|
| 92 |
|
|---|
| 93 | iter_type get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 94 | ios_base::iostate& err, float& v) const
|
|---|
| 95 | {
|
|---|
| 96 | return do_get(in, end, base, err, v);
|
|---|
| 97 | }
|
|---|
| 98 |
|
|---|
| 99 | iter_type get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 100 | ios_base::iostate& err, double& v) const
|
|---|
| 101 | {
|
|---|
| 102 | return do_get(in, end, base, err, v);
|
|---|
| 103 | }
|
|---|
| 104 |
|
|---|
| 105 | iter_type get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 106 | ios_base::iostate& err, long double& v) const
|
|---|
| 107 | {
|
|---|
| 108 | return do_get(in, end, base, err, v);
|
|---|
| 109 | }
|
|---|
| 110 |
|
|---|
| 111 | iter_type get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 112 | ios_base::iostate& err, void*& v) const
|
|---|
| 113 | {
|
|---|
| 114 | return do_get(in, end, base, err, v);
|
|---|
| 115 | }
|
|---|
| 116 |
|
|---|
| 117 | static locale::id id;
|
|---|
| 118 |
|
|---|
| 119 | ~num_get();
|
|---|
| 120 |
|
|---|
| 121 | protected:
|
|---|
| 122 | iter_type do_get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 123 | ios_base::iostate& err, bool& v) const
|
|---|
| 124 | {
|
|---|
| 125 | // TODO: implement
|
|---|
| 126 | }
|
|---|
| 127 |
|
|---|
| 128 | iter_type do_get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 129 | ios_base::iostate& err, long& v) const
|
|---|
| 130 | {
|
|---|
| 131 | // TODO: implement
|
|---|
| 132 | }
|
|---|
| 133 |
|
|---|
| 134 | iter_type do_get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 135 | ios_base::iostate& err, long long& v) const
|
|---|
| 136 | {
|
|---|
| 137 | // TODO: implement
|
|---|
| 138 | }
|
|---|
| 139 |
|
|---|
| 140 | iter_type do_get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 141 | ios_base::iostate& err, unsigned short& v) const
|
|---|
| 142 | {
|
|---|
| 143 | // TODO: implement
|
|---|
| 144 | }
|
|---|
| 145 |
|
|---|
| 146 | iter_type do_get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 147 | ios_base::iostate& err, unsigned int& v) const
|
|---|
| 148 | {
|
|---|
| 149 | // TODO: implement
|
|---|
| 150 | }
|
|---|
| 151 |
|
|---|
| 152 | iter_type do_get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 153 | ios_base::iostate& err, unsigned long& v) const
|
|---|
| 154 | {
|
|---|
| 155 | // TODO: implement
|
|---|
| 156 | }
|
|---|
| 157 |
|
|---|
| 158 | iter_type do_get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 159 | ios_base::iostate& err, unsigned long long& v) const
|
|---|
| 160 | {
|
|---|
| 161 | // TODO: implement
|
|---|
| 162 | }
|
|---|
| 163 |
|
|---|
| 164 | iter_type do_get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 165 | ios_base::iostate& err, float& v) const
|
|---|
| 166 | {
|
|---|
| 167 | // TODO: implement
|
|---|
| 168 | }
|
|---|
| 169 |
|
|---|
| 170 | iter_type do_get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 171 | ios_base::iostate& err, double& v) const
|
|---|
| 172 | {
|
|---|
| 173 | // TODO: implement
|
|---|
| 174 | }
|
|---|
| 175 |
|
|---|
| 176 | iter_type do_get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 177 | ios_base::iostate& err, long double& v) const
|
|---|
| 178 | {
|
|---|
| 179 | // TODO: implement
|
|---|
| 180 | }
|
|---|
| 181 |
|
|---|
| 182 | iter_type do_get(iter_type in, iter_type end, ios_base& base,
|
|---|
| 183 | ios_base::iostate& err, void*& v) const
|
|---|
| 184 | {
|
|---|
| 185 | // TODO: implement
|
|---|
| 186 | }
|
|---|
| 187 | };
|
|---|
| 188 | }
|
|---|
| 189 |
|
|---|
| 190 | #endif
|
|---|