ENH: Add a way to set options of the handler genericly

This commit is contained in:
Andy Cedilnik 2005-02-17 15:22:29 -05:00
parent e2ec4a1845
commit ab7668de3f
2 changed files with 36 additions and 0 deletions

View File

@ -27,4 +27,34 @@ cmCTestGenericHandler::~cmCTestGenericHandler()
{
}
void cmCTestGenericHandler::SetOption(const char* op, const char* value)
{
if ( !op )
{
return;
}
if ( !value )
{
cmCTestGenericHandler::t_StringToString::iterator remit
= m_Options.find(op);
if ( remit != m_Options.end() )
{
m_Options.erase(remit);
}
return;
}
m_Options[op] = value;
}
const char* cmCTestGenericHandler::GetOption(const char* op)
{
cmCTestGenericHandler::t_StringToString::iterator remit
= m_Options.find(op);
if ( remit == m_Options.end() )
{
return 0;
}
return remit->second.c_str();
}

View File

@ -58,9 +58,15 @@ public:
cmCTestGenericHandler();
virtual ~cmCTestGenericHandler();
typedef std::map<cmStdString,cmStdString> t_StringToString;
void SetOption(const char* op, const char* value);
const char* GetOption(const char* op);
protected:
bool m_Verbose;
cmCTest *m_CTest;
t_StringToString m_Options;
};
#endif