Mon, 03 Mar 2014 17:02:38 +0200
- reserved 'constexpr' as a keyword because I know I will need it someday
88 | 1 | /* |
2 | Copyright 2012-2014 Santeri Piippo | |
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 | 1. Redistributions of source code must retain the above copyright | |
10 | notice, this list of conditions and the following disclaimer. | |
11 | 2. 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 | 3. 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 BOTC_MAIN_H | |
30 | #define BOTC_MAIN_H | |
31 | ||
32 | #include <cstdio> | |
33 | #include <cstdarg> | |
34 | #include <cstdint> | |
108
6409ece8297c
- refactored enums, macros split from Main.h to Macros.h
Teemu Piippo <crimsondusk64@gmail.com>
parents:
106
diff
changeset
|
35 | #include "Macros.h" |
88 | 36 | #include "Property.h" |
37 | #include "Types.h" | |
38 | #include "Containers.h" | |
39 | #include "String.h" | |
40 | #include "Format.h" | |
41 | #include "BotStuff.h" | |
42 | #include "Tokens.h" | |
43 | ||
115
9be16e1c1e44
- reformatting... again
Teemu Piippo <crimsondusk64@gmail.com>
parents:
112
diff
changeset
|
44 | String makeObjectFileName (String s); |
9be16e1c1e44
- reformatting... again
Teemu Piippo <crimsondusk64@gmail.com>
parents:
112
diff
changeset
|
45 | DataType getTypeByName (String token); |
9be16e1c1e44
- reformatting... again
Teemu Piippo <crimsondusk64@gmail.com>
parents:
112
diff
changeset
|
46 | String dataTypeName (DataType type); |
9be16e1c1e44
- reformatting... again
Teemu Piippo <crimsondusk64@gmail.com>
parents:
112
diff
changeset
|
47 | String versionString (bool longform); |
9be16e1c1e44
- reformatting... again
Teemu Piippo <crimsondusk64@gmail.com>
parents:
112
diff
changeset
|
48 | String makeVersionString (int major, int minor, int patch); |
88 | 49 | |
106
9174be9ac686
- improved error handling a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
88
diff
changeset
|
50 | template<typename T> |
9174be9ac686
- improved error handling a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
88
diff
changeset
|
51 | inline T max (T a, T b) |
9174be9ac686
- improved error handling a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
88
diff
changeset
|
52 | { |
9174be9ac686
- improved error handling a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
88
diff
changeset
|
53 | return a > b ? a : b; |
9174be9ac686
- improved error handling a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
88
diff
changeset
|
54 | } |
9174be9ac686
- improved error handling a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
88
diff
changeset
|
55 | |
9174be9ac686
- improved error handling a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
88
diff
changeset
|
56 | template<typename T> |
9174be9ac686
- improved error handling a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
88
diff
changeset
|
57 | inline T min (T a, T b) |
9174be9ac686
- improved error handling a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
88
diff
changeset
|
58 | { |
9174be9ac686
- improved error handling a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
88
diff
changeset
|
59 | return a < b ? a : b; |
9174be9ac686
- improved error handling a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
88
diff
changeset
|
60 | } |
9174be9ac686
- improved error handling a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
88
diff
changeset
|
61 | |
88 | 62 | #endif // BOTC_MAIN_H |