summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-02-17 20:22:29 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-02-17 20:22:29 (GMT)
commitab7668de3f952a289987dca477f6540912302430 (patch)
tree0fc43e15f093f74966e5365e4e86f9d48f0d8182
parente2ec4a18453f3bdc1ab826a618a2202c5e9e9dec (diff)
downloadCMake-ab7668de3f952a289987dca477f6540912302430.zip
CMake-ab7668de3f952a289987dca477f6540912302430.tar.gz
CMake-ab7668de3f952a289987dca477f6540912302430.tar.bz2
ENH: Add a way to set options of the handler genericly
-rw-r--r--Source/CTest/cmCTestGenericHandler.cxx30
-rw-r--r--Source/CTest/cmCTestGenericHandler.h6
2 files changed, 36 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx
index 9ae2ff7..0fa6d07 100644
--- a/Source/CTest/cmCTestGenericHandler.cxx
+++ b/Source/CTest/cmCTestGenericHandler.cxx
@@ -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();
+}
diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h
index 26fdc02..a40974c 100644
--- a/Source/CTest/cmCTestGenericHandler.h
+++ b/Source/CTest/cmCTestGenericHandler.h
@@ -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