28 #ifndef CASA_TEMPLATE_H
29 #define CASA_TEMPLATE_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/Containers/Block.h>
34 #include <casacore/casa/BasicSL/String.h>
35 #include <casacore/casa/iosfwd.h>
41 template <
class T>
class Vector;
271 #ifndef CASACORE_NO_AUTO_TEMPLATES
272 #include <casacore/casa/Utilities/Template.tcc>
String: the storage and methods of handling collections of characters.
static const Regex elseRE
static const Regex PATnmax[Nnmax]
static const Regex comment
const String & getTDname(uInt n)
static const Regex classprelude
Tests for finding real templates for duplicate tests.
static const Regex PATcanon20[Ncanon2]
static const Regex namespaceRE
uInt dcount_p
Count the duplicates.
Block< uInt > nval_p
Data split numeric number.
void setComment(const String &txt, const Bool atstart=False)
Save comment.
Block< String > output_p
Each element is a template entry on a single line.
static const Regex stemRE
static const Regex sauxtemplRE
static const uInt Ntypedef
Patterns to make all typedefs comparisons for duplicates possible Note that the first three should be...
static const Regex PATtypedef1[Ntypedef]
void read(const Vector< String > &files)
Read the templates file or files into the class.
static const String REPnmin[Nnmin]
static const Regex templateRE
const String & getTDlist(uInt n)
uInt count_p
Count the lines.
static const uInt Nnmin
Make canonical numbers of 4 digits minimum.
static const Regex PATcanon21[Ncanon2]
static const String singlesp
Block< String > tdname_p
List of comparison names.
static const uInt Nnmax
Make canonical numbers of 4 digits maximum.
Block< Int > comptr_p
And where they originated.
void canonical(const Bool tmplonly=False)
Canonicalise the template entries in the object.
Bool isSplit_p
Indicate data split.
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.
static const Regex sretRE4
uInt getTCount() const
Get the number of templates found after all processing.
uInt getDCount()
Get the number of duplicates found.
void reset()
Clear the object for a re-use.
static const Regex sretRE2
void setOutput(const String &txt)
Save a line.
void writeDup(ostream &os, const String &userFile, Bool isSys=False)
Write the duplicate list; the userFile gets ***; isSys gives the system switch.
static const Regex sifRE
Patterns to check the template line.
static const String PATinif[Ninif]
Block< String > tdlist_p
List of template definitions.
static const String REPinif[Ninif]
static const Regex PATcanon[Ncanon]
Block< String > comout_p
Record comment lines.
Block< uInt > tdline_p
Line number in file at which template found.
const uInt & getTDline(uInt n)
uInt ccount_p
And count the comment lines.
static const Regex endifRE
static const Regex contRE
Template & operator=(const Template &other)
Assignment (not implemented)
static const Regex leadsp
Data to remove spaces at begin, end, make single, count/remove const.
static const String nullsp
static const String REPcanon[Ncanon]
Block< String > namstring_p
Data split name string (first include file)
Block< String > tdflist_p
List of files used.
uInt tdcount_p
Number of template definitions extracted from input.
Template(const String &filename)
Create from the file name given.
static const Regex snamespaceRE
static const Regex spaces
Patterns to analyse an input line.
static const Regex PATnmin[Nnmin]
static String REPtypedef[Ntypedef]
static const Regex mylistprelude
Template(const Template &other)
Copy constructor (not implemented)
static const Regex constsp
static const Regex splitnam
static const uInt Ncanon
Simple pattern and replacements to make canonical templates files.
Block< uInt > tdfile_p
Pointers to in which file in list.
static const Regex fileRE
Template()
Default constructor.
static const Regex auxtemplRE
const String & operator[](uInt n)
Operators.
static const Regex typedefRE
static const Regex funcnameprelude
static const Regex REPnmax[Nnmax]
static const Regex forwardprelude
static const Regex functionprelude
void read(const String &filename)
Block< String > nstring_p
Data split of number string (or empty/spaces)
static const uInt Ncanon2
For canonical change: replacement of pattern with pattern.
static const Regex PATtypedef0[Ntypedef]
static const String reposName
Name of repository files.
static const Regex stypedefRE
static const Regex sretRE1
Block< String > allstring_p
Data split all text.
static const uInt Ninif
Replacement patterns for ifs in saved line.
static const Regex sretRE3
static const String REPcanon2[Ncanon2]
static const Regex sconstRE
Template(const Vector< String > &files)
Create from the file names given.
const uInt & getTDfile(uInt n)
uInt getTDCount() const
Get the number of template definition lines found.
uInt getCount() const
Get the number of template entries.
const String & getTDFlist(uInt n)
Get the various template definition information fields.
void writeOut(ostream &os, const Bool warn=False)
Write the data formatted to the specified file.
uInt tcount_p
Count the templates.
static const Regex splitnum
Patterns to split off number and name Patterns to split off number and name.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.