summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
diff options
context:
space:
mode:
authorAleksander Donchev <aleksander.donchev@partner.bmw.de>2013-07-08 11:27:30 +0200
committerAleksander Donchev <aleksander.donchev@partner.bmw.de>2013-07-10 14:59:18 +0200
commitde452ebdcfe9ca3cd3b2467c3e25960e7a58e49e (patch)
treef210a063672aa5a8abc2a54fe3c78ddaf9dd625a /AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
parente18331e64352b881268ca6f8db1d127113dd1519 (diff)
downloadaudiomanager-de452ebdcfe9ca3cd3b2467c3e25960e7a58e49e.tar.gz
Added 'Dump' method to the database handler and to the telnet server (Info -> Dump). Unit tests for the database handler splited into separate file. Base log class added in order to support logging into a file.
Signed-off-by: Christian Linke <christian.linke@bmw.de>
Diffstat (limited to 'AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp')
-rw-r--r--AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp b/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
index d8efd6a..3898e50 100644
--- a/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
+++ b/AudioManagerDaemon/src/CAmTelnetMenuHelper.cpp
@@ -105,6 +105,7 @@ void CAmTelnetMenuHelper::createCommandMaps()
// Info comands
mInfoCommands.insert(std::make_pair("help", sCommandPrototypeInfo(std::string("show all possible commands"), &CAmTelnetMenuHelper::helpCommand)));
mInfoCommands.insert(std::make_pair("sysprop", sCommandPrototypeInfo("show all systemproperties", &CAmTelnetMenuHelper::infoSystempropertiesCommand)));
+ mInfoCommands.insert(std::make_pair("dump", sCommandPrototypeInfo("create a database dump of currently used data", &CAmTelnetMenuHelper::infoDumpCommand)));
mInfoCommands.insert(std::make_pair("..", sCommandPrototypeInfo("one step back in menu tree (back to root folder)", &CAmTelnetMenuHelper::oneStepBackCommand)));
mInfoCommands.insert(std::make_pair("exit", sCommandPrototypeInfo("close telnet session", &CAmTelnetMenuHelper::exitCommand)));
}
@@ -741,6 +742,14 @@ void CAmTelnetMenuHelper::infoSystempropertiesCommand(std::queue<std::string>& C
}
/****************************************************************************/
+void CAmTelnetMenuHelper::infoDumpCommand(std::queue<std::string>& CmdQueue, int& filedescriptor)
+/****************************************************************************/
+{
+ instance->infoDumpCommandExec(CmdQueue, filedescriptor);
+}
+
+
+/****************************************************************************/
void CAmTelnetMenuHelper::setVolumeStep(std::queue<std::string>& CmdQueue, int& filedescriptor)
/****************************************************************************/
{
@@ -933,6 +942,21 @@ void CAmTelnetMenuHelper::infoSystempropertiesCommandExec(std::queue<std::string
}
/****************************************************************************/
+void CAmTelnetMenuHelper::infoDumpCommandExec(std::queue<std::string>& CmdQueue, int& filedescriptor)
+/****************************************************************************/
+{
+ (void) (CmdQueue);
+
+ std::stringstream *pOutput = new std::stringstream();
+
+ mpDatabasehandler->dump(*pOutput);
+
+ sendTelnetLine(filedescriptor, *pOutput);
+
+ delete pOutput;
+}
+
+/****************************************************************************/
void CAmTelnetMenuHelper::setRoutingCommand(std::queue<std::string>& CmdQueue, int& filedescriptor)
/****************************************************************************/
{