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