CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
help_formatter.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Help Formatter
4
5Author: 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
19{
20public:
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
28protected:
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
40static inline help_formattert help_formatter(const std::string &s)
41{
42 return help_formattert(s);
43}
44
45static inline std::ostream &
46operator<<(std::ostream &out, const help_formattert &h)
47{
48 h(out);
49 return out;
50}
51
52#endif // CPROVER_UTIL_HELP_FORMATTER_H
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
static const std::size_t first_column_width
void operator()(std::ostream &) const
help_formattert(const std::string &_s)
static void emit_word(statet &, std::ostream &)
const std::string & s
static help_formattert help_formatter(const std::string &s)
static std::ostream & operator<<(std::ostream &out, const help_formattert &h)