NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
This class handles the internal language system and returns the language strings of the selected language based upon the language files. More...
#include <language.hpp>
Public Member Functions | |
Language () | |
Contructor of the language class. More... | |
Language (const Language &_lang) | |
Copy constructor of the language class. More... | |
void | loadStrings (bool bloadUserFiles=true) |
This member function loads the language files to the internal map and replaces the named tokens with the corresponding language strings afterwards. More... | |
void | addToLanguage (const std::map< std::string, std::string > &_langstrings) |
This member function adds the contents of the passed language file into the internal map. More... | |
std::string | getKey (const std::string &sMessage) const |
This member function searches the internal language map for an identifier, which starts similar with the passed identifier and returns the found identifier. More... | |
std::string | get (const std::string &sMessage, const std::vector< std::string > &vTokens) const |
This member function returns the language string for the passed language identifier and replaces all enumerated tokens with the passed token list. More... | |
std::string | get (const std::string &sMessage) const |
Convenience wrapper for a defined number of tokens. More... | |
std::string | get (const std::string &sMessage, const std::string &sTok1) const |
Convenience wrapper for a defined number of tokens. More... | |
std::string | get (const std::string &sMessage, const std::string &sTok1, const std::string &sTok2) const |
Convenience wrapper for a defined number of tokens. More... | |
std::string | get (const std::string &sMessage, const std::string &sTok1, const std::string &sTok2, const std::string &sTok3) const |
Convenience wrapper for a defined number of tokens. More... | |
std::string | get (const std::string &sMessage, const std::string &sTok1, const std::string &sTok2, const std::string &sTok3, const std::string &sTok4) const |
Convenience wrapper for a defined number of tokens. More... | |
std::string | get (const std::string &sMessage, const std::string &sTok1, const std::string &sTok2, const std::string &sTok3, const std::string &sTok4, const std::string &sTok5) const |
Convenience wrapper for a defined number of tokens. More... | |
std::string | get (const std::string &sMessage, const std::string &sTok1, const std::string &sTok2, const std::string &sTok3, const std::string &sTok4, const std::string &sTok5, const std::string &sTok6) const |
Convenience wrapper for a defined number of tokens. More... | |
std::vector< std::string > | getList (const std::string &sMessageScheme) const |
This member function returns a vector of language strings matching to the passed identifier containing wildcards. More... | |
std::string | YES () const |
std::string | NO () const |
Public Member Functions inherited from FileSystem | |
FileSystem () | |
Default constructor. More... | |
FileSystem & | assign (const FileSystem &_fSys) |
Assignment member function to copy the settings from another FileSystem instance. More... | |
std::string | ValidFileName (std::string _sFileName, const std::string sExtension=".dat", bool checkExtension=true, bool doCleanPath=true) const |
This member function evaluates, whether the passed filename is a valid filename. One may supply a preferred filename extension. More... | |
std::string | ValidFolderName (std::string _sFileName, bool doCleanPath=true, bool appendTrailingSeparator=true) const |
This member function evaluates, whether the passed foldername is a valid foldername. More... | |
std::string | ValidizeAndPrepareName (const std::string &_sFileName, const std::string &sExtension=".dat") const |
This member function validizes the passed file name and creates the needed folders on-the-fly. More... | |
int | setPath (std::string _sPath, bool bMkDir, std::string _sExePath) |
This member function may be used to set the preferred file path of the current FileSystem instance. More... | |
void | createRevisionsFolder () |
This member function creates the hidden revisions folders for the version control system. More... | |
std::string | getPath () const |
Returns the default path of this FileSystem instance. More... | |
std::vector< std::string > | getFileParts (const std::string &sFilePath) const |
This member function separates all path parts into single strings: the drive letter, the path, the name and the extension. This function may also handle folder paths and network paths. More... | |
FileInfo | getFileInfo (const std::string &sFilePath) const |
Return the file information about the passed file path. More... | |
void | setTokens (std::string _sTokens) |
This member function may be used to update the path placeholders of the current FileSystem instance. More... | |
bool | isFile (const std::string &_sPath) const |
This function determines, whether a path name indicates a file or a folder. More... | |
void | initializeFromKernel () |
Member function to remote-initialize the class from the kernel. Cannot be used during kernel start-up. More... | |
void | setProgramPath (std::string _sExePath) |
std::string | getProgramPath () const |
void | declareFileType (const std::string &sFileType) |
Private Member Functions | |
std::map< std::string, std::string > | getLangFileContent (const std::string &sFile) const |
This private member function decodes a single language file into a map and returns it. More... | |
void | loadAndInsert (const std::string &sLanguageFileName) |
This private member function is a simple helper for Language::loadStrings(). More... | |
Private Attributes | |
std::map< std::string, std::string > | mLangStrings |
std::string | sYES |
std::string | sNO |
Additional Inherited Members | |
Protected Member Functions inherited from FileSystem | |
int | createFolders (const std::string &_sPath) const |
This member function creates all missing directories in the passed path. More... | |
Protected Attributes inherited from FileSystem | |
std::string | sPath |
std::string | sExecutablePath |
std::string | sTokens [7][2] |
std::string | sValidExtensions |
This class handles the internal language system and returns the language strings of the selected language based upon the language files.
Definition at line 37 of file language.hpp.
Language::Language | ( | ) |
Contructor of the language class.
Definition at line 31 of file language.cpp.
References mLangStrings, sNO, and sYES.
Language::Language | ( | const Language & | _lang | ) |
Copy constructor of the language class.
_lang | const Language& |
Definition at line 46 of file language.cpp.
References _lang, mLangStrings, sNO, and sYES.
void Language::addToLanguage | ( | const std::map< std::string, std::string > & | _langstrings | ) |
This member function adds the contents of the passed language file into the internal map.
_langstrings | const map<string,string>& |
Definition at line 238 of file language.cpp.
References mLangStrings.
Referenced by NumeReKernel::checkInternalStates(), NumeReWindow::prepareFunctionTree(), and NumeReKernel::StartUp().
|
inline |
Convenience wrapper for a defined number of tokens.
sMessage | const string& |
Definition at line 63 of file language.hpp.
References get().
|
inline |
Convenience wrapper for a defined number of tokens.
sMessage | const string& |
sTok1 | const string& |
Definition at line 78 of file language.hpp.
References get().
|
inline |
Convenience wrapper for a defined number of tokens.
sMessage | const string& |
sTok1 | const string& |
sTok2 | const string& |
Definition at line 95 of file language.hpp.
References get().
|
inline |
Convenience wrapper for a defined number of tokens.
sMessage | const string& |
sTok1 | const string& |
sTok2 | const string& |
sTok3 | const string& |
Definition at line 114 of file language.hpp.
References get().
|
inline |
Convenience wrapper for a defined number of tokens.
sMessage | const string& |
sTok1 | const string& |
sTok2 | const string& |
sTok3 | const string& |
sTok4 | const string& |
Definition at line 135 of file language.hpp.
References get().
|
inline |
Convenience wrapper for a defined number of tokens.
sMessage | const string& |
sTok1 | const string& |
sTok2 | const string& |
sTok3 | const string& |
sTok4 | const string& |
sTok5 | const string& |
Definition at line 158 of file language.hpp.
References get().
|
inline |
Convenience wrapper for a defined number of tokens.
sMessage | const string& |
sTok1 | const string& |
sTok2 | const string& |
sTok3 | const string& |
sTok4 | const string& |
sTok5 | const string& |
sTok6 | const string& |
Definition at line 183 of file language.hpp.
References get().
string Language::get | ( | const std::string & | sMessage, |
const std::vector< std::string > & | vTokens | ||
) | const |
This member function returns the language string for the passed language identifier and replaces all enumerated tokens with the passed token list.
sMessage | const string& |
vTokens | const vector<string>& |
Definition at line 292 of file language.cpp.
References mLangStrings, and toString().
Referenced by MemoryManager::addTable(), CodeAnalyzer::analyseCommands(), CodeAnalyzer::analyseFunctions(), CodeAnalyzer::analyseIdentifiers(), CodeAnalyzer::analyseNumbers(), CodeAnalyzer::analyseOperators(), CodeAnalyzer::analysePreDefs(), CodeAnalyzer::analyseProcedures(), analyzePulse(), append_data(), applyCommandHeuristics(), applyFitAlgorithm(), applyFunctionHeuristics(), autoSave(), boneDetection(), FlowCtrl::calc(), calculate1dFFT(), calculate2dFFT(), calculateChiMap(), calculateSplines(), CellValueShaderDialog::CellValueShaderDialog(), TableViewer::changeColType(), SearchController::CleanDocumentation(), NumeRe::CleanDocumentation(), clear_cache(), NumeReWindow::CloseFile(), cmd_audio(), cmd_audioread(), cmd_clear(), cmd_copy(), cmd_credits(), cmd_datagrid(), cmd_define(), cmd_delete(), cmd_find(), cmd_ifndefined(), cmd_load(), cmd_move(), cmd_plotting(), cmd_redefine(), cmd_regularize(), cmd_remove(), cmd_rename(), cmd_resample(), cmd_retouch(), cmd_seek(), cmd_set(), cmd_smooth(), cmd_start(), cmd_stfa(), cmd_workpath(), CodeAnalyzer::CodeAnalyzer(), FlowCtrl::compile(), NumeReWindow::compileLaTeX(), confirmOperation(), FindReplaceDialog::Create(), OptionsDialog::CreateAnalyzerPage(), OptionsDialog::CreateConfigPage(), AboutChameleonDialog::CreateControls(), OptionsDialog::CreateControls(), OptionsDialog::CreateDebuggerPage(), DependencyDialog::CreateDotFile(), OptionsDialog::CreateEditorPage(), CellValueShaderDialog::createIntervalExclPage(), CellValueShaderDialog::createIntervalPage(), NumeReWindow::createLaTeXFile(), CellValueShaderDialog::createLtGtPage(), TableViewer::createMenuBar(), OptionsDialog::CreateMiscPage(), createOutputForHist1D(), createOutputForHist2D(), GroupPanel::CreatePathInput(), OptionsDialog::CreatePathPage(), createPlotForHist1D(), Plot::createPlotOrAnimation(), createPlotsForHist2D(), NumeReEditor::CreateProcedureFromSection(), createStatsFile(), createStatsOutput(), OptionsDialog::CreateStylePage(), Plot::createSubPlotSet(), createTeXExport(), DuplicateCodeDialog::createTextFromList(), DebugViewer::DebugViewer(), NumeReWindow::DefaultPage(), NumeReWindow::deleteFile(), DependencyDialog::DependencyDialog(), differentiate(), Plot::displayMessage(), doc_Help(), doc_HelpAsHTML(), doc_SearchFct(), DocumentationBrowser::DocumentationBrowser(), wxMGL::DrawCurrentObject(), DuplicateCodeDialog::DuplicateCodeDialog(), editObject(), NumeReWindow::editTable(), ProcedureViewer::emptyControl(), FlowCtrl::eval(), FlowCtrl::evalForkFlowCommands(), FlowCtrl::evalHeader(), FlowCtrl::evalRangeBasedHeader(), Script::evaluateInstallInformation(), OptionsDialog::EvaluateOptions(), ProcedureVarFactory::evaluateProcedureArguments(), NumeReKernel::evaluateStrings(), executeCommand(), fastFourierTransform(), fastWaveletTransform(), NumeReEditor::FindAndOpenInclude(), NumeReEditor::FindAndOpenProcedure(), NumeRe::DataBase::findRecordsUsingRelevance(), fitDataSet(), NumeReEditor::fixSymbolName(), FlowCtrl::for_loop(), Output::format(), get(), NumeRe::CallTipProvider::getCommand(), NumeRe::CallTipProvider::getConstant(), getDataForFit(), TableColumn::getDefaultColumnHead(), getErrorType(), getFitAnalysis(), getFitOptionsTable(), NumeRe::CallTipProvider::getFunction(), Documentation::getHelpArticle(), NumeRe::CallTipProvider::getMethod(), Script::getNextScriptCommandFromScript(), NumeRe::CallTipProvider::getOption(), getPathForSetting(), NumeRe::CallTipProvider::getPredef(), NumeReDebugger::getStackTrace(), getStatFieldName(), NumeReWindow::gotoLine(), NumeReKernel::handleComposeBlock(), NumeReKernel::handleFlowControls(), Script::handleInstallInformation(), NumeReWindow::HandleModifiedFile(), NumeReKernel::handleProcedureWrite(), ImagePanel::ImagePanel(), NumeReEditor::InitDuplicateCode(), OptionsDialog::InitializeDialog(), DebugViewer::initializeToolbar(), wxMGL::InitializeToolbar(), NumeReWindow::insertCopiedFile(), integrate(), integrate2d(), NumeReKernel::issueWarning(), listCommands(), listConstants(), listDeclaredVariables(), listDefinitions(), listDirectory(), listFiles(), listFunctions(), listInstalledPlugins(), listLogicalOperators(), listUnitConversions(), FunctionDefinitionManager::load(), load_data(), PackageDialog::loadProjectFile(), NumeReKernel::MainLoop(), NumeReWindow::NewFile(), newObject(), wxMGL::NextSlide(), NumeReEditor::NumeReEditor(), NumeReWindow::NumeReWindow(), NumeReWindow::OnAbout(), PackageDialog::OnAddItems(), NumeReWindow::OnAskForNewFile(), CellValueShaderDialog::OnButtonClick(), OptionsDialog::OnButtonClick(), DuplicateCodeDialog::OnButtonReport(), NumeReWindow::OnCalculateDependencies(), NumeReWindow::OnCompareFiles(), NumeReWindow::OnCreateNewFolder(), NumeReWindow::OnCreatePackage(), MyApp::OnExceptionInMainLoop(), DebugViewer::OnExecutionFinished(), wxMGL::OnExport(), NumeReWindow::OnFindEvent(), NumeReWindow::OnFindReplace(), MyApp::OnInit(), DependencyDialog::OnItemRightClick(), PackageDialog::OnLoadProjectFile(), DebugViewer::OnMenuEvent(), RevisionDialog::OnMenuEvent(), NumeReWindow::OnMenuEvent(), NumeReEditor::OnMouseDwell(), VariableViewer::OnNewTable(), NumeReWindow::OnPrintPage(), NumeReWindow::OnPrintPreview(), NumeReWindow::OnRemoveFolder(), VariableViewer::OnRenameTable(), NumeReEditor::OnRightClick(), NumeReHistory::OnRightClick(), VariableViewer::OnRightClick(), RevisionDialog::OnRightClick(), ImagePanel::OnSaveAs(), VariableViewer::OnSaveasTable(), PackageDialog::OnSaveProjectFile(), EditorNotebook::OnTabRightClicked(), NumeReWindow::OnTagCurrentRevision(), NumeReWindow::OnTreeItemRightClick(), NumeReWindow::OnTreeItemToolTip(), NumeReWindow::OpenFile(), Includer::openIncludedFile(), PackageDialog::PackageDialog(), mu::ParserError::ParserError(), Plot::Plot(), plugin_random(), NumeReWindow::prepareFunctionTree(), DocumentationBrowser::prepareToolbar(), HelpViewer::Print(), Output::print(), Output::print_legal(), NumeReKernel::printVersionInfo(), ProcedureViewer::ProcedureViewer(), NumeReKernel::progressBar(), FlowCtrl::range_based_for_loop(), NumeRe::NumeReDataFile::readHeader(), NumeReWindow::reloadFileIfOpen(), removeFile(), NumeReWindow::renameFile(), NumeReEditor::RenameSymbols(), RenameSymbolsDialog::RenameSymbolsDialog(), NumeReKernel::resetAfterError(), Script::returnCommand(), RevisionDialog::RevisionDialog(), rotateTable(), CodeAnalyzer::run(), NumeReWindow::runLaTeX(), FunctionDefinitionManager::save(), Settings::save(), NumeReWindow::SaveCurrentFile(), NumeReKernel::saveData(), saveDataObject(), PackageDialog::SaveOnClose(), PackageDialog::saveProjectFile(), NumeReWindow::SaveTab(), TableViewer::saveTable(), FlowCtrl::setCommand(), TableViewer::SetData(), VariableViewer::setDebuggerMode(), DebugViewer::setDebugInfo(), wxMGL::SetDrawMode(), wxMGL::SetRotate(), TableViewer::SetTableReadOnly(), EditorNotebook::SetTabText(), wxMGL::SetZoom(), NumeReDebugger::showBreakPoint(), NumeReWindow::ShowHelp(), Odesolver::solve(), solveLGS(), solveLGSSymbolic(), strfnc_getkeyval(), strfnc_regex(), swapTables(), TableEditPanel::TableEditPanel(), TablePanel::TablePanel(), TableViewer::TableViewer(), taylor(), NumeReDebugger::throwException(), toString(), undefineFunctions(), NumeReKernel::uninstallPlugin(), TablePanel::update(), NumeReWindow::UpdateMenuBar(), NumeReWindow::UpdatePackageMenu(), NumeReWindow::UpdateStatusBar(), NumeReWindow::UpdateToolbar(), VariableViewer::VariableViewer(), FlowCtrl::while_loop(), NumeRe::LaTeXTable::writeFile(), NumeRe::TextDataFile::writeHeader(), NumeRe::LaTeXTable::writeHeader(), Script::writeProcedure(), and Procedure::writeProcedure().
string Language::getKey | ( | const std::string & | sMessage | ) | const |
This member function searches the internal language map for an identifier, which starts similar with the passed identifier and returns the found identifier.
sMessage | const string& |
The passed language identifier has to contain an asteriks as a wildcard.
Definition at line 257 of file language.cpp.
References mLangStrings.
Referenced by applyCommandHeuristics(), applyFunctionHeuristics(), and NumeReKernel::MainLoop().
|
private |
This private member function decodes a single language file into a map and returns it.
sFile | const string& |
Definition at line 63 of file language.cpp.
References StripSpaces(), and FileSystem::ValidFileName().
Referenced by loadAndInsert(), and loadStrings().
vector< string > Language::getList | ( | const std::string & | sMessageScheme | ) | const |
This member function returns a vector of language strings matching to the passed identifier containing wildcards.
sMessageScheme | const string& |
Definition at line 349 of file language.cpp.
References mLangStrings.
Referenced by CodeAnalyzer::CodeAnalyzer(), listCommands(), listFunctions(), listLogicalOperators(), NumeReWindow::prepareFunctionTree(), and strfnc_weekday().
|
private |
This private member function is a simple helper for Language::loadStrings().
sLanguageFileName | const string& |
Definition at line 143 of file language.cpp.
References getLangFileContent(), and mLangStrings.
Referenced by loadStrings().
void Language::loadStrings | ( | bool | bloadUserFiles = true | ) |
This member function loads the language files to the internal map and replaces the named tokens with the corresponding language strings afterwards.
bloadUserFiles | bool |
Definition at line 164 of file language.cpp.
References fileExists(), getLangFileContent(), loadAndInsert(), mLangStrings, sNO, sYES, and FileSystem::ValidFileName().
Referenced by NumeReWindow::NumeReWindow(), NumeReWindow::refreshFunctionTree(), and NumeReKernel::StartUp().
|
inline |
Definition at line 201 of file language.hpp.
References sNO.
|
inline |
Definition at line 197 of file language.hpp.
References sYES.
Referenced by clear_cache(), confirmOperation(), Output::format(), Script::handleInstallInformation(), load_data(), NumeReKernel::MainLoop(), and removeFile().
|
private |
Definition at line 40 of file language.hpp.
Referenced by addToLanguage(), get(), getKey(), getList(), Language(), loadAndInsert(), and loadStrings().
|
private |
Definition at line 42 of file language.hpp.
Referenced by Language(), loadStrings(), and NO().
|
private |
Definition at line 41 of file language.hpp.
Referenced by Language(), loadStrings(), and YES().