casa
5.7.0-16
|
#include <optionparser.h>
Public Member Functions | |
LinePartIterator (const Descriptor usage[]) | |
! More... | |
bool | nextTable () |
Moves iteration to the next table (if any). More... | |
void | restartTable () |
Reset iteration to the beginning of the current table. More... | |
bool | nextRow () |
Moves iteration to the next row (if any). More... | |
void | restartRow () |
Reset iteration to the beginning of the current row. More... | |
bool | next () |
Moves iteration to the next part (if any). More... | |
int | column () |
Returns the index (counting from 0) of the column in which the part pointed to by data() is located. More... | |
int | line () |
Returns the index (counting from 0) of the line within the current column this part belongs to. More... | |
int | length () |
Returns the length of the part pointed to by data() in raw chars (not UTF-8 characters). More... | |
int | screenLength () |
Returns the width in screen columns of the part pointed to by data(). More... | |
const char * | data () |
Returns the current part of the iteration. More... | |
Private Member Functions | |
void | update_length () |
Determines the byte and character lengths of the part at ptr and stores them in len and screenlen respectively. More... | |
Private Attributes | |
const Descriptor * | tablestart |
The 1st descriptor of the current table. More... | |
const Descriptor * | rowdesc |
The Descriptor that contains the current row. More... | |
const char * | rowstart |
Ptr to 1st character of current row within rowdesc->help. More... | |
const char * | ptr |
Ptr to current part within the current row. More... | |
int | col |
Index of current column. More... | |
int | len |
Length of the current part (that ptr points at) in BYTES. More... | |
int | screenlen |
Length of the current part in screen columns (taking narrow/wide chars into account). More... | |
int | max_line_in_block |
Greatest index of a line within the block. This is the number of \v within the cell with the most \vs. More... | |
int | line_in_block |
Line index within the current cell of the current part. More... | |
int | target_line_in_block |
Line index of the parts we should return to the user on this iteration. More... | |
bool | hit_target_line |
Flag whether we encountered a part with line index target_line_in_block in the current cell. More... | |
Definition at line 1950 of file optionparser.h.
|
inline |
|
inline |
Returns the index (counting from 0) of the column in which the part pointed to by data() is located.
Definition at line 2161 of file optionparser.h.
References col.
Referenced by option::PrintUsageImplementation::printUsage().
|
inline |
Returns the current part of the iteration.
Definition at line 2195 of file optionparser.h.
References ptr.
Referenced by option::PrintUsageImplementation::printUsage().
|
inline |
Returns the length of the part pointed to by data() in raw chars (not UTF-8 characters).
Definition at line 2178 of file optionparser.h.
References len.
Referenced by option::PrintUsageImplementation::printUsage().
|
inline |
Returns the index (counting from 0) of the line within the current column this part belongs to.
Definition at line 2170 of file optionparser.h.
References target_line_in_block.
Referenced by option::PrintUsageImplementation::printUsage().
|
inline |
Moves iteration to the next part (if any).
Has to be called once after each call to nextRow() to move to the 1st part of the row.
false | if moving to next part failed because no further part exists. |
See LinePartIterator for details about the iteration.
Definition at line 2089 of file optionparser.h.
References col, hit_target_line, len, line_in_block, max_line_in_block, ptr, rowstart, target_line_in_block, update_length(), and option::PrintUsageImplementation::upmax().
Referenced by option::PrintUsageImplementation::printUsage().
|
inline |
Moves iteration to the next row (if any).
Has to be called once after each call to nextTable() to move to the 1st row of the table.
false | if moving to next row failed because no further row exists. |
Definition at line 2039 of file optionparser.h.
References casa::QtMouseToolNames::help(), option::Descriptor::help, ptr, restartRow(), rowdesc, and rowstart.
Referenced by option::PrintUsageImplementation::printUsage().
|
inline |
Moves iteration to the next table (if any).
Has to be called once on a new LinePartIterator to move to the 1st table.
false | if moving to next table failed because no further table exists. |
If this is NOT the first time nextTable() is called after the constructor, then skip to the next table break (i.e. a Descriptor with help == 0)
Find the next table after the break (if any)
Definition at line 2006 of file optionparser.h.
References option::Descriptor::help, restartTable(), rowdesc, rowstart, option::Descriptor::shortopt, and tablestart.
Referenced by option::PrintUsageImplementation::printUsage().
|
inline |
Reset iteration to the beginning of the current row.
Definition at line 2070 of file optionparser.h.
References col, hit_target_line, len, line_in_block, max_line_in_block, ptr, rowstart, screenlen, and target_line_in_block.
Referenced by nextRow(), and option::PrintUsageImplementation::printUsage().
|
inline |
Reset iteration to the beginning of the current table.
Definition at line 2027 of file optionparser.h.
References option::Descriptor::help, ptr, rowdesc, rowstart, and tablestart.
Referenced by nextTable(), and option::PrintUsageImplementation::printUsage().
|
inline |
Returns the width in screen columns of the part pointed to by data().
Takes multi-byte UTF-8 sequences and wide characters into account.
Definition at line 2187 of file optionparser.h.
References screenlen.
Referenced by option::PrintUsageImplementation::printUsage().
|
inlineprivate |
Determines the byte and character lengths of the part at ptr and stores them in len and screenlen respectively.
int __builtin_clz (unsigned int x) Returns the number of leading 0-bits in x, starting at the most significant bit
ch is the decoded unicode code point
Definition at line 1968 of file optionparser.h.
References option::PrintUsageImplementation::isWideChar(), len, casacore::mask(), ptr, and screenlen.
Referenced by next().
|
private |
Index of current column.
Definition at line 1956 of file optionparser.h.
Referenced by column(), next(), and restartRow().
|
private |
Flag whether we encountered a part with line index target_line_in_block in the current cell.
Definition at line 1962 of file optionparser.h.
Referenced by next(), and restartRow().
|
private |
Length of the current part (that ptr points at) in BYTES.
Definition at line 1957 of file optionparser.h.
Referenced by length(), next(), restartRow(), and update_length().
|
private |
Line index within the current cell of the current part.
Definition at line 1960 of file optionparser.h.
Referenced by next(), and restartRow().
|
private |
Greatest index of a line within the block. This is the number of \v within the cell with the most \vs.
Definition at line 1959 of file optionparser.h.
Referenced by next(), and restartRow().
|
private |
Ptr to current part within the current row.
Definition at line 1955 of file optionparser.h.
Referenced by data(), next(), nextRow(), restartRow(), restartTable(), and update_length().
|
private |
The Descriptor that contains the current row.
Definition at line 1953 of file optionparser.h.
Referenced by nextRow(), nextTable(), and restartTable().
|
private |
Ptr to 1st character of current row within rowdesc->help.
Definition at line 1954 of file optionparser.h.
Referenced by next(), nextRow(), nextTable(), restartRow(), and restartTable().
|
private |
Length of the current part in screen columns (taking narrow/wide chars into account).
Definition at line 1958 of file optionparser.h.
Referenced by restartRow(), screenLength(), and update_length().
|
private |
The 1st descriptor of the current table.
Definition at line 1952 of file optionparser.h.
Referenced by nextTable(), and restartTable().
|
private |
Line index of the parts we should return to the user on this iteration.
Definition at line 1961 of file optionparser.h.
Referenced by line(), next(), and restartRow().