Switch for conio/ncurses using deprecated getch(). now compiles for linux.

parent 6b3d91cc
......@@ -12,14 +12,19 @@
*/
// STL includes
#ifdef WIN32
#include <conio.h>
#else
#include <ncurses.h>
#endif
#include <iostream>
// ITA includes
#include <ITAException.h>
#include <ITANumericUtils.h>
#include <ITAStringUtils.h>
#include <ITAFilesystemUtils.h>
#include <ITAFileSystemUtils.h>
// VA includes
#include <VACore.h>
......@@ -158,7 +163,7 @@ int main( int argc, char* argv[] )
while( true )
{
const int CTRL_D = 4;
int c = _getch();
int c = getch();
if( c == CTRL_D || c == 'q' ) break;
......@@ -195,14 +200,14 @@ int main( int argc, char* argv[] )
{
CVAStruct oArgs, oReturn, oNewArgs;
oArgs[ "command" ] = "get";
oArgs[ "debug" ] = CVAStruct();
oArgs[ "debug" ][ "loglevel" ] = true;
oArgs[ std::string("debug") ] = CVAStruct();
oArgs[ std::string("debug") ][ std::string("loglevel") ] = true;
pServer->GetCoreInstance()->CallModule( "VACore", oArgs, oReturn );
int iCurrentLogLevel = oReturn[ "debug" ][ "loglevel" ];
int iCurrentLogLevel = oReturn[ std::string("debug") ][ std::string("loglevel") ];
int iNewLogLevel = int( iCurrentLogLevel + 1 ) % 6;
oNewArgs[ "command" ] = "set";
oNewArgs[ "debug" ] = CVAStruct();
oNewArgs[ "debug" ][ "loglevel" ] = iNewLogLevel;
oNewArgs[ std::string("debug") ][ std::string("loglevel") ] = iNewLogLevel;
pServer->GetCoreInstance()->CallModule( "VACore", oNewArgs, oReturn );
cout << "Switched to log level: " << IVACore::GetLogLevelStr( iNewLogLevel ) << endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment