1 | // I/O of numbers. |
2 | |
3 | #ifndef _CL_NUMBER_IO_H |
4 | #define _CL_NUMBER_IO_H |
5 | |
6 | #include "cln/io.h" |
7 | #include "cln/number.h" |
8 | #include "cln/exception.h" |
9 | |
10 | namespace cln { |
11 | |
12 | // Input. |
13 | |
14 | class read_number_exception : public runtime_exception { |
15 | public: |
16 | explicit read_number_exception(const std::string & what) |
17 | : runtime_exception(what) {} |
18 | }; |
19 | |
20 | // Finish with bad syntax. |
21 | class read_number_bad_syntax_exception : public read_number_exception { |
22 | public: |
23 | read_number_bad_syntax_exception(const char * string, const char * string_limit); |
24 | }; |
25 | |
26 | // Finish with junk after the number. |
27 | class read_number_junk_exception : public read_number_exception { |
28 | public: |
29 | read_number_junk_exception(const char * string_rest, const char * string, const char * string_limit); |
30 | }; |
31 | |
32 | // Finish with premature EOF. |
33 | class read_number_eof_exception : public read_number_exception { |
34 | public: |
35 | read_number_eof_exception(); |
36 | }; |
37 | |
38 | struct cl_read_flags; |
39 | |
40 | } // namespace cln |
41 | |
42 | #endif /* _CL_NUMBER_IO_H */ |
43 | |