-rw-r--r-- | include/sitecing/util.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/sitecing/util.h b/include/sitecing/util.h index 5750ab6..a38ae90 100644 --- a/include/sitecing/util.h +++ b/include/sitecing/util.h | |||
@@ -1,81 +1,81 @@ | |||
1 | #ifndef __SITECING_UTIL_H | 1 | #ifndef __SITECING_UTIL_H |
2 | #define __SITECING_UTIL_H | 2 | #define __SITECING_UTIL_H |
3 | 3 | ||
4 | #include <ostream> | 4 | #include <ostream> |
5 | #include <string> | 5 | #include <string> |
6 | #include "sitecing/acomponent.h" | 6 | #include "sitecing/acomponent.h" |
7 | 7 | ||
8 | /** | 8 | /** |
9 | * @file | 9 | * @file |
10 | * @brief more or less non-internal utility classes and functions. | 10 | * @brief more or less non-internal utility classes and functions. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | namespace sitecing { | 13 | namespace sitecing { |
14 | using namespace std; | 14 | using namespace std; |
15 | 15 | ||
16 | /** | 16 | /** |
17 | * the html_escape options enumeration. | 17 | * the html_escape options enumeration. |
18 | */ | 18 | */ |
19 | enum html_escape_options { | 19 | enum html_escape_options { |
20 | /** | 20 | /** |
21 | * Turn spaces into | 21 | * Turn spaces into |
22 | */ | 22 | */ |
23 | html_escape_nbsp = 0x0001, | 23 | html_escape_nbsp = 0x0001, |
24 | /** | 24 | /** |
25 | * Turn newlines into <br/> or <br>. | 25 | * Turn newlines into br/ or br. |
26 | */ | 26 | */ |
27 | html_escape_br = 0x0002, | 27 | html_escape_br = 0x0002, |
28 | /** | 28 | /** |
29 | * Turn quotes to " | 29 | * Turn quotes to " |
30 | */ | 30 | */ |
31 | html_escape_quot = 0x0004, | 31 | html_escape_quot = 0x0004, |
32 | /** | 32 | /** |
33 | * Do not put '/' into <br/> consruct. | 33 | * Do not put '/' into br consruct. |
34 | */ | 34 | */ |
35 | html_escape_br_noslash = 0x0008 | 35 | html_escape_br_noslash = 0x0008 |
36 | }; | 36 | }; |
37 | /** | 37 | /** |
38 | * Escape string suitable for html output. | 38 | * Escape string suitable for html output. |
39 | * @param str the string. | 39 | * @param str the string. |
40 | * @param flags options. | 40 | * @param flags options. |
41 | * @return the string escaped. | 41 | * @return the string escaped. |
42 | * @see html_escape_options | 42 | * @see html_escape_options |
43 | */ | 43 | */ |
44 | string html_escape(const string& str,int flags=html_escape_br); | 44 | string html_escape(const string& str,int flags=html_escape_br); |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * The output string checkpoint object, letting one to rollback output. | 47 | * The output string checkpoint object, letting one to rollback output. |
48 | */ | 48 | */ |
49 | class checkpoint { | 49 | class checkpoint { |
50 | public: | 50 | public: |
51 | /** | 51 | /** |
52 | * The object's death will enumeration. | 52 | * The object's death will enumeration. |
53 | */ | 53 | */ |
54 | enum will_t { | 54 | enum will_t { |
55 | /** | 55 | /** |
56 | * The stream is to be rolled back at object destruction. | 56 | * The stream is to be rolled back at object destruction. |
57 | */ | 57 | */ |
58 | will_rollback, | 58 | will_rollback, |
59 | /** | 59 | /** |
60 | * The stream is not to be rolled back at object destruction. | 60 | * The stream is not to be rolled back at object destruction. |
61 | */ | 61 | */ |
62 | will_commit, | 62 | will_commit, |
63 | /** | 63 | /** |
64 | * The object will die intestate. What's the point then? | 64 | * The object will die intestate. What's the point then? |
65 | */ | 65 | */ |
66 | will_intestate | 66 | will_intestate |
67 | }; | 67 | }; |
68 | /** | 68 | /** |
69 | * The output stream in question. | 69 | * The output stream in question. |
70 | */ | 70 | */ |
71 | ostream* stream; | 71 | ostream* stream; |
72 | /** | 72 | /** |
73 | * The point at which objhect was created. | 73 | * The point at which objhect was created. |
74 | */ | 74 | */ |
75 | ostream::pos_type point; | 75 | ostream::pos_type point; |
76 | /** | 76 | /** |
77 | * The last will. | 77 | * The last will. |
78 | */ | 78 | */ |
79 | will_t last_will; | 79 | will_t last_will; |
80 | 80 | ||
81 | /** | 81 | /** |