autojson  0.1
A JSON parser base on the automaton provided by json.org
 All Classes Files Functions Typedefs Enumerations Enumerator Pages
LexicalCast.hh
1 /*
2  autojson: A JSON parser base on the automaton provided by json.org
3  Copyright (C) 2014 Wan Wai Ho
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  as published by the Free Software Foundation version 2
8  of the License.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  02110-1301, USA.
19 */
20 
21 #ifndef LEXICALCAST_HH_INCLUDED
22 #define LEXICALCAST_HH_INCLUDED
23 
24 #include <string>
25 
26 namespace ajs {
27 
28 template <typename Dest>
29 Dest lexical_cast(const char *str, std::size_t len);
30 
31 template <>
32 int lexical_cast(const char *str, std::size_t len);
33 
34 template <>
35 long long lexical_cast(const char *str, std::size_t len);
36 
37 template <>
38 double lexical_cast(const char *str, std::size_t len);
39 
40 template <>
41 std::string lexical_cast(const char *str, std::size_t len);
42 
43 } // end of namespace
44 
45 #endif