]> www.ginac.de Git - cln.git/blob - src/base/input/cl_read_junk_exception.cc
Cater to the fact that g++ 4.3 will use a different naming for
[cln.git] / src / base / input / cl_read_junk_exception.cc
1 // read_number_junk_exception().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cln/number_io.h"
8
9
10 // Implementation.
11
12 #include <sstream>
13 #include "cln/io.h"
14
15 namespace cln {
16
17 static inline const std::string
18 read_number_junk_msg (const char * string_rest, const char * string, const char * string_limit)
19 {
20         std::ostringstream buf;
21         fprint(buf, "Junk after number: ");
22         { for (const char * ptr = string; ptr != string_rest; ptr++)
23                 fprintchar(buf, *ptr);
24         }
25         fprint(buf, "\"");
26         { for (const char * ptr = string_rest; ptr != string_limit; ptr++)
27                 fprintchar(buf, *ptr);
28         }
29         fprint(buf, "\"");
30         return buf.str();
31 }
32
33 read_number_junk_exception::read_number_junk_exception (const char * string_rest, const char * string, const char * string_limit)
34         : read_number_exception(read_number_junk_msg(string_rest, string, string_limit))
35 {}
36
37 }  // namespace cln