[MOAB-dev] r4541 - MOAB/trunk/src/io

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Thu Mar 3 11:50:48 CST 2011


Author: kraftche
Date: 2011-03-03 11:50:46 -0600 (Thu, 03 Mar 2011)
New Revision: 4541

Modified:
   MOAB/trunk/src/io/ReadIDEAS.cpp
Log:
make ReadIDEAS a little more picky about what it considers and I-deas unv file (i.e. don't 'successfully' read STEP files)

Modified: MOAB/trunk/src/io/ReadIDEAS.cpp
===================================================================
--- MOAB/trunk/src/io/ReadIDEAS.cpp	2011-03-01 20:38:34 UTC (rev 4540)
+++ MOAB/trunk/src/io/ReadIDEAS.cpp	2011-03-03 17:50:46 UTC (rev 4541)
@@ -57,11 +57,18 @@
 
   char line[10000];
   file.getline(line, 10000);
-  std::string s = line;
-  if (s.find("-1") > s.length()) return MB_FAILURE;
+  char* liter = line;
+  while (*liter && isspace(*liter))
+    ++liter;
+  if (*liter != '-') return MB_FAILURE;
+  ++liter;
+  if (*liter != '1') return MB_FAILURE;
+  while (*++liter)
+    if (!isspace(*liter))
+      return MB_FAILURE;
 
   EntityHandle first_vertex = 0;
-
+  std::string s;
   while (! file.eof() ) {
     file.getline(line, 10000);
     s = line;



























More information about the moab-dev mailing list