diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-18 12:50:12 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-18 12:52:25 +0200 |
commit | 5a01a260c368d3045f0870cc09620a772027e911 (patch) | |
tree | 504d6d3d1504d0c8e180d1f36eed17b2a3fff07a /cli/txt.hxx | |
parent | 650ea3bd3bac1fa50f9c8566d5def774c5eb2fee (diff) |
Initial support for plain text documentation (--generate-txt)
Support for option documentation generation is still a TODO.
Diffstat (limited to 'cli/txt.hxx')
-rw-r--r-- | cli/txt.hxx | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/cli/txt.hxx b/cli/txt.hxx new file mode 100644 index 0000000..b0a667c --- /dev/null +++ b/cli/txt.hxx @@ -0,0 +1,44 @@ +// file : cli/txt.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef CLI_TXT_HXX +#define CLI_TXT_HXX + +#include <iosfwd> // ostream +#include <string> +#include <cstddef> // size_t + +#include "context.hxx" + +void +generate_txt (context&); + +// Return the number of "text characters", ignoring any escape sequences +// (e.g., ANSI color). +// +std::size_t +txt_size (const std::string&, + std::size_t p = 0, + std::size_t n = std::string::npos); + +// This function assumes that the initial opening part has already been +// written with the 'first' argument being the number of characters already +// written in the first line (e.g., an option name). The 'indent' argument +// specified how many spaces to indent each line. The 'escape' argument is +// the optional escape function (e.g., for the string literal output). The +// line_{start, end, blank} arguments specify optional extra text for the +// start/end of the non-empty line as well as for the blank (empty) line. +// +void +txt_wrap_lines (std::ostream& os, + const std::string&, + std::size_t indent = 0, + std::size_t first = 0, + const char* line_start = "", + const char* line_end = "", + const char* line_blank = "", + std::string (*escape) (std::string const&) = 0); + +#endif // CLI_TXT_HXX |