libcwdversion 2.0.0
The C++ Debugging Support Library
Loading...
Searching...
No Matches
control_flag.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2000-2005, 2007, 2018, 2020, 2023, 2025-2026 Carlo Wood
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
9
10#ifndef LIBCWD_CONTROL_FLAG_H
11#define LIBCWD_CONTROL_FLAG_H
12
13#include "libcwd/config.h"
14
15namespace libcwd {
16
19
21using control_flag_t = unsigned int;
22
23// The control bits:
26
29
32
35
38
41
43control_flag_t const cerr_cf = 0x0040;
44
46control_flag_t const flush_cf = 0x0080;
47
49control_flag_t const wait_cf = 0x0100;
50
52control_flag_t const error_cf = 0x0200;
53
54// Special mask bits.
55control_flag_t const continued_cf_maskbit = 0x0400;
56control_flag_t const continued_expected_maskbit = 0x0800;
57
58// Mask bits of all special channels:
59control_flag_t const fatal_maskbit = 0x1000;
60control_flag_t const coredump_maskbit = 0x2000;
61control_flag_t const continued_maskbit = 0x4000;
62control_flag_t const finish_maskbit = 0x8000;
63
69
72{
73 return cond ? nonewline_cf : 0;
74}
75
77{
78 return cond ? noprefix_cf : 0;
79}
80
82{
83 return cond ? nolabel_cf : 0;
84}
85
87{
88 return cond ? blank_margin_cf : 0;
89}
90
92{
93 return cond ? blank_label_cf : 0;
94}
95
97{
98 return cond ? blank_marker_cf : 0;
99}
100
102{
103 return cond ? cerr_cf : 0;
104}
105
107{
108 return cond ? flush_cf : 0;
109}
110
112{
113 return cond ? wait_cf : 0;
114}
115
117{
118 return cond ? error_cf : 0;
119}
120
122
123} // namespace libcwd
124
125#endif // LIBCWD_CONTROL_FLAG_H
control_flag_t conf_blank_margin_cf(bool cond)
Returns blank_margin_cf if cond is true.
Definition control_flag.h:86
unsigned int control_flag_t
Definition control_flag.h:21
control_flag_t const blank_marker_cf
Replace marker by white space.
Definition control_flag.h:40
control_flag_t cond_noprefix_cf(bool cond)
Returns noprefix_cf if cond is true.
Definition control_flag.h:76
control_flag_t const noprefix_cf
Omit margin, label, marker and indentation.
Definition control_flag.h:28
control_flag_t const nolabel_cf
Omit label, marker and indentation.
Definition control_flag.h:31
control_flag_t cond_nonewline_cf(bool cond)
Returns nonewline_cf if cond is true.
Definition control_flag.h:71
control_flag_t cond_nolabel_cf(bool cond)
Returns nolabel_cf if cond is true.
Definition control_flag.h:81
control_flag_t conf_blank_label_cf(bool cond)
Returns blank_label_cf if cond is true.
Definition control_flag.h:91
control_flag_t cond_error_cf(bool cond)
Returns error_cf if cond is true.
Definition control_flag.h:116
control_flag_t const nonewline_cf
Omit the default new line at the end.
Definition control_flag.h:25
control_flag_t conf_wait_cf(bool cond)
Returns wait_cf if cond is true.
Definition control_flag.h:111
control_flag_t const blank_margin_cf
Replace margin by white space.
Definition control_flag.h:34
continued_cf_nt
continued_cf has its own type for overloading purposes.
Definition control_flag.h:66
control_flag_t conf_blank_marker_cf(bool cond)
Returns blank_marker_cf if cond is true.
Definition control_flag.h:96
control_flag_t const error_cf
Append error string according to errno.
Definition control_flag.h:52
control_flag_t const cerr_cf
Force output to be written to cerr.
Definition control_flag.h:43
control_flag_t const blank_label_cf
Replace label by white space.
Definition control_flag.h:37
control_flag_t const wait_cf
If interactive, wait till return is pressed.
Definition control_flag.h:49
control_flag_t const flush_cf
Flush ostream after writing this output.
Definition control_flag.h:46
control_flag_t conf_cerr_cf(bool cond)
Returns cerr_cf if cond is true.
Definition control_flag.h:101
control_flag_t conf_flush_cf(bool cond)
Returns flush_cf if cond is true.
Definition control_flag.h:106
@ continued_cf
Start a continued debug output.
Definition control_flag.h:67
namespace for libcwd.