#include <L1GtVhdlTemplateFile.h>
Public Member Functions | |
void | append (const std::string &str) |
adds a line at the end of the the file with the content of str More... | |
void | append (const L1GtVhdlTemplateFile &file) |
adds the content of file at the end of (*this); the parameter map won't be changed More... | |
bool | close () |
bool | extractParametersFromString (const std::string &str, std::vector< std::string > ¶meters) |
void | getConditionsFromAlgo (std::string condString, std::vector< std::string > &result) |
extracts all conditions from a algorithm More... | |
std::string | getInternalParameter (const std::string &indentifier) |
returns a parameter of a internal template file More... | |
std::vector< std::string > | getSubstitutionParametersFromTemplate () |
returns a vector with all substitution parameters that are found in the template file More... | |
bool | insert (const std::string &atLine, std::vector< std::string > content) |
replaces the whole line containing atLine and inserts content instead of it More... | |
bool | insert (const std::string atLine, L1GtVhdlTemplateFile file) |
replaces the whole line containing atLine with the content of file More... | |
bool | isBlank (const char &chr) |
checks weather a char is a blank More... | |
L1GtVhdlTemplateFile () | |
standard constructor More... | |
L1GtVhdlTemplateFile (const std::string &filename) | |
constructor with filename More... | |
L1GtVhdlTemplateFile (const L1GtVhdlTemplateFile &rhs) | |
copy constructor More... | |
std::string | lines2String () |
returns a string with the content of vector lines More... | |
bool | open (const std::string &fileName, bool internal=false) |
opens a template file. If the header information shall be parsed intern has to be set to true More... | |
void | print () |
prints the content of the VHDL File (only lines_) More... | |
void | printParameterMap () |
prints the parameter map More... | |
bool | removeEmptyLines () |
deletes all empty lines in a template file More... | |
bool | removeLineWithContent (const std::string &str) |
removes all lines that contain the str More... | |
std::vector< std::string > | returnLines () |
returns a string vector with the current content of the VHDL File More... | |
std::map< std::string, std::string > | returnParameterMap () |
returns parameter map More... | |
bool | save (const std::string &fileName) |
saves the content of the template file to a local file (the content of parameterMap_ will not be saved!) More... | |
bool | split (const std::string ¶m, std::vector< std::string > &result) |
seperates a string at all blanks and saves the elements in result More... | |
bool | substitute (const std::string &searchString, const std::string &replaceString) |
replaces searchString with replaceString More... | |
~L1GtVhdlTemplateFile () | |
destructor More... | |
Static Public Member Functions | |
static const bool | findAndReplaceString (std::string ¶mString, const std::string &searchString, const std::string &replaceString) |
replaces searchString with replaceString at it's first occurance in string More... | |
Private Attributes | |
bool | intern_ |
std::vector< std::string > | lines_ |
containing the content of the VHDL file More... | |
std::map< std::string, std::string > | parameterMap_ |
containing the header information of internal files More... | |
The routines of this class provide all necessary features to deal with the VHDL templates for the firmware code of the GT
Implementation: <TODO: enter implementation details>
$Date$ $Revision$
Description: a class to deal with VHDL template files
Implementation: <TODO: enter implementation details>
$Date$ $Revision$
Definition at line 27 of file L1GtVhdlTemplateFile.h.
L1GtVhdlTemplateFile::L1GtVhdlTemplateFile | ( | ) |
L1GtVhdlTemplateFile::L1GtVhdlTemplateFile | ( | const std::string & | filename | ) |
constructor with filename
Definition at line 38 of file L1GtVhdlTemplateFile.cc.
References gather_cfg::cout, and open().
L1GtVhdlTemplateFile::L1GtVhdlTemplateFile | ( | const L1GtVhdlTemplateFile & | rhs | ) |
copy constructor
Definition at line 45 of file L1GtVhdlTemplateFile.cc.
References intern_, lines_, and parameterMap_.
L1GtVhdlTemplateFile::~L1GtVhdlTemplateFile | ( | ) |
void L1GtVhdlTemplateFile::append | ( | const std::string & | str | ) |
adds a line at the end of the the file with the content of str
Definition at line 342 of file L1GtVhdlTemplateFile.cc.
References lines_.
Referenced by L1GtVhdlWriterCore::buildDefValuesBuffer(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), BeautifulSoup.Tag::setString(), and L1GtVhdlWriterCore::writeMuonSetupVhdl().
void L1GtVhdlTemplateFile::append | ( | const L1GtVhdlTemplateFile & | file | ) |
adds the content of file at the end of (*this); the parameter map won't be changed
Definition at line 348 of file L1GtVhdlTemplateFile.cc.
Referenced by BeautifulSoup.Tag::setString().
bool L1GtVhdlTemplateFile::close | ( | void | ) |
Definition at line 249 of file L1GtVhdlTemplateFile.cc.
Referenced by lumiQTWidget.ApplicationWindow::fileQuit(), Vispa.Gui.BoxContentDialog.BoxContentDialog::keyPressEvent(), and Vispa.Gui.FindDialog.FindDialog::keyPressEvent().
bool L1GtVhdlTemplateFile::extractParametersFromString | ( | const std::string & | str, |
std::vector< std::string > & | parameters | ||
) |
finds all substitution parameters in str and collects them in the vector parameters. This routine is used by getSubstitutionParametersFromTemplate();
Definition at line 294 of file L1GtVhdlTemplateFile.cc.
References Parameters::parameters.
Referenced by getSubstitutionParametersFromTemplate().
|
static |
replaces searchString with replaceString at it's first occurance in string
Definition at line 61 of file L1GtVhdlTemplateFile.cc.
References position.
Referenced by L1GtVhdlWriterCore::buildDefValuesBuffer(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), getConditionsFromAlgo(), L1GtVhdlWriterCore::getSubstParamCommonFromTriggerMenu(), L1GtVhdlWriterCore::processAlgorithmMap(), substitute(), L1GtVhdlWriterCore::writeAlgoSetup(), L1GtVhdlWriterCore::writeCondChipPkg(), L1GtVhdlWriterCore::writeConditionChipSetup(), L1GtVhdlWriterCore::writeDefValPkg(), L1GtVhdlWriterCore::writeEtmSetup(), L1GtVhdlWriterCore::writeMuonSetupVhdl(), and L1GtVhdlWriterCore::writeQsfSetupFiles().
void L1GtVhdlTemplateFile::getConditionsFromAlgo | ( | std::string | condString, |
std::vector< std::string > & | result | ||
) |
extracts all conditions from a algorithm
Definition at line 427 of file L1GtVhdlTemplateFile.cc.
References findAndReplaceString(), i, and split().
Referenced by L1GtVhdlWriterCore::processAlgorithmMap().
std::string L1GtVhdlTemplateFile::getInternalParameter | ( | const std::string & | indentifier | ) |
returns a parameter of a internal template file
Definition at line 463 of file L1GtVhdlTemplateFile.cc.
References parameterMap_.
Referenced by L1GtVhdlWriterCore::buildDefValuesBuffer(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), and L1GtVhdlWriterCore::writeDefValPkg().
std::vector< std::string > L1GtVhdlTemplateFile::getSubstitutionParametersFromTemplate | ( | ) |
returns a vector with all substitution parameters that are found in the template file
Definition at line 325 of file L1GtVhdlTemplateFile.cc.
References extractParametersFromString(), lines_, and groupFilesInBlocks::temp.
Referenced by L1GtVhdlWriterCore::writeMuonSetupVhdl().
bool L1GtVhdlTemplateFile::insert | ( | const std::string & | atLine, |
std::vector< std::string > | content | ||
) |
replaces the whole line containing atLine and inserts content instead of it
Definition at line 212 of file L1GtVhdlTemplateFile.cc.
References lines_, and summarizeEdmComparisonLogfiles::success.
Referenced by BeautifulSoup.PageElement::_invert(), L1GtVhdlWriterCore::buildCommonHeader(), insert(), L1GtVhdlWriterCore::openVhdlFileWithCommonHeader(), L1GtVhdlWriterCore::writeCondChipPkg(), L1GtVhdlWriterCore::writeConditionChipSetup(), L1GtVhdlWriterCore::writeDefValPkg(), and L1GtVhdlWriterCore::writeMuonSetupVhdl().
bool L1GtVhdlTemplateFile::insert | ( | const std::string | atLine, |
L1GtVhdlTemplateFile | file | ||
) |
replaces the whole line containing atLine with the content of file
Definition at line 239 of file L1GtVhdlTemplateFile.cc.
References insert(), returnLines(), and groupFilesInBlocks::temp.
Referenced by BeautifulSoup.PageElement::_invert().
bool L1GtVhdlTemplateFile::isBlank | ( | const char & | chr | ) |
checks weather a char is a blank
Definition at line 391 of file L1GtVhdlTemplateFile.cc.
Referenced by split().
std::string L1GtVhdlTemplateFile::lines2String | ( | ) |
returns a string with the content of vector lines
Definition at line 447 of file L1GtVhdlTemplateFile.cc.
References lines_.
bool L1GtVhdlTemplateFile::open | ( | const std::string & | fileName, |
bool | internal = false |
||
) |
opens a template file. If the header information shall be parsed intern has to be set to true
Definition at line 71 of file L1GtVhdlTemplateFile.cc.
References recoMuon::in, analyzePatCOC_cfg::inputFile, lines_, and parameterMap_.
Referenced by L1GtVhdlWriterCore::buildCommonHeader(), L1GtVhdlWriterCore::buildDefValuesBuffer(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), L1GtVhdlTemplateFile(), L1GtVhdlWriterCore::writeDefValPkg(), L1GtVhdlWriterCore::writeMuonSetupVhdl(), and L1GtVhdlWriterCore::writeQsfSetupFiles().
void L1GtVhdlTemplateFile::print | ( | void | ) |
prints the content of the VHDL File (only lines_)
Definition at line 256 of file L1GtVhdlTemplateFile.cc.
References gather_cfg::cout, and lines_.
Referenced by L1GtVhdlWriterCore::printCommonHeader().
void L1GtVhdlTemplateFile::printParameterMap | ( | ) |
prints the parameter map
Definition at line 274 of file L1GtVhdlTemplateFile.cc.
References gather_cfg::cout, and parameterMap_.
bool L1GtVhdlTemplateFile::removeEmptyLines | ( | ) |
deletes all empty lines in a template file
Definition at line 377 of file L1GtVhdlTemplateFile.cc.
References lines_.
Referenced by L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), and L1GtVmeWriterCore::writeVME().
bool L1GtVhdlTemplateFile::removeLineWithContent | ( | const std::string & | str | ) |
removes all lines that contain the str
Definition at line 357 of file L1GtVhdlTemplateFile.cc.
References lines_, position, and summarizeEdmComparisonLogfiles::success.
Referenced by L1GtVhdlWriterCore::writeMuonSetupVhdl().
std::vector< std::string > L1GtVhdlTemplateFile::returnLines | ( | ) |
returns a string vector with the current content of the VHDL File
Definition at line 268 of file L1GtVhdlTemplateFile.cc.
References lines_.
Referenced by insert(), and L1GtVmeWriterCore::writeVME().
std::map< std::string, std::string > L1GtVhdlTemplateFile::returnParameterMap | ( | ) |
returns parameter map
Definition at line 288 of file L1GtVhdlTemplateFile.cc.
References parameterMap_.
Referenced by L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), L1GtVhdlWriterCore::getSubstParamCommonFromTriggerMenu(), and L1GtVhdlWriterCore::writeMuonSetupVhdl().
bool L1GtVhdlTemplateFile::save | ( | const std::string & | fileName | ) |
saves the content of the template file to a local file (the content of parameterMap_ will not be saved!)
Definition at line 170 of file L1GtVhdlTemplateFile.cc.
References lines_, and download_sqlite_cfg::outputFile.
Referenced by L1GtVhdlWriterCore::writeAlgoSetup(), L1GtVhdlWriterCore::writeCondChipPkg(), L1GtVhdlWriterCore::writeConditionChipSetup(), L1GtVhdlWriterCore::writeDefValPkg(), L1GtVhdlWriterCore::writeEtmSetup(), L1GtVhdlWriterCore::writeMuonSetupVhdl(), and L1GtVhdlWriterCore::writeQsfSetupFiles().
bool L1GtVhdlTemplateFile::split | ( | const std::string & | param, |
std::vector< std::string > & | result | ||
) |
seperates a string at all blanks and saves the elements in result
Definition at line 399 of file L1GtVhdlTemplateFile.cc.
References i, isBlank(), pos, query::result, and groupFilesInBlocks::temp.
Referenced by getConditionsFromAlgo().
bool L1GtVhdlTemplateFile::substitute | ( | const std::string & | searchString, |
const std::string & | replaceString | ||
) |
replaces searchString with replaceString
Definition at line 190 of file L1GtVhdlTemplateFile.cc.
References findAndReplaceString(), lines_, and summarizeEdmComparisonLogfiles::success.
Referenced by L1GtVhdlWriterCore::buildCommonHeader(), L1GtVhdlWriterCore::buildDefValuesBuffer(), L1GtVhdlWriterCore::getCondChipVhdContentFromTriggerMenu(), L1GtVhdlWriterCore::openVhdlFileWithCommonHeader(), L1GtVhdlWriterCore::writeAlgoSetup(), L1GtVhdlWriterCore::writeCondChipPkg(), L1GtVhdlWriterCore::writeConditionChipSetup(), L1GtVhdlWriterCore::writeEtmSetup(), L1GtVhdlWriterCore::writeMuonSetupVhdl(), L1GtVhdlWriterCore::writeQsfSetupFiles(), and L1GtVmeWriterCore::writeVME().
|
private |
internal files additionally have entries in parameterMap_ for "normal" files parameterMap is empty
Definition at line 33 of file L1GtVhdlTemplateFile.h.
Referenced by L1GtVhdlTemplateFile().
|
private |
containing the content of the VHDL file
Definition at line 35 of file L1GtVhdlTemplateFile.h.
Referenced by append(), getSubstitutionParametersFromTemplate(), insert(), L1GtVhdlTemplateFile(), lines2String(), open(), print(), removeEmptyLines(), removeLineWithContent(), returnLines(), save(), and substitute().
|
private |
containing the header information of internal files
Definition at line 37 of file L1GtVhdlTemplateFile.h.
Referenced by getInternalParameter(), L1GtVhdlTemplateFile(), open(), printParameterMap(), and returnParameterMap().