casa
5.7.0-16
|
Canonicalise, format and other actions on Casacore template definitions. More...
#include <Template.h>
Public Member Functions | |
Template () | |
Default constructor. More... | |
Template (const Vector< String > &files) | |
Create from the file names given. More... | |
Template (const String &filename) | |
Create from the file name given. More... | |
~Template () | |
Destructor. More... | |
const String & | operator[] (uInt n) |
Operators. More... | |
void | reset () |
Clear the object for a re-use. More... | |
void | read (const Vector< String > &files) |
Read the templates file or files into the class. More... | |
void | read (const String &filename) |
uInt | getCount () const |
Get the number of template entries. More... | |
uInt | getTDCount () const |
Get the number of template definition lines found. More... | |
uInt | getTCount () const |
Get the number of templates found after all processing. More... | |
uInt | getDCount () |
Get the number of duplicates found. More... | |
const String & | getTDFlist (uInt n) |
Get the various template definition information fields. More... | |
const String & | getTDlist (uInt n) |
const uInt & | getTDfile (uInt n) |
const uInt & | getTDline (uInt n) |
const String & | getTDname (uInt n) |
void | canonical (const Bool tmplonly=False) |
Canonicalise the template entries in the object. More... | |
void | splitName () |
Split the entries in number, name id, rest. More... | |
void | sortName (const Bool renumber=False) |
Sort the data on name and number and fill in missing number. More... | |
void | writeOut (ostream &os, const Bool warn=False) |
Write the data formatted to the specified file. More... | |
void | writeDup (ostream &os, const String &userFile, Bool isSys=False) |
Write the duplicate list; the userFile gets ***; isSys gives the system switch. More... | |
Private Member Functions | |
Template (const Template &other) | |
Copy constructor (not implemented) More... | |
Template & | operator= (const Template &other) |
Assignment (not implemented) More... | |
void | setComment (const String &txt, const Bool atstart=False) |
Save comment. More... | |
void | setOutput (const String &txt) |
Save a line. More... | |
Private Attributes | |
Block< String > | output_p |
Each element is a template entry on a single line. More... | |
uInt | count_p |
Count the lines. More... | |
uInt | tcount_p |
Count the templates. More... | |
Block< String > | comout_p |
Record comment lines. More... | |
Block< Int > | comptr_p |
And where they originated. More... | |
uInt | ccount_p |
And count the comment lines. More... | |
Bool | isSplit_p |
Indicate data split. More... | |
uInt | dcount_p |
Count the duplicates. More... | |
Block< String > | nstring_p |
Data split of number string (or empty/spaces) More... | |
Block< String > | allstring_p |
Data split all text. More... | |
Block< String > | namstring_p |
Data split name string (first include file) More... | |
Block< uInt > | nval_p |
Data split numeric number. More... | |
Block< String > | tdflist_p |
List of files used. More... | |
uInt | tdcount_p |
Number of template definitions extracted from input. More... | |
Block< String > | tdlist_p |
List of template definitions. More... | |
Block< uInt > | tdfile_p |
Pointers to in which file in list. More... | |
Block< uInt > | tdline_p |
Line number in file at which template found. More... | |
Block< String > | tdname_p |
List of comparison names. More... | |
Static Private Attributes | |
static const Regex | spaces |
Patterns to analyse an input line. More... | |
static const Regex | comment |
static const Regex | ifRE |
static const Regex | endifRE |
static const Regex | elseRE |
static const Regex | templateRE |
static const Regex | contRE |
static const Regex | fileRE |
static const Regex | typedefRE |
static const Regex | auxtemplRE |
static const Regex | namespaceRE |
static const uInt | Ncanon |
Simple pattern and replacements to make canonical templates files. More... | |
static const Regex | PATcanon [Ncanon] |
static const String | REPcanon [Ncanon] |
static const uInt | Ncanon2 |
For canonical change: replacement of pattern with pattern. More... | |
static const Regex | PATcanon20 [Ncanon2] |
static const Regex | PATcanon21 [Ncanon2] |
static const String | REPcanon2 [Ncanon2] |
static const uInt | Nnmin |
Make canonical numbers of 4 digits minimum. More... | |
static const Regex | PATnmin [Nnmin] |
static const String | REPnmin [Nnmin] |
static const uInt | Nnmax |
Make canonical numbers of 4 digits maximum. More... | |
static const Regex | PATnmax [Nnmax] |
static const Regex | REPnmax [Nnmax] |
static const Regex | splitnum |
Patterns to split off number and name Patterns to split off number and name. More... | |
static const Regex | splitnam |
static const Regex | sifRE |
Patterns to check the template line. More... | |
static const Regex | stemRE |
static const Regex | sconstRE |
static const Regex | sretRE1 |
static const Regex | sretRE2 |
static const Regex | sretRE3 |
static const Regex | sretRE4 |
static const Regex | stypedefRE |
static const Regex | sauxtemplRE |
static const Regex | snamespaceRE |
static const uInt | Ninif |
Replacement patterns for ifs in saved line. More... | |
static const String | PATinif [Ninif] |
static const String | REPinif [Ninif] |
static const Regex | classprelude |
Tests for finding real templates for duplicate tests. More... | |
static const Regex | functionprelude |
static const Regex | forwardprelude |
static const Regex | funcnameprelude |
static const Regex | mylistprelude |
static const Regex | leadsp |
Data to remove spaces at begin, end, make single, count/remove const. More... | |
static const Regex | endsp |
static const Regex | mulsp |
static const Regex | constsp |
static const String | nullsp |
static const String | singlesp |
static const uInt | Ntypedef |
Patterns to make all typedefs comparisons for duplicates possible Note that the first three should be in that position for run-time change on some systems. More... | |
static const Regex | PATtypedef0 [Ntypedef] |
static const Regex | PATtypedef1 [Ntypedef] |
static String | REPtypedef [Ntypedef] |
static const String | reposName |
Name of repository files. More... | |
Canonicalise, format and other actions on Casacore template definitions.
Internal
A set of methods on template repository files and on template definitions to be used in the reident, used, unused and duplicates programs (see Sytem manual for details. <br /br> Methods exist to read templates, to canonicalise them for comparison and search functions and to format them for output.
To make template formatting identical across formatting/testing programs.
Definition at line 73 of file Template.h.
casacore::Template::Template | ( | ) |
Default constructor.
Need to read data into it
Create from the file names given.
|
explicit |
Create from the file name given.
casacore::Template::~Template | ( | ) |
Destructor.
|
private |
Copy constructor (not implemented)
Canonicalise the template entries in the object.
If switch True, do only the templates entry for duplication
|
inline |
|
inline |
|
inline |
Get the number of templates found after all processing.
Definition at line 104 of file Template.h.
References tcount_p.
|
inline |
Get the number of template definition lines found.
Definition at line 102 of file Template.h.
References tdcount_p.
Definition at line 112 of file Template.h.
References tdfile_p.
Get the various template definition information fields.
Meant for testing and special projects only.
Definition at line 110 of file Template.h.
References tdflist_p.
Definition at line 113 of file Template.h.
References tdline_p.
Definition at line 111 of file Template.h.
References tdlist_p.
Definition at line 114 of file Template.h.
References tdname_p.
Assignment (not implemented)
Read the templates file or files into the class.
Multiple reading is additive. Errors are reported to cerr, and commented out in the file.
void casacore::Template::read | ( | const String & | filename | ) |
void casacore::Template::reset | ( | ) |
Clear the object for a re-use.
Save comment.
|
private |
Save a line.
Sort the data on name and number and fill in missing number.
If switch is True, renumber all template entries in sequence.
void casacore::Template::splitName | ( | ) |
Split the entries in number, name id, rest.
Write the duplicate list; the userFile gets ***; isSys gives the system switch.
Write the data formatted to the specified file.
Notify errors and warnings by writing to cerr
. If warn
is False, some warnings will be compressed into a general warning.
Data split all text.
Definition at line 153 of file Template.h.
|
staticprivate |
Definition at line 195 of file Template.h.
|
private |
And count the comment lines.
Definition at line 145 of file Template.h.
|
staticprivate |
Tests for finding real templates for duplicate tests.
Definition at line 241 of file Template.h.
|
staticprivate |
Definition at line 187 of file Template.h.
Record comment lines.
Definition at line 141 of file Template.h.
And where they originated.
Definition at line 143 of file Template.h.
|
staticprivate |
Definition at line 251 of file Template.h.
|
staticprivate |
Definition at line 192 of file Template.h.
|
private |
|
private |
|
staticprivate |
Definition at line 190 of file Template.h.
|
staticprivate |
Definition at line 189 of file Template.h.
|
staticprivate |
Definition at line 249 of file Template.h.
|
staticprivate |
Definition at line 193 of file Template.h.
|
staticprivate |
Definition at line 243 of file Template.h.
|
staticprivate |
Definition at line 244 of file Template.h.
|
staticprivate |
Definition at line 242 of file Template.h.
|
staticprivate |
Definition at line 188 of file Template.h.
|
private |
Indicate data split.
Definition at line 147 of file Template.h.
|
staticprivate |
Data to remove spaces at begin, end, make single, count/remove const.
Definition at line 248 of file Template.h.
|
staticprivate |
Definition at line 250 of file Template.h.
|
staticprivate |
Definition at line 245 of file Template.h.
|
staticprivate |
Definition at line 196 of file Template.h.
Data split name string (first include file)
Definition at line 155 of file Template.h.
|
staticprivate |
Simple pattern and replacements to make canonical templates files.
Definition at line 199 of file Template.h.
|
staticprivate |
For canonical change: replacement of pattern with pattern.
Definition at line 204 of file Template.h.
|
staticprivate |
Replacement patterns for ifs in saved line.
Definition at line 236 of file Template.h.
|
staticprivate |
Make canonical numbers of 4 digits maximum.
Definition at line 214 of file Template.h.
|
staticprivate |
Make canonical numbers of 4 digits minimum.
Definition at line 210 of file Template.h.
Data split of number string (or empty/spaces)
Definition at line 151 of file Template.h.
|
staticprivate |
Patterns to make all typedefs comparisons for duplicates possible Note that the first three should be in that position for run-time change on some systems.
Definition at line 258 of file Template.h.
|
staticprivate |
Definition at line 252 of file Template.h.
Data split numeric number.
Definition at line 157 of file Template.h.
Each element is a template entry on a single line.
Definition at line 135 of file Template.h.
Referenced by operator[]().
Definition at line 200 of file Template.h.
Definition at line 205 of file Template.h.
Definition at line 206 of file Template.h.
Definition at line 237 of file Template.h.
Definition at line 215 of file Template.h.
Definition at line 211 of file Template.h.
Definition at line 259 of file Template.h.
Definition at line 260 of file Template.h.
Definition at line 201 of file Template.h.
Definition at line 207 of file Template.h.
Definition at line 238 of file Template.h.
Definition at line 216 of file Template.h.
Definition at line 212 of file Template.h.
|
staticprivate |
Name of repository files.
Definition at line 264 of file Template.h.
Definition at line 261 of file Template.h.
|
staticprivate |
Definition at line 232 of file Template.h.
|
staticprivate |
Definition at line 226 of file Template.h.
|
staticprivate |
Patterns to check the template line.
Definition at line 224 of file Template.h.
|
staticprivate |
Definition at line 253 of file Template.h.
|
staticprivate |
Definition at line 233 of file Template.h.
|
staticprivate |
Patterns to analyse an input line.
Definition at line 186 of file Template.h.
|
staticprivate |
Definition at line 221 of file Template.h.
|
staticprivate |
Patterns to split off number and name Patterns to split off number and name.
Definition at line 220 of file Template.h.
|
staticprivate |
Definition at line 227 of file Template.h.
|
staticprivate |
Definition at line 228 of file Template.h.
|
staticprivate |
Definition at line 229 of file Template.h.
|
staticprivate |
Definition at line 230 of file Template.h.
|
staticprivate |
Definition at line 225 of file Template.h.
|
staticprivate |
Definition at line 231 of file Template.h.
|
private |
|
private |
Number of template definitions extracted from input.
Definition at line 162 of file Template.h.
Referenced by getTDCount().
Pointers to in which file in list.
Definition at line 166 of file Template.h.
Referenced by getTDfile().
Line number in file at which template found.
Definition at line 168 of file Template.h.
Referenced by getTDline().
|
staticprivate |
Definition at line 191 of file Template.h.
|
staticprivate |
Definition at line 194 of file Template.h.