casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Static Public Member Functions | List of all members
option::PrintUsageImplementation Struct Reference

#include <optionparser.h>

Classes

struct  FunctionWriter
 
struct  IStringWriter
 
class  LinePartIterator
 
class  LineWrapper
 
struct  OStreamWriter
 
struct  StreamWriter
 
struct  SyscallWriter
 
struct  TemporaryWriter
 

Static Public Member Functions

static void upmax (int &i1, int i2)
 
static void indent (IStringWriter &write, int &x, int want_x)
 
static bool isWideChar (unsigned ch)
 Returns true if ch is the unicode code point of a wide character. More...
 
static void printUsage (IStringWriter &write, const Descriptor usage[], int width=80, int last_column_min_percent=50, int last_column_own_line_max_percent=75)
 

Detailed Description

Definition at line 1724 of file optionparser.h.

Member Function Documentation

static void option::PrintUsageImplementation::indent ( IStringWriter write,
int &  x,
int  want_x 
)
inlinestatic
static bool option::PrintUsageImplementation::isWideChar ( unsigned  ch)
inlinestatic

Returns true if ch is the unicode code point of a wide character.

Note
The following character ranges are treated as wide
* 1100..115F
* 2329..232A (just 2 characters!)
* 2E80..A4C6 except for 303F
* A960..A97C
* AC00..D7FB
* F900..FAFF
* FE10..FE6B
* FF01..FF60
* FFE0..FFE6
* 1B000......
*

Definition at line 1903 of file optionparser.h.

Referenced by option::PrintUsageImplementation::LineWrapper::process(), and option::PrintUsageImplementation::LinePartIterator::update_length().

static void option::PrintUsageImplementation::printUsage ( IStringWriter write,
const Descriptor  usage[],
int  width = 80,
int  last_column_min_percent = 50,
int  last_column_own_line_max_percent = 75 
)
inlinestatic

We don't let rows that don't use table separators ( or ) influence the width of column 0. This allows the user to interject section headers or explanatory paragraphs that do not participate in the table layout.

If lastcolumn == 0 we must disable print_last_column_on_own_line because otherwise 2 copies of the last (and only) column would be output. Actually this is just defensive programming. It is currently not possible that lastcolumn==0 and print_last_column_on_own_line==true at the same time, because lastcolumn==0 => tabstop[lastcolumn] == 0 => rightwidth==width => rightwidth>=last_column_min_width (unless someone passes a bullshit value >100 for last_column_min_percent) => the above if condition is false => print_last_column_on_own_line==false

an interjection that doesn't contain or

NOTE: This code block is not necessarily executed for each line, because some rows may have fewer columns.

Definition at line 2447 of file optionparser.h.

References option::PrintUsageImplementation::LinePartIterator::column(), option::PrintUsageImplementation::LinePartIterator::data(), option::PrintUsageImplementation::LineWrapper::flush(), indent(), option::PrintUsageImplementation::LinePartIterator::length(), option::PrintUsageImplementation::LinePartIterator::line(), option::PrintUsageImplementation::LinePartIterator::next(), option::PrintUsageImplementation::LinePartIterator::nextRow(), option::PrintUsageImplementation::LinePartIterator::nextTable(), option::PrintUsageImplementation::LineWrapper::process(), option::PrintUsageImplementation::LinePartIterator::restartRow(), option::PrintUsageImplementation::LinePartIterator::restartTable(), option::PrintUsageImplementation::LinePartIterator::screenLength(), upmax(), and write().

Referenced by option::printUsage().

static void option::PrintUsageImplementation::upmax ( int &  i1,
int  i2 
)
inlinestatic

The documentation for this struct was generated from the following file: