OpenASIP 2.2
|
#include <TextGenerator.hh>
Public Member Functions | |
TextGenerator () | |
virtual | ~TextGenerator () |
virtual boost::format | text (int textId) |
virtual void | addText (int textId, const std::string &templateString) |
virtual void | replaceText (int textId, const std::string &newString) |
Private Types | |
typedef std::map< int, conststd::string * >::value_type | ValType |
value_type for map. | |
typedef std::map< int, conststd::string * >::iterator | MapIter |
Iterator for map. | |
Private Member Functions | |
TextGenerator (const TextGenerator &) | |
Copying not allowed. | |
TextGenerator & | operator= (const TextGenerator &) |
Assignment not allowed. | |
Private Attributes | |
std::map< int, const std::string * > | dataBase_ |
Database that contains all template strings. | |
The class that holds template strings and formats them.
Template strings are added with addText function by giving the text id and the template string. Formatted string are achieved by calling text() with text id and parameters. For example text(TXT_HELLO_WORLD, "all") returns "Hello all world".
Definition at line 79 of file TextGenerator.hh.
|
private |
Iterator for map.
Definition at line 93 of file TextGenerator.hh.
|
private |
value_type for map.
Definition at line 91 of file TextGenerator.hh.
Texts::TextGenerator::TextGenerator | ( | ) |
Constructor.
Definition at line 55 of file TextGenerator.cc.
References addText(), Texts::TXT_FILE_NOT_FOUND, Texts::TXT_FILE_NOT_READABLE, Texts::TXT_FILE_X_NOT_FOUND, Texts::TXT_HELLO_WORLD, Texts::TXT_ILLEGAL_ARGUMENT, Texts::TXT_ILLEGAL_ARGUMENTS, Texts::TXT_ILLEGAL_INPUT_FILE, Texts::TXT_NO_FILENAME_DEFINED, Texts::TXT_NO_SUCH_SETTING, Texts::TXT_ONLY_ONE_FILENAME_EXPECTED, Texts::TXT_UNKNOWN_COMMAND, and Texts::TXT_UNKNOWN_SUBCOMMAND.
|
virtual |
Destructor.
Frees the allocated memory.
Definition at line 79 of file TextGenerator.cc.
|
private |
Copying not allowed.
|
virtual |
Records a new template string that can be used to generate text messages.
The template string is first copied to the dynamically allocated string, just to ensure that it will be not destroyed before TextGenerator.
textId | Numeric code that identifies the template string. |
templateString | Template string to be recorded. |
Definition at line 118 of file TextGenerator.cc.
Referenced by ADFSerializerTextGenerator::ADFSerializerTextGenerator(), BEMGeneratorCLITextGenerator::BEMGeneratorCLITextGenerator(), BEMTextGenerator::BEMTextGenerator(), GUITextGenerator::GUITextGenerator(), MachineTestReportTextGenerator::MachineTestReportTextGenerator(), MOMTextGenerator::MOMTextGenerator(), OSEdTextGenerator::OSEdTextGenerator(), PIGCLITextGenerator::PIGCLITextGenerator(), PIGTextGenerator::PIGTextGenerator(), ProDeTextGenerator::ProDeTextGenerator(), SimulatorTextGenerator::SimulatorTextGenerator(), and TextGenerator().
|
private |
Assignment not allowed.
|
virtual |
Replaces existing text with a new one.
textID | ID of the text to be replaced |
newString | new string to be set |
KeyNotFound | Thrown if a text of given ID couldn't be found. |
Definition at line 132 of file TextGenerator.cc.
References MapTools::containsKey(), and Conversion::toString().
Referenced by SimulatorTextGenerator::generateCompiledSimTexts().
|
virtual |
Returns a format object that contains the template string.
textId | Numeric code that identifies the template string. |
KeyNotFound | If textId doesn't identify any template string. |
Definition at line 94 of file TextGenerator.cc.
References MapTools::containsKey(), and Conversion::toString().
Referenced by CodeCompressorPlugin::addBitsForGuardField(), CodeCompressorPlugin::addBitsForICField(), CodeCompressorPlugin::addBitsForImmediateSlot(), CodeCompressorPlugin::addBitsForMoveSlot(), TTAMachine::AddressSpace::AddressSpace(), TTAMachine::Bus::adjustSegmentChain(), MachineStateBuilder::bindPortsToOperands(), TTAMachine::Bridge::Bridge(), MachineTestReporter::bridgingError(), CompiledSimSettingCommand::CompiledSimSettingCommand(), TTAMachine::Component::Component(), OSEdAddModuleCmd::Do(), OSEdBuildAllCmd::Do(), OSEdBuildCmd::Do(), OSEdModifyBehaviorCmd::Do(), OSEdPropertiesCmd::Do(), OSEdRemoveModuleCmd::Do(), OSEdRemoveOperationCmd::Do(), OSEdUserManualCmd::Do(), AddBridgeCmd::Do(), AddGCUCmd::Do(), PasteComponentCmd::Do(), DropDownMenu::DropDownMenu(), CodeCompressorPlugin::encodeFUTerminal(), CodeCompressorPlugin::encodeImmediateTerminal(), CodeCompressorPlugin::encodeIUTerminal(), CodeCompressorPlugin::encodeNOP(), CodeCompressorPlugin::encodeRFTerminal(), ConfCommand::execute(), HelpCommand::execute(), InfoProgramCommand::execute(), MachCommand::execute(), ProgCommand::execute(), ProDeBridgeEditPolicy::getCommand(), ProDeBusEditPolicy::getCommand(), ProDeFUEditPolicy::getCommand(), ProDeGCUEditPolicy::getCommand(), ProDeIUEditPolicy::getCommand(), ProDePortEditPolicy::getCommand(), ProDeRFEditPolicy::getCommand(), ProDeSegmentEditPolicy::getCommand(), ProDeSocketEditPolicy::getCommand(), BPCommand::helpText(), CommandsCommand::helpText(), ConditionCommand::helpText(), ConfCommand::helpText(), DeleteBPCommand::helpText(), DisableBPCommand::helpText(), DisassembleCommand::helpText(), EnableBPCommand::helpText(), HelpCommand::helpText(), IgnoreCommand::helpText(), InfoCommand::helpText(), KillCommand::helpText(), MachCommand::helpText(), MemDumpCommand::helpText(), MemWriteCommand::helpText(), NextiCommand::helpText(), ProgCommand::helpText(), QuitCommand::helpText(), ResumeCommand::helpText(), RunCommand::helpText(), SettingCommand::helpText(), StepiCommand::helpText(), TBPCommand::helpText(), UntilCommand::helpText(), WatchCommand::helpText(), TTAMachine::HWOperation::HWOperation(), TTAMachine::ImmediateSlot::ImmediateSlot(), ADFSerializer::immediateUnitToMachine(), SimulatorFrontend::initializeDataMemories(), OSEdInfoView::insertOperationPropertyColumns(), TTAMachine::InstructionTemplate::InstructionTemplate(), CodeCompressorPlugin::instructionTemplate(), ADFSerializer::instructionTemplateToMachine(), SimulatorFrontend::loadMachine(), SimulatorFrontend::loadProcessorConfiguration(), SimulatorFrontend::loadProgram(), TTAMachine::Bridge::loadState(), TTAMachine::ExecutionPipeline::loadState(), TTAMachine::FunctionUnit::loadState(), TTAMachine::PortGuard::loadState(), TTAMachine::RegisterGuard::loadState(), TTAMachine::HWOperation::loadState(), TTAMachine::InstructionTemplate::loadState(), TTAMachine::Component::loadState(), TTAMachine::Port::loadState(), TTAMachine::Socket::loadState(), TTAMachine::Bus::loadStateWithoutReferences(), TTAMachine::FUPort::loadStateWithoutReferences(), main(), OSEdInfoView::moduleView(), OperationPropertyDialog::onAddAffectedBy(), OperationPropertyDialog::onAddAffects(), BusDialog::onAddFUGuard(), OperationDialog::onAddOperand(), OTAFormatListDialog::onAddOTAFormat(), OperationDialog::onAddResource(), BusDialog::onAddRFGuard(), BusDialog::onAddSegment(), ImmediateSlotDialog::onAddSlot(), TemplateListDialog::onAddSlot(), TemplateListDialog::onAddTemplate(), AddressSpacesDialog::onASRightClick(), OSEdMainFrame::onCommandEvent(), OperationDialog::onDeleteOperand(), OperationDialog::onDeleteResource(), OSEdInfoView::onDropDownMenu(), OSEdTreeView::onDropDownMenu(), BusDialog::onFUGuardRightClick(), OSEd::OnInit(), OSEdTreeView::onItemSelected(), BridgeDialog::onOK(), BusDialog::onOK(), SocketDialog::onOK(), AddModuleDialog::onOk(), AddressSpaceDialog::onOK(), FUDialog::onOK(), FUGuardDialog::onOK(), FUPortDialog::onOK(), GCUDialog::onOK(), IUDialog::onOK(), IUPortDialog::onOK(), OperationDialog::onOK(), RFDialog::onOK(), RFGuardDialog::onOK(), RFPortDialog::onOK(), SRPortDialog::onOK(), OperationPropertyDialog::onOpen(), ResultDialog::onOpen(), OperationDialog::onOperandLClick(), FUDialog::onOperationRightClick(), GCUDialog::onOperationRightClick(), FUDialog::onPortRightClick(), GCUDialog::onPortRightClick(), RFDialog::onPortRightClick(), OperationDialog::onResourceLClick(), RFGuardDialog::onRFChoice(), BusDialog::onRFGuardRightClick(), OSEdOptionsDialog::onSave(), BusDialog::onSegmentRightClick(), OSEdInfoView::onSelection(), BusDialog::onUnconditionalGuard(), MDFDocument::openADF(), OSEdInfoView::operationPropertyView(), TTAMachine::OperationTriggeredFormat::OperationTriggeredFormat(), OSEdInfoView::operationView(), OSEdMainFrame::OSEdMainFrame(), OSEdInfoView::pathView(), TTAMachine::Port::Port(), TTAMachine::PortGuard::PortGuard(), SimulatorCmdLineOptions::printHelp(), SimControlLanguageCommand::printStopReasons(), PIGCmdLineOptions::printUsage(), BEMGeneratorCmdLineOptions::printVersion(), PIGCmdLineOptions::printVersion(), SimProgramBuilder::processBidirTerminal(), TTAMachine::RegisterGuard::RegisterGuard(), TTAMachine::RegisterGuard::RegisterGuard(), TTAMachine::Socket::setDirection(), TTAMachine::ControlUnit::setGlobalGuardLatency(), SourceField::setImmediateEncoding(), WidgetTools::setLabel(), GCUDialog::setLabels(), TTAMachine::HWOperation::setName(), TTAMachine::Component::setName(), AddModuleDialog::setTexts(), InputOperandDialog::setTexts(), MemoryDialog::setTexts(), OperationDAGDialog::setTexts(), OperationPropertyDialog::setTexts(), OSEdAboutDialog::setTexts(), OSEdOptionsDialog::setTexts(), OutputOperandDialog::setTexts(), SimulateDialog::setTexts(), SimulationInfoDialog::setTexts(), AboutDialog::setTexts(), AddressSpaceDialog::setTexts(), AddressSpacesDialog::setTexts(), BridgeDialog::setTexts(), BusDialog::setTexts(), CallExplorerPluginWindow::setTexts(), EditParameterDialog::setTexts(), FUDialog::setTexts(), FUGuardDialog::setTexts(), FUPortDialog::setTexts(), ImmediateSlotDialog::setTexts(), IUDialog::setTexts(), IUPortDialog::setTexts(), OperationDialog::setTexts(), OTAFormatListDialog::setTexts(), RFDialog::setTexts(), RFGuardDialog::setTexts(), RFPortDialog::setTexts(), SocketDialog::setTexts(), SRPortDialog::setTexts(), TemplateListDialog::setTexts(), TemplateSlotDialog::setTexts(), SettingCommand::SettingCommand(), SimulateDialog::showOrHideRegisters(), SimulationInfoDialog::SimulationInfoDialog(), MachineTestReporter::socketDirectionSettingError(), MachineTestReporter::socketPortConnectionError(), MachineTestReporter::socketSegmentConnectionError(), RFGuardDialog::TransferDataToWindow(), TTAMachine::UnconditionalGuard::UnconditionalGuard(), OperationPropertyDialog::updateOperation(), OperationDialog::warnOnResourcesWithoutUsages(), and OSEdInfoView::writeStaticPropertiesOfOperation().
|
private |
Database that contains all template strings.
Definition at line 101 of file TextGenerator.hh.