CBMC
help_formatter.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Help Formatter
4
5
Author: Daniel Kroening, dkr@amazon.com
6
7
\*******************************************************************/
8
11
12
#ifndef CPROVER_UTIL_HELP_FORMATTER_H
13
#define CPROVER_UTIL_HELP_FORMATTER_H
14
15
#include <iosfwd>
16
#include <string>
17
18
class
help_formattert
19
{
20
public
:
21
explicit
help_formattert
(
const
std::string &_s) :
s
(_s)
22
{
23
}
24
25
const
std::string &
s
;
26
void
operator()
(std::ostream &)
const
;
27
28
protected
:
29
struct
statet
30
{
31
std::size_t
column
= 0;
32
bool
aligning
=
false
;
33
std::string
word
=
""
;
34
};
35
36
static
void
emit_word
(
statet
&, std::ostream &);
37
static
const
std::size_t
first_column_width
= 29;
38
};
39
40
static
inline
help_formattert
help_formatter
(
const
std::string &s)
41
{
42
return
help_formattert
(s);
43
}
44
45
static
inline
std::ostream &
46
operator<<
(std::ostream &out,
const
help_formattert
&h)
47
{
48
h(out);
49
return
out;
50
}
51
52
#endif
// CPROVER_UTIL_HELP_FORMATTER_H
help_formattert
Definition:
help_formatter.h:19
help_formattert::first_column_width
static const std::size_t first_column_width
Definition:
help_formatter.h:37
help_formattert::operator()
void operator()(std::ostream &) const
Definition:
help_formatter.cpp:32
help_formattert::help_formattert
help_formattert(const std::string &_s)
Definition:
help_formatter.h:21
help_formattert::emit_word
static void emit_word(statet &, std::ostream &)
Definition:
help_formatter.cpp:15
help_formattert::s
const std::string & s
Definition:
help_formatter.h:25
operator<<
static std::ostream & operator<<(std::ostream &out, const help_formattert &h)
Definition:
help_formatter.h:46
help_formatter
static help_formattert help_formatter(const std::string &s)
Definition:
help_formatter.h:40
help_formattert::statet
Definition:
help_formatter.h:30
help_formattert::statet::column
std::size_t column
Definition:
help_formatter.h:31
help_formattert::statet::word
std::string word
Definition:
help_formatter.h:33
help_formattert::statet::aligning
bool aligning
Definition:
help_formatter.h:32
src
util
help_formatter.h
Generated by
1.9.1