[MOAB-dev] r1658 - MOAB/trunk
kraftche at mcs.anl.gov
kraftche at mcs.anl.gov
Fri Mar 14 09:15:31 CDT 2008
Author: kraftche
Date: 2008-03-14 09:15:30 -0500 (Fri, 14 Mar 2008)
New Revision: 1658
Modified:
MOAB/trunk/FileOptions.cpp
MOAB/trunk/FileOptions.hpp
Log:
add method to compare option to single string value
Modified: MOAB/trunk/FileOptions.cpp
===================================================================
--- MOAB/trunk/FileOptions.cpp 2008-03-13 21:39:23 UTC (rev 1657)
+++ MOAB/trunk/FileOptions.cpp 2008-03-14 14:15:30 UTC (rev 1658)
@@ -237,6 +237,14 @@
}
MBErrorCode FileOptions::match_option( const char* name,
+ const char* value ) const
+{
+ int idx;
+ const char* array[] = { value, NULL };
+ return match_option( name, array, idx );
+}
+
+MBErrorCode FileOptions::match_option( const char* name,
const char* const* values,
int& index ) const
{
Modified: MOAB/trunk/FileOptions.hpp
===================================================================
--- MOAB/trunk/FileOptions.hpp 2008-03-13 21:39:23 UTC (rev 1657)
+++ MOAB/trunk/FileOptions.hpp 2008-03-14 14:15:30 UTC (rev 1658)
@@ -113,6 +113,17 @@
*/
MBErrorCode match_option( const char* name, const char* const* values, int& index ) const;
+ /**\brief Check if an option matches a string value
+ *
+ * Check if the value for an option is the passed string.
+ *\param name The option name
+ *\param value The expected value.
+ *\return MB_SUCCESS if matched name and value.
+ * MB_ENTITY_NOT_FOUND if the option was not specified
+ * MB_FAILURE if the option value doesn't match the passed string/
+ */
+ MBErrorCode match_option( const char* name, const char* value ) const;
+
/**\brief Check for option for which the value is a list of ints
*
* Check for an option which is an int list. The value is expected to
More information about the moab-dev
mailing list