Command history: Save in file before each execution to avoid to lose it in case of...
[scilab.git] / scilab / modules / history_manager / src / cpp / HistoryManager.cpp
index 7594d22..a69e558 100644 (file)
@@ -128,6 +128,11 @@ void displayScilabHistory(void)
     HistoryManager::getInstance()->displayHistory();
 }
 /*------------------------------------------------------------------------*/
+BOOL saveScilabHistoryToFile()
+{
+    return HistoryManager::getInstance()->writeToFile();
+}
+/*------------------------------------------------------------------------*/
 BOOL writeScilabHistoryToFile(char* _pstFilename)
 {
     return HistoryManager::getInstance()->writeToFile(_pstFilename);
@@ -417,6 +422,12 @@ BOOL HistoryManager::writeToFile(char* _pstFilename)
     return FALSE;
 }
 /*------------------------------------------------------------------------*/
+BOOL HistoryManager::writeToFile()
+{
+       m_HF.setHistory(m_Commands);
+       return m_HF.writeToFile();
+}
+/*------------------------------------------------------------------------*/
 BOOL HistoryManager::loadFromFile(char* _pstFilename)
 {
     if (_pstFilename)