]> git.buserror.net Git - polintos/scott/priv.git/blob - idlcomp/util.h
Initial checkin from Perforce.
[polintos/scott/priv.git] / idlcomp / util.h
1 #ifndef UTIL_H
2 #define UTIL_H
3
4 #include <iostream>
5 #include <stdint.h>
6
7 // Feed an indent struct into an ostream to get "indent_level" tabs
8 // and "align_spaces" spaces.
9
10 struct Indent {
11         int indent_level;
12         int align_spaces;
13 };
14
15 std::ostream &operator << (std::ostream &ostr, Indent &ind);
16
17 // Creates the specified directory, including all parent directories that
18 // do not yet exist.  Gives the user an error if any component could not
19 // be created, or (if require_empty is set) if the final directory is not
20 // empty.
21
22 void makepath(const char *path, bool require_empty = true);
23
24 // Turns an ASCII GUID into a binary GUID.  Prints a message
25 // and throws a UserError if the ASCII GUID is invalid.
26 // guid_bin must point to a 16-byte region of memory.
27
28 void parse_guid(const char *guid_str, char *guid_bin);
29
30 #endif