996
|
1 // lib.h
|
|
2
|
|
3 #ifndef LIB_H_RAIL_1
|
|
4 #define LIB_H_RAIL_1
|
|
5
|
|
6 #include <vector>
|
|
7 #include <list>
|
|
8 #include <string>
|
|
9 #include <map>
|
|
10 #include <sstream>
|
|
11 #include <iostream>
|
|
12 #include <fstream>
|
|
13
|
|
14 class InternalException : public std::exception
|
|
15 {
|
|
16 public:
|
|
17 explicit InternalException(std::string const & newLabel)
|
|
18 : label(newLabel)
|
|
19 {
|
|
20 }
|
|
21
|
|
22 virtual ~InternalException() throw() {}
|
|
23
|
|
24 virtual char const * what() const throw()
|
|
25 {
|
|
26 return label.c_str();
|
|
27 }
|
|
28 private:
|
|
29 std::string label;
|
|
30 };
|
|
31
|
|
32 class ArgumentException : public std::exception
|
|
33 {
|
|
34 public:
|
|
35 explicit ArgumentException(std::string const & newLabel)
|
|
36 : label(newLabel)
|
|
37 {
|
|
38 }
|
|
39
|
|
40 virtual ~ArgumentException() throw() {}
|
|
41
|
|
42 virtual char const * what() const throw()
|
|
43 {
|
|
44 return label.c_str();
|
|
45 }
|
|
46 private:
|
|
47 std::string label;
|
|
48 };
|
|
49
|
|
50 std::string intToString(int num);
|
|
51
|
|
52 class Binding;
|
|
53
|
|
54 extern Binding NIL;
|
|
55
|
|
56 namespace args
|
|
57 {
|
|
58 extern bool isBatch;
|
|
59 extern std::ostream * output;
|
|
60 extern std::istream * input;
|
|
61 extern std::list<std::string> sourceFiles;
|
|
62 }
|
|
63
|
|
64 #endif
|