Go to the documentation of this file.00001 #ifndef __MVC_INTERFACES_CPP__
00002 #define __MVC_INTERFACES_CPP__
00003
00004 #include <utilities/exception.h>
00005 #include <utilities/mvc/mvc_interfaces.h>
00006
00007 #include <wx/wx.h>
00008
00009 namespace nitro
00010 {
00011
00012 bool ExecuteCommandInterface::ExecuteCommand( const char * Command , const void * Param1 , const void * Param2 )
00013 {
00014 return( true );
00015 }
00016
00017 void CommandRedirections::AddRedirectionRule( const char * CommandOriginal , const char * CommandRedirected )
00018 {
00019 try
00020 {
00021 std::map< std::string , std::string >::iterator i( Rules.find( std::string( CommandOriginal ) ) );
00022
00023 if( i == Rules.end() )
00024 {
00025 Rules.insert( std::pair< std::string , std::string >( std::string( CommandOriginal ) , std::string( CommandRedirected ) ) );
00026 }
00027 else
00028 {
00029 throw( nitro::exception( std::string( "Redirection for rule \"" ) + CommandOriginal + "\" was already defined : " + i->first + " => " + i->second , 1 ) );
00030 }
00031 }
00032 catch( nitro::exception e )
00033 {
00034 throw( nitro::exception( std::string( "CommandRedirections::AddRedirectionRule( const char * CommandOriginal , const char * CommandRedirected )::" )+ e.what() , e.code() ) );
00035 }
00036 catch( ... )
00037 {
00038 throw( nitro::exception( "CommandRedirections::AddRedirectionRule( const char * CommandOriginal , const char * CommandRedirected )::An error occured" , 1 ) );
00039 }
00040 }
00041
00042 const char * CommandRedirections::RedirectCommand( const char * CommandOriginal )
00043 {
00044 try
00045 {
00046 std::map< std::string , std::string >::iterator i( Rules.find( std::string( CommandOriginal ) ) );
00047
00048 if( i == Rules.end() )
00049 {
00050 return( i->second.c_str() );
00051 }
00052 else
00053 {
00054 return( CommandOriginal );
00055 }
00056 }
00057 catch( nitro::exception e )
00058 {
00059 throw( nitro::exception( std::string( "CommandRedirections::RedirectCommand( const char * CommandOriginal )::" )+ e.what() , e.code() ) );
00060 }
00061 catch( ... )
00062 {
00063 throw( nitro::exception( "CommandRedirections::RedirectCommand( const char * CommandOriginal )::An error occured" , 1 ) );
00064 }
00065
00066 return( NULL );
00067 }
00068
00069 void * ViewInterface::GetGUI( const char * ViewName , void * Parent )
00070 {
00071 return( NULL );
00072 }
00073
00074 StringCollection * ModelInterface::ExecuteCommand( const char * Command , const void * Param1 , const void * Param2 )
00075 {
00076 return( NULL );
00077 }
00078
00079 };
00080
00081 #endif