[MOAB-dev] r4296 - MOAB/trunk/itaps/imesh
jvporter at wisc.edu
jvporter at wisc.edu
Mon Nov 22 17:12:13 CST 2010
Author: jvporter
Date: 2010-11-22 17:12:13 -0600 (Mon, 22 Nov 2010)
New Revision: 4296
Modified:
MOAB/trunk/itaps/imesh/MOAB_iMeshP_unit_tests.cpp
MOAB/trunk/itaps/imesh/iMeshP_MOAB.cpp
Log:
Fix option string parsing for iMeshP
Modified: MOAB/trunk/itaps/imesh/MOAB_iMeshP_unit_tests.cpp
===================================================================
--- MOAB/trunk/itaps/imesh/MOAB_iMeshP_unit_tests.cpp 2010-11-22 19:21:34 UTC (rev 4295)
+++ MOAB/trunk/itaps/imesh/MOAB_iMeshP_unit_tests.cpp 2010-11-22 23:12:13 UTC (rev 4296)
@@ -685,7 +685,7 @@
iBase_EntitySetHandle root_set;
iMesh_getRootSet( imesh, &root_set, &ierr );
- const char *opt = ";;PARTITION=PARALLEL_PARTITION";
+ const char *opt = "moab:PARTITION=PARALLEL_PARTITION";
iMeshP_loadAll( imesh, prtn, root_set, FILENAME, opt, &ierr, strlen(FILENAME), strlen(opt) );
PCHECK;
Modified: MOAB/trunk/itaps/imesh/iMeshP_MOAB.cpp
===================================================================
--- MOAB/trunk/itaps/imesh/iMeshP_MOAB.cpp 2010-11-22 19:21:34 UTC (rev 4295)
+++ MOAB/trunk/itaps/imesh/iMeshP_MOAB.cpp 2010-11-22 23:12:13 UTC (rev 4296)
@@ -1578,35 +1578,17 @@
int *err )
{ FIXME; RETURN(iBase_NOT_SUPPORTED); }
-static void append_option( std::string& opt,
+static int append_option( std::string& opt,
const char* option,
const char* default_value = 0 )
{
std::string::size_type i;
- // construct a std::string containing at least the leading
- // separator.
- char sep = opt.empty() ? ';' : opt[0];
-
- // make sure that the separator is ok (not contained in the option)
- const char separators[] = ";:,.!@$#%&*^|/\"'\\~%";
- if (strchr(option,sep) || (default_value && (sep == '=' || strchr(default_value,sep)))) {
- // need a new separator.
- int c, e = sizeof(separators)-1;
- for (c = 0; c < e; ++c)
- if (!strchr(opt.c_str(),separators[c]) &&
- !strchr(option,separators[c]) &&
- (!default_value || !strchr(default_value,separators[c])))
- break;
- if (c == e) {
- opt.clear();
- return;
- }
-
- i = 0;
- while (std::string::npos != (i = opt.find(sep,i)))
- opt[i] = separators[c];
More information about the moab-dev
mailing list