NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
Language Class Reference

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>

Inheritance diagram for Language:
Collaboration diagram for Language:

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...
 
FileSystemassign (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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Language() [1/2]

Language::Language ( )

Contructor of the language class.

Definition at line 31 of file language.cpp.

References mLangStrings, sNO, and sYES.

◆ Language() [2/2]

Language::Language ( const Language _lang)

Copy constructor of the language class.

Parameters
_langconst Language&

Definition at line 46 of file language.cpp.

References _lang, mLangStrings, sNO, and sYES.

Member Function Documentation

◆ addToLanguage()

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.

Parameters
_langstringsconst map<string,string>&
Returns
void

Definition at line 238 of file language.cpp.

References mLangStrings.

Referenced by NumeReKernel::checkInternalStates(), NumeReWindow::prepareFunctionTree(), and NumeReKernel::StartUp().

◆ get() [1/8]

std::string Language::get ( const std::string &  sMessage) const
inline

Convenience wrapper for a defined number of tokens.

Parameters
sMessageconst string&
Returns
string

Definition at line 63 of file language.hpp.

References get().

Here is the call graph for this function:

◆ get() [2/8]

std::string Language::get ( const std::string &  sMessage,
const std::string &  sTok1 
) const
inline

Convenience wrapper for a defined number of tokens.

Parameters
sMessageconst string&
sTok1const string&
Returns
string

Definition at line 78 of file language.hpp.

References get().

Here is the call graph for this function:

◆ get() [3/8]

std::string Language::get ( const std::string &  sMessage,
const std::string &  sTok1,
const std::string &  sTok2 
) const
inline

Convenience wrapper for a defined number of tokens.

Parameters
sMessageconst string&
sTok1const string&
sTok2const string&
Returns
string

Definition at line 95 of file language.hpp.

References get().

Here is the call graph for this function:

◆ get() [4/8]

std::string Language::get ( const std::string &  sMessage,
const std::string &  sTok1,
const std::string &  sTok2,
const std::string &  sTok3 
) const
inline

Convenience wrapper for a defined number of tokens.

Parameters
sMessageconst string&
sTok1const string&
sTok2const string&
sTok3const string&
Returns
string

Definition at line 114 of file language.hpp.

References get().

Here is the call graph for this function:

◆ get() [5/8]

std::string Language::get ( const std::string &  sMessage,
const std::string &  sTok1,
const std::string &  sTok2,
const std::string &  sTok3,
const std::string &  sTok4 
) const
inline

Convenience wrapper for a defined number of tokens.

Parameters
sMessageconst string&
sTok1const string&
sTok2const string&
sTok3const string&
sTok4const string&
Returns
string

Definition at line 135 of file language.hpp.

References get().

Here is the call graph for this function:

◆ get() [6/8]

std::string Language::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
inline

Convenience wrapper for a defined number of tokens.

Parameters
sMessageconst string&
sTok1const string&
sTok2const string&
sTok3const string&
sTok4const string&
sTok5const string&
Returns
string

Definition at line 158 of file language.hpp.

References get().

Here is the call graph for this function:

◆ get() [7/8]

std::string Language::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
inline

Convenience wrapper for a defined number of tokens.

Parameters
sMessageconst string&
sTok1const string&
sTok2const string&
sTok3const string&
sTok4const string&
sTok5const string&
sTok6const string&
Returns
string

Definition at line 183 of file language.hpp.

References get().

Here is the call graph for this function:

◆ get() [8/8]

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.

Parameters
sMessageconst string&
vTokensconst vector<string>&
Returns
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().

Here is the call graph for this function:

◆ getKey()

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.

Parameters
sMessageconst string&
Returns
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().

◆ getLangFileContent()

map< string, string > Language::getLangFileContent ( const std::string &  sFile) const
private

This private member function decodes a single language file into a map and returns it.

Parameters
sFileconst string&
Returns
map<string,string>

Definition at line 63 of file language.cpp.

References StripSpaces(), and FileSystem::ValidFileName().

Referenced by loadAndInsert(), and loadStrings().

Here is the call graph for this function:

◆ getList()

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.

Parameters
sMessageSchemeconst string&
Returns
vector<string>

Definition at line 349 of file language.cpp.

References mLangStrings.

Referenced by CodeAnalyzer::CodeAnalyzer(), listCommands(), listFunctions(), listLogicalOperators(), NumeReWindow::prepareFunctionTree(), and strfnc_weekday().

◆ loadAndInsert()

void Language::loadAndInsert ( const std::string &  sLanguageFileName)
private

This private member function is a simple helper for Language::loadStrings().

Parameters
sLanguageFileNameconst string&
Returns
void

Definition at line 143 of file language.cpp.

References getLangFileContent(), and mLangStrings.

Referenced by loadStrings().

Here is the call graph for this function:

◆ 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.

Parameters
bloadUserFilesbool
Returns
void

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().

Here is the call graph for this function:

◆ NO()

std::string Language::NO ( ) const
inline

Definition at line 201 of file language.hpp.

References sNO.

◆ YES()

std::string Language::YES ( ) const
inline

Member Data Documentation

◆ mLangStrings

std::map<std::string,std::string> Language::mLangStrings
private

Definition at line 40 of file language.hpp.

Referenced by addToLanguage(), get(), getKey(), getList(), Language(), loadAndInsert(), and loadStrings().

◆ sNO

std::string Language::sNO
private

Definition at line 42 of file language.hpp.

Referenced by Language(), loadStrings(), and NO().

◆ sYES

std::string Language::sYES
private

Definition at line 41 of file language.hpp.

Referenced by Language(), loadStrings(), and YES().


The documentation for this class was generated from the following files: