Parsnip
parsing library
Loading...
Searching...
No Matches
parsnip_helpers.h
Go to the documentation of this file.
1
8
9#pragma once
10
11namespace Parsnip {
12
14 extern const char hex_digits[];
15
17 static inline char hexdigit (int digit) {
18 assert (digit >= 0 && digit <= 15);
19 return hex_digits[digit];
20 }
21
26 static inline void do_indent (std::ostream &target, int amount) {
27 for (int i = 0; i < amount; i++) {
28 target << ' ';
29 }
30 }
31
36 static inline void do_newline (std::ostream &target, int amount) {
37 if (amount >= 0) {
38 target << std::endl;
39 }
40 }
41
42} // namespace Parsnip
Serialization and parsing library.
Definition parsnip.h:38
const char hex_digits[]
Digits used for encoding/decoding hexadecimal.
Definition parsnip_types.cpp:19