[MOAB-dev] commit/MOAB: tautges: Moving FileOptions.hpp to moab/, making part of the externally-visible API.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Sep 11 16:46:29 CDT 2013


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/f99479fa75f9/
Changeset:   f99479fa75f9
Branch:      master
User:        tautges
Date:        2013-09-11 23:46:08
Summary:     Moving FileOptions.hpp to moab/, making part of the externally-visible API.

Tests work in serial, parallel, debug and optimized.

Affected #:  46 files

diff --git a/itaps/igeom/FBiGeom_MOAB.cpp b/itaps/igeom/FBiGeom_MOAB.cpp
index cb889bd..7fcd2b1 100644
--- a/itaps/igeom/FBiGeom_MOAB.cpp
+++ b/itaps/igeom/FBiGeom_MOAB.cpp
@@ -4,7 +4,7 @@
 #include "moab/GeomTopoTool.hpp"
 #include "moab/OrientedBoxTreeTool.hpp"
 #include "moab/CartVect.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "MBTagConventions.hpp"
 #include <stdlib.h>
 #include <cstring>

diff --git a/itaps/imesh/iMeshP_MOAB.cpp b/itaps/imesh/iMeshP_MOAB.cpp
index e554fba..51254ca 100644
--- a/itaps/imesh/iMeshP_MOAB.cpp
+++ b/itaps/imesh/iMeshP_MOAB.cpp
@@ -4,7 +4,7 @@
 #include "moab/Range.hpp"
 #include "moab/CN.hpp"
 #include "moab/MeshTopoUtil.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "moab/ParallelComm.hpp"
 #include "MBParallelConventions.h"
 #include "MBIter.hpp"

diff --git a/itaps/imesh/iMesh_MOAB.cpp b/itaps/imesh/iMesh_MOAB.cpp
index d09fec1..68c0b72 100644
--- a/itaps/imesh/iMesh_MOAB.cpp
+++ b/itaps/imesh/iMesh_MOAB.cpp
@@ -4,7 +4,7 @@
 #include "moab/CN.hpp"
 #include "moab/MeshTopoUtil.hpp"
 #include "moab/ScdInterface.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "iMesh_MOAB.hpp"
 #include "MBIter.hpp"
 #include "MBTagConventions.hpp"
@@ -3303,7 +3303,7 @@ void iMesh_createStructuredMesh(iMesh_Instance instance,
   ScdBox *scd_box;
   rval = scdi->construct_box(HomCoord(local_dims[0], local_dims[1], (-1 != local_dims[2] ? local_dims[2] : 0), 1),
                              HomCoord(local_dims[3], local_dims[4], (-1 != local_dims[5] ? local_dims[5] : 0), 1),
-                             NULL, 0, scd_box);
+                             NULL, 0, scd_box, NULL, NULL, (vert_gids ? true : false));
   CHKERR(rval, "Trouble creating scd vertex sequence.");
 
     // set the global box parameters

diff --git a/src/Core.cpp b/src/Core.cpp
index 57ff342..ad855ea 100644
--- a/src/Core.cpp
+++ b/src/Core.cpp
@@ -83,7 +83,7 @@
 #include "MBTagConventions.hpp"
 #include "ExoIIUtil.hpp"
 #include "EntitySequence.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #ifdef LINUX
 # include <dlfcn.h>
 # include <dirent.h>

diff --git a/src/FileOptions.cpp b/src/FileOptions.cpp
index f2a4477..380a491 100644
--- a/src/FileOptions.cpp
+++ b/src/FileOptions.cpp
@@ -18,7 +18,7 @@
  *\date 2007-08-21
  */
 
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 
 #include <ctype.h>
 #include <stdlib.h>

diff --git a/src/FileOptions.hpp b/src/FileOptions.hpp
deleted file mode 100644
index 85b3eef..0000000
--- a/src/FileOptions.hpp
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * MOAB, a Mesh-Oriented datABase, is a software component for creating,
- * storing and accessing finite element mesh data.
- * 
- * Copyright 2004 Sandia Corporation.  Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Coroporation, the U.S. Government
- * retains certain rights in this software.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- */
-
-/**\file FileOptions.hpp
- *\author Jason Kraftcheck (kraftche at cae.wisc.edu)
- *\date 2007-08-21
- */
-
-#ifndef FILE_OPTIONS_HPP
-#define FILE_OPTIONS_HPP
-
-#include <string>
-#include <vector>
-#include "moab/Types.hpp"
-
-namespace moab {
-
-/**\brief Parse options string passed to file IO routines
- *
- * This is a utility class used by file-IO-related code to 
- * parse the options string passed to Core::load_file and
- * Core::write_file
- */
-class FileOptions {
-public:
-
-  /*\param options_string The concatenation of a list of 
-   *          options, separated either by the default separator
-   *          (semicolon) with a custom separator specified at
-   *          the beginning of the string (semicolon followed by
-   *          destired separator character.)
-   */
-  FileOptions( const char* option_string );
-  
-  FileOptions( const FileOptions& copy );
-  FileOptions& operator=( const FileOptions& copy );
-  
-  ~FileOptions();
-  
-  /**\brief Check for option with no value 
-   *
-   * Check for an option w/out a value.
-   *\param name The option name
-   *\return - MB_SUCCESS if option is found
-   *        - MB_TYPE_OUT_OF_RANGE if options is found, but has value
-   *        - MB_ENTITY_NOT_FOUND if option is not found.
-   */
-  ErrorCode get_null_option( const char* name ) const;
-  
-  
-  /**\brief Check for option with boolean (true/false, yes/no) value.
-   *
-   * Check for an option with a true/false value.  Allowable values
-   * are "true", "false", "yes", "no", "1", "0", "on", "off".
-   *\param name The option name
-   *\param default_value The value to return if the option is not specified.
-   *\param value The resulting value.  This argument is set to the passed
-   *            default value if the option is not found.
-   *\return - MB_TYPE_OUT_OF_RANGE if options is found, but has an invalid value
-   *        - MB_SUCCESS otherwise
-   */
-  ErrorCode get_toggle_option( const char* name, 
-                               bool default_value,
-                               bool& value ) const;
-   
-  /**\brief Check for option with an integer value.
-   *
-   * Check for an option with an integer value
-   *\param name The option name
-   *\param value Output. The value.
-   *\return - MB_SUCCESS if option is found
-   *        - MB_TYPE_OUT_OF_RANGE if options is found, but does not have an integer value
-   *        - MB_ENTITY_NOT_FOUND if option is not found.
-   */
-  ErrorCode get_int_option( const char* name, int& value ) const;
-  
-  /**\brief Check for option with an integer value.  Accept option with no value.
-   *
-   * Check for an option with an integer value.
-   * If the option is found but has no value specified, then
-   * pass back the user-specified default value.
-   *
-   *\NOTE:  This function will not pass back the default_val, but will instead
-   *        return MB_ENTITY_NOT_FOUND if the option is not specified at all.
-   *        The default value is returned only when the option is specified,
-   *        but is specified w/out a value.
-   *
-   *\param name The option name
-   *\param default_val The default value for the option.
-   *\param value Output. The value.
-   *\return - MB_SUCCESS if option is found
-   *        - MB_TYPE_OUT_OF_RANGE if options is found but has a value that cannot be parsed as an int
-   *        - MB_ENTITY_NOT_FOUND if option is not found.
-   */
-  ErrorCode get_int_option( const char* name, int default_val, int& value ) const;
-  
-  /**\brief Check for option with a double value.
-   *
-   * Check for an option with a double value
-   *\param name The option name
-   *\param value Output. The value.
-   *\return - MB_SUCCESS if option is found
-   *        - MB_TYPE_OUT_OF_RANGE if options is found, but does not have a double value
-   *        - MB_ENTITY_NOT_FOUND if option is not found.
-   */
-  ErrorCode get_real_option( const char* name, double& value ) const;
-  
-  /**\brief Check for option with any value.
-   *
-   * Check for an option with any value.
-   *\param name The option name
-   *\param value Output. The value.
-   *\return - MB_SUCCESS if option is found
-   *        - MB_TYPE_OUT_OF_RANGE if options is found, but does not have a value
-   *        - MB_ENTITY_NOT_FOUND if option is not found.
-   */
-  ErrorCode get_str_option( const char* name, std::string& value ) const;
-  
-  /**\brief Check for option 
-   *
-   * Check for an option
-   *\param name The option name
-   *\param value The option value, or an empty string if no value.
-   *\return MB_SUCCESS or MB_ENTITY_NOT_FOUND
-   */
-  ErrorCode get_option( const char* name, std::string& value ) const;
-  
-  /**\brief Check the string value of an option
-   *
-   * Check which of a list of possible values a string option contains.
-   *\param name The option name
-   *\param values A NULL-terminated array of C-style strings enumerating
-   *              the possible option values.
-   *\param index  Output: The index into <code>values</code> for the
-   *              option 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 is not in the input <code>values</code> array.
-   */
-  ErrorCode 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/
-   */
-  ErrorCode 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
-   * be a comma-separated list of int ranges, where an int range can be 
-   * either a single integer value or a range of integer values separated
-   * by a dash ('-').
-   *
-   *\param name The option name
-   *\param values Output. The list of integer values.
-   *\return - MB_SUCCESS if option is found
-   *        - MB_TYPE_OUT_OF_RANGE if options is found, but does not contain an ID list
-   *        - MB_ENTITY_NOT_FOUND if option is not found.
-   */
-  ErrorCode get_ints_option( const char* name, std::vector<int>& values) const;
-  
-  /**\brief Check for option for which the value is a list of doubles
-   *
-   * Check for an option which is a double list.  The value is expected to
-   * be a comma-separated list of double values
-   *
-   *\param name The option name
-   *\param values Output. The list of double values.
-   *\return - MB_SUCCESS if option is found
-   *        - MB_TYPE_OUT_OF_RANGE if options is found, but does not contain an ID list
-   *        - MB_ENTITY_NOT_FOUND if option is not found.
-   */
-  ErrorCode get_reals_option( const char* name, std::vector<double>& values) const;
-  
-  /**\brief Check for option for which the value is a list of strings
-   *
-   * Check for an option which is a string list.  The value is expected to
-   * be a comma-separated list of string values, with no embedded spaces or commas.
-   *
-   *\param name The option name
-   *\param values Output. The list of string values.
-   *\return - MB_SUCCESS if option is found
-   *        - MB_TYPE_OUT_OF_RANGE if options is found, but does not contain a string list
-   *        - MB_ENTITY_NOT_FOUND if option is not found.
-   */
-  ErrorCode get_strs_option( const char* name, std::vector<std::string>& values) const;
-  
-  /** number of options */
-  inline unsigned size() const 
-    { return mOptions.size(); }
-  
-  /** true if no options */
-  inline bool empty() const 
-    { return mOptions.empty(); }
-  
-  /** Get list of options */
-  void get_options( std::vector<std::string>& list ) const;
-  
-  /** Check if all options have been looked at */
-  bool all_seen() const;
-  
-  /** Mark all options as seen.  USed for non-root procs during bcast-delete read */
-  void mark_all_seen() const;
-  
-  /** Get first unseen option */
-  ErrorCode get_unseen_option( std::string& value ) const;
-  
-private:
-  
-  /**\brief Check for option 
-   *
-   * Check for an option
-   *\param name The option name
-   *\param value The option value, or an empty string if no value.
-   *\return MB_SUCCESS or MB_ENTITY_NOT_FOUND
-   */
-  ErrorCode get_option( const char* name, const char*& value) const;
-
-  char* mData;
-  std::vector<const char*> mOptions;
-  mutable std::vector<bool> mSeen;
-
-    /** Case-insensitive compare of name with option value. */
-  static bool compare( const char* name, const char* option );
-};
-  
-} // namespace moab
-
-#endif
-

diff --git a/src/io/NCHelperEuler.cpp b/src/io/NCHelperEuler.cpp
index e5b3f08..ca86127 100644
--- a/src/io/NCHelperEuler.cpp
+++ b/src/io/NCHelperEuler.cpp
@@ -1,6 +1,6 @@
 #include "NCHelperEuler.hpp"
 #include "moab/ReadUtilIface.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 
 #include <cmath>
 #include <sstream>

diff --git a/src/io/NCHelperFV.cpp b/src/io/NCHelperFV.cpp
index dd555ff..a234450 100644
--- a/src/io/NCHelperFV.cpp
+++ b/src/io/NCHelperFV.cpp
@@ -1,6 +1,6 @@
 #include "NCHelperFV.hpp"
 #include "moab/ReadUtilIface.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 
 #include <cmath>
 #include <sstream>

diff --git a/src/io/NCHelperHOMME.cpp b/src/io/NCHelperHOMME.cpp
index f883bd7..4f2ac51 100644
--- a/src/io/NCHelperHOMME.cpp
+++ b/src/io/NCHelperHOMME.cpp
@@ -1,6 +1,6 @@
 #include "NCHelperHOMME.hpp"
 #include "moab/ReadUtilIface.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "moab/SpectralMeshTool.hpp"
 
 #include <cmath>

diff --git a/src/io/NCHelperMPAS.cpp b/src/io/NCHelperMPAS.cpp
index 45d1b00..c0605e8 100644
--- a/src/io/NCHelperMPAS.cpp
+++ b/src/io/NCHelperMPAS.cpp
@@ -1,6 +1,6 @@
 #include "NCHelperMPAS.hpp"
 #include "moab/ReadUtilIface.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "moab/SpectralMeshTool.hpp"
 #include "MBTagConventions.hpp"
 

diff --git a/src/io/ReadABAQUS.cpp b/src/io/ReadABAQUS.cpp
index 1c44057..b3a37d0 100644
--- a/src/io/ReadABAQUS.cpp
+++ b/src/io/ReadABAQUS.cpp
@@ -36,7 +36,7 @@
 #include "moab/ReadUtilIface.hpp"
 #include "AffineXform.hpp"
 // #include "abaqus_order.h"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 
 namespace moab {
 

diff --git a/src/io/ReadCCMIO.cpp b/src/io/ReadCCMIO.cpp
index 3161425..ec53b6c 100644
--- a/src/io/ReadCCMIO.cpp
+++ b/src/io/ReadCCMIO.cpp
@@ -11,7 +11,7 @@
 #include "MBTagConventions.hpp"
 #include "Internals.hpp"
 #include "moab/ReadUtilIface.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "ReadCCMIO.hpp"
 #include "moab/MeshTopoUtil.hpp"
 

diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 02f748e..a610d4a 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -37,7 +37,7 @@
 #include "moab/Interface.hpp"
 #include "moab/Range.hpp"
 #include "MBTagConventions.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 
 #include "moab/GeomTopoTool.hpp"
 

diff --git a/src/io/ReadDamsel.cpp b/src/io/ReadDamsel.cpp
index 8d1bcfe..f02f0ea 100644
--- a/src/io/ReadDamsel.cpp
+++ b/src/io/ReadDamsel.cpp
@@ -13,7 +13,7 @@
 #include "moab/Range.hpp"
 #include "moab/Error.hpp"
 #include "moab/ReadUtilIface.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "MBTagConventions.hpp"
 #include "EntitySequence.hpp"
 #include "Internals.hpp"

diff --git a/src/io/ReadGCRM.cpp b/src/io/ReadGCRM.cpp
index 19d789e..0b86bd6 100644
--- a/src/io/ReadGCRM.cpp
+++ b/src/io/ReadGCRM.cpp
@@ -15,7 +15,7 @@
 #include "moab/ReaderIface.hpp"
 #include "moab/ReadUtilIface.hpp"
 #include "MBTagConventions.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 
 #define ERRORR(rval, str) \
     if (MB_SUCCESS != rval) {readMeshIface->report_error("%s", str); return rval;}

diff --git a/src/io/ReadHDF5.cpp b/src/io/ReadHDF5.cpp
index 916b69a..c707380 100644
--- a/src/io/ReadHDF5.cpp
+++ b/src/io/ReadHDF5.cpp
@@ -38,7 +38,7 @@
 #include "MBTagConventions.hpp"
 #include "ReadHDF5.hpp"
 #include "moab/CN.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #ifdef HDF5_PARALLEL
 #  include <H5FDmpi.h>
 #  include <H5FDmpio.h>

diff --git a/src/io/ReadMCNP5.cpp b/src/io/ReadMCNP5.cpp
index c05ed41..b290f75 100644
--- a/src/io/ReadMCNP5.cpp
+++ b/src/io/ReadMCNP5.cpp
@@ -18,7 +18,7 @@
 #include "moab/ReadUtilIface.hpp"
 #include "Internals.hpp" // for MB_START_ID
 #include "moab/Range.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 
 #include <iostream>
 #include <sstream>

diff --git a/src/io/ReadNASTRAN.cpp b/src/io/ReadNASTRAN.cpp
index 6534417..47a8780 100644
--- a/src/io/ReadNASTRAN.cpp
+++ b/src/io/ReadNASTRAN.cpp
@@ -27,7 +27,7 @@
 #include "moab/ReadUtilIface.hpp"
 #include "Internals.hpp" // for MB_START_ID
 #include "moab/Range.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "FileTokenizer.hpp"
 #include "MBTagConventions.hpp"
 #include "moab/CN.hpp"

diff --git a/src/io/ReadNC.cpp b/src/io/ReadNC.cpp
index 50225df..a27a89d 100644
--- a/src/io/ReadNC.cpp
+++ b/src/io/ReadNC.cpp
@@ -3,7 +3,7 @@
 
 #include "moab/ReadUtilIface.hpp"
 #include "MBTagConventions.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 
 #define ERRORR(rval, str) \
   if (MB_SUCCESS != rval) { readMeshIface->report_error("%s", str); return rval; }

diff --git a/src/io/ReadNCDF.cpp b/src/io/ReadNCDF.cpp
index c69b3b5..01e98aa 100644
--- a/src/io/ReadNCDF.cpp
+++ b/src/io/ReadNCDF.cpp
@@ -38,7 +38,7 @@
 #include "Internals.hpp"
 #include "moab/ReadUtilIface.hpp"
 #include "exodus_order.h"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "moab/AdaptiveKDTree.hpp"
 #include "moab/CartVect.hpp"
 

diff --git a/src/io/ReadSTL.cpp b/src/io/ReadSTL.cpp
index 4ba085d..59bd80b 100644
--- a/src/io/ReadSTL.cpp
+++ b/src/io/ReadSTL.cpp
@@ -25,7 +25,7 @@
 #include "moab/Interface.hpp"
 #include "moab/ReadUtilIface.hpp"
 #include "moab/Range.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "SysUtil.hpp"
 
 #include <errno.h>

diff --git a/src/io/ReadSmf.cpp b/src/io/ReadSmf.cpp
index 0970d71..eac232e 100644
--- a/src/io/ReadSmf.cpp
+++ b/src/io/ReadSmf.cpp
@@ -28,7 +28,7 @@
 #include "Internals.hpp"
 #include "moab/Interface.hpp"
 #include "moab/ReadUtilIface.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "AffineXform.hpp"
 
 static inline int streq(const char *a,const char *b) { return strcmp(a,b)==0; }

diff --git a/src/io/ReadTemplate.cpp b/src/io/ReadTemplate.cpp
index 309a71e..97f70ce 100644
--- a/src/io/ReadTemplate.cpp
+++ b/src/io/ReadTemplate.cpp
@@ -8,7 +8,7 @@
 #include "moab/Interface.hpp"
 #include "moab/ReadUtilIface.hpp"
 #include "moab/Range.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 
 #include <cstdio>
 #include <assert.h>

diff --git a/src/io/ReadTetGen.cpp b/src/io/ReadTetGen.cpp
index 72197fb..1d6609a 100644
--- a/src/io/ReadTetGen.cpp
+++ b/src/io/ReadTetGen.cpp
@@ -2,7 +2,7 @@
 #include "moab/Interface.hpp"
 #include "moab/Range.hpp"
 #include "moab/ReadUtilIface.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "MBTagConventions.hpp"
 #include <iostream>
 #include <fstream>

diff --git a/src/io/ReadVtk.cpp b/src/io/ReadVtk.cpp
index ac3b9e4..2936a85 100644
--- a/src/io/ReadVtk.cpp
+++ b/src/io/ReadVtk.cpp
@@ -28,7 +28,7 @@
 #include "Internals.hpp"
 #include "moab/Interface.hpp"
 #include "moab/ReadUtilIface.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "FileTokenizer.hpp"
 #include "VtkUtil.hpp"
 

diff --git a/src/io/Tqdcfr.cpp b/src/io/Tqdcfr.cpp
index b930ab6..717f43a 100644
--- a/src/io/Tqdcfr.cpp
+++ b/src/io/Tqdcfr.cpp
@@ -16,7 +16,7 @@
 #include "Tqdcfr.hpp"
 #include "moab/Core.hpp"
 #include "moab/Range.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include <iostream>
 #include <string>
 

diff --git a/src/io/WriteGmsh.cpp b/src/io/WriteGmsh.cpp
index aac3d38..7d4e2f7 100644
--- a/src/io/WriteGmsh.cpp
+++ b/src/io/WriteGmsh.cpp
@@ -5,7 +5,7 @@
 #include "moab/Interface.hpp"
 #include "moab/Range.hpp"
 #include "moab/WriteUtilIface.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "GmshUtil.hpp"
 
 #include <fstream>

diff --git a/src/io/WriteHDF5.cpp b/src/io/WriteHDF5.cpp
index 839c455..f48399a 100644
--- a/src/io/WriteHDF5.cpp
+++ b/src/io/WriteHDF5.cpp
@@ -48,7 +48,7 @@
 #include "Internals.hpp"
 #include "MBTagConventions.hpp"
 #include "moab/CN.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "moab/Version.h"
 #include "IODebugTrack.hpp"
 #include "mhdf.h"

diff --git a/src/io/WriteSTL.cpp b/src/io/WriteSTL.cpp
index 62644a6..45718d8 100644
--- a/src/io/WriteSTL.cpp
+++ b/src/io/WriteSTL.cpp
@@ -25,7 +25,7 @@
 #include "moab/Interface.hpp"
 #include "moab/Range.hpp"
 #include "moab/WriteUtilIface.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "SysUtil.hpp"
 
 #include <stdio.h>

diff --git a/src/io/WriteSmf.cpp b/src/io/WriteSmf.cpp
index 0a09b8b..9d7f5f0 100644
--- a/src/io/WriteSmf.cpp
+++ b/src/io/WriteSmf.cpp
@@ -40,7 +40,7 @@
 #include "MBTagConventions.hpp"
 #include "moab/WriteUtilIface.hpp"
 #include "Internals.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "moab/Version.h"
 
 namespace moab {

diff --git a/src/io/WriteVtk.cpp b/src/io/WriteVtk.cpp
index 03e95e4..bfda520 100644
--- a/src/io/WriteVtk.cpp
+++ b/src/io/WriteVtk.cpp
@@ -41,7 +41,7 @@
 #include "MBTagConventions.hpp"
 #include "moab/WriteUtilIface.hpp"
 #include "Internals.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "moab/Version.h"
 
 #define INS_ID(stringvar, prefix, id) \

diff --git a/src/moab/FileOptions.hpp b/src/moab/FileOptions.hpp
new file mode 100644
index 0000000..85b3eef
--- /dev/null
+++ b/src/moab/FileOptions.hpp
@@ -0,0 +1,248 @@
+/*
+ * MOAB, a Mesh-Oriented datABase, is a software component for creating,
+ * storing and accessing finite element mesh data.
+ * 
+ * Copyright 2004 Sandia Corporation.  Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Coroporation, the U.S. Government
+ * retains certain rights in this software.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ */
+
+/**\file FileOptions.hpp
+ *\author Jason Kraftcheck (kraftche at cae.wisc.edu)
+ *\date 2007-08-21
+ */
+
+#ifndef FILE_OPTIONS_HPP
+#define FILE_OPTIONS_HPP
+
+#include <string>
+#include <vector>
+#include "moab/Types.hpp"
+
+namespace moab {
+
+/**\brief Parse options string passed to file IO routines
+ *
+ * This is a utility class used by file-IO-related code to 
+ * parse the options string passed to Core::load_file and
+ * Core::write_file
+ */
+class FileOptions {
+public:
+
+  /*\param options_string The concatenation of a list of 
+   *          options, separated either by the default separator
+   *          (semicolon) with a custom separator specified at
+   *          the beginning of the string (semicolon followed by
+   *          destired separator character.)
+   */
+  FileOptions( const char* option_string );
+  
+  FileOptions( const FileOptions& copy );
+  FileOptions& operator=( const FileOptions& copy );
+  
+  ~FileOptions();
+  
+  /**\brief Check for option with no value 
+   *
+   * Check for an option w/out a value.
+   *\param name The option name
+   *\return - MB_SUCCESS if option is found
+   *        - MB_TYPE_OUT_OF_RANGE if options is found, but has value
+   *        - MB_ENTITY_NOT_FOUND if option is not found.
+   */
+  ErrorCode get_null_option( const char* name ) const;
+  
+  
+  /**\brief Check for option with boolean (true/false, yes/no) value.
+   *
+   * Check for an option with a true/false value.  Allowable values
+   * are "true", "false", "yes", "no", "1", "0", "on", "off".
+   *\param name The option name
+   *\param default_value The value to return if the option is not specified.
+   *\param value The resulting value.  This argument is set to the passed
+   *            default value if the option is not found.
+   *\return - MB_TYPE_OUT_OF_RANGE if options is found, but has an invalid value
+   *        - MB_SUCCESS otherwise
+   */
+  ErrorCode get_toggle_option( const char* name, 
+                               bool default_value,
+                               bool& value ) const;
+   
+  /**\brief Check for option with an integer value.
+   *
+   * Check for an option with an integer value
+   *\param name The option name
+   *\param value Output. The value.
+   *\return - MB_SUCCESS if option is found
+   *        - MB_TYPE_OUT_OF_RANGE if options is found, but does not have an integer value
+   *        - MB_ENTITY_NOT_FOUND if option is not found.
+   */
+  ErrorCode get_int_option( const char* name, int& value ) const;
+  
+  /**\brief Check for option with an integer value.  Accept option with no value.
+   *
+   * Check for an option with an integer value.
+   * If the option is found but has no value specified, then
+   * pass back the user-specified default value.
+   *
+   *\NOTE:  This function will not pass back the default_val, but will instead
+   *        return MB_ENTITY_NOT_FOUND if the option is not specified at all.
+   *        The default value is returned only when the option is specified,
+   *        but is specified w/out a value.
+   *
+   *\param name The option name
+   *\param default_val The default value for the option.
+   *\param value Output. The value.
+   *\return - MB_SUCCESS if option is found
+   *        - MB_TYPE_OUT_OF_RANGE if options is found but has a value that cannot be parsed as an int
+   *        - MB_ENTITY_NOT_FOUND if option is not found.
+   */
+  ErrorCode get_int_option( const char* name, int default_val, int& value ) const;
+  
+  /**\brief Check for option with a double value.
+   *
+   * Check for an option with a double value
+   *\param name The option name
+   *\param value Output. The value.
+   *\return - MB_SUCCESS if option is found
+   *        - MB_TYPE_OUT_OF_RANGE if options is found, but does not have a double value
+   *        - MB_ENTITY_NOT_FOUND if option is not found.
+   */
+  ErrorCode get_real_option( const char* name, double& value ) const;
+  
+  /**\brief Check for option with any value.
+   *
+   * Check for an option with any value.
+   *\param name The option name
+   *\param value Output. The value.
+   *\return - MB_SUCCESS if option is found
+   *        - MB_TYPE_OUT_OF_RANGE if options is found, but does not have a value
+   *        - MB_ENTITY_NOT_FOUND if option is not found.
+   */
+  ErrorCode get_str_option( const char* name, std::string& value ) const;
+  
+  /**\brief Check for option 
+   *
+   * Check for an option
+   *\param name The option name
+   *\param value The option value, or an empty string if no value.
+   *\return MB_SUCCESS or MB_ENTITY_NOT_FOUND
+   */
+  ErrorCode get_option( const char* name, std::string& value ) const;
+  
+  /**\brief Check the string value of an option
+   *
+   * Check which of a list of possible values a string option contains.
+   *\param name The option name
+   *\param values A NULL-terminated array of C-style strings enumerating
+   *              the possible option values.
+   *\param index  Output: The index into <code>values</code> for the
+   *              option 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 is not in the input <code>values</code> array.
+   */
+  ErrorCode 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/
+   */
+  ErrorCode 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
+   * be a comma-separated list of int ranges, where an int range can be 
+   * either a single integer value or a range of integer values separated
+   * by a dash ('-').
+   *
+   *\param name The option name
+   *\param values Output. The list of integer values.
+   *\return - MB_SUCCESS if option is found
+   *        - MB_TYPE_OUT_OF_RANGE if options is found, but does not contain an ID list
+   *        - MB_ENTITY_NOT_FOUND if option is not found.
+   */
+  ErrorCode get_ints_option( const char* name, std::vector<int>& values) const;
+  
+  /**\brief Check for option for which the value is a list of doubles
+   *
+   * Check for an option which is a double list.  The value is expected to
+   * be a comma-separated list of double values
+   *
+   *\param name The option name
+   *\param values Output. The list of double values.
+   *\return - MB_SUCCESS if option is found
+   *        - MB_TYPE_OUT_OF_RANGE if options is found, but does not contain an ID list
+   *        - MB_ENTITY_NOT_FOUND if option is not found.
+   */
+  ErrorCode get_reals_option( const char* name, std::vector<double>& values) const;
+  
+  /**\brief Check for option for which the value is a list of strings
+   *
+   * Check for an option which is a string list.  The value is expected to
+   * be a comma-separated list of string values, with no embedded spaces or commas.
+   *
+   *\param name The option name
+   *\param values Output. The list of string values.
+   *\return - MB_SUCCESS if option is found
+   *        - MB_TYPE_OUT_OF_RANGE if options is found, but does not contain a string list
+   *        - MB_ENTITY_NOT_FOUND if option is not found.
+   */
+  ErrorCode get_strs_option( const char* name, std::vector<std::string>& values) const;
+  
+  /** number of options */
+  inline unsigned size() const 
+    { return mOptions.size(); }
+  
+  /** true if no options */
+  inline bool empty() const 
+    { return mOptions.empty(); }
+  
+  /** Get list of options */
+  void get_options( std::vector<std::string>& list ) const;
+  
+  /** Check if all options have been looked at */
+  bool all_seen() const;
+  
+  /** Mark all options as seen.  USed for non-root procs during bcast-delete read */
+  void mark_all_seen() const;
+  
+  /** Get first unseen option */
+  ErrorCode get_unseen_option( std::string& value ) const;
+  
+private:
+  
+  /**\brief Check for option 
+   *
+   * Check for an option
+   *\param name The option name
+   *\param value The option value, or an empty string if no value.
+   *\return MB_SUCCESS or MB_ENTITY_NOT_FOUND
+   */
+  ErrorCode get_option( const char* name, const char*& value) const;
+
+  char* mData;
+  std::vector<const char*> mOptions;
+  mutable std::vector<bool> mSeen;
+
+    /** Case-insensitive compare of name with option value. */
+  static bool compare( const char* name, const char* option );
+};
+  
+} // namespace moab
+
+#endif
+

diff --git a/src/parallel/ReadParallel.cpp b/src/parallel/ReadParallel.cpp
index 96492fc..fe4ed55 100644
--- a/src/parallel/ReadParallel.cpp
+++ b/src/parallel/ReadParallel.cpp
@@ -1,7 +1,7 @@
 #include "ReadParallel.hpp"
 #include "moab/Core.hpp"
 #include "moab/ProcConfig.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "moab/Error.hpp"
 #include "moab/ReaderWriterSet.hpp"
 #include "moab/ReadUtilIface.hpp"

diff --git a/src/parallel/WriteHDF5Parallel.cpp b/src/parallel/WriteHDF5Parallel.cpp
index 4fbca9e..20a36a3 100644
--- a/src/parallel/WriteHDF5Parallel.cpp
+++ b/src/parallel/WriteHDF5Parallel.cpp
@@ -40,7 +40,7 @@
 #include "moab/Range.hpp"
 
 #include "IODebugTrack.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 
 namespace {
   template<bool Condition> struct STATIC_ASSERTION;

diff --git a/test/h5file/h5partial.cpp b/test/h5file/h5partial.cpp
index 7df5203..17abc06 100644
--- a/test/h5file/h5partial.cpp
+++ b/test/h5file/h5partial.cpp
@@ -3,7 +3,7 @@
 #include "TestRunner.hpp"
 #include "ReadHDF5.hpp"
 #include "MBTagConventions.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 
 #ifdef USE_MPI
 #include "moab_mpi.h"

diff --git a/test/h5file/h5portable.cpp b/test/h5file/h5portable.cpp
index 7a4fe89..42dfd05 100644
--- a/test/h5file/h5portable.cpp
+++ b/test/h5file/h5portable.cpp
@@ -11,7 +11,7 @@
 #include "TestRunner.hpp"
 #include "ReadHDF5.hpp"
 #include "MBTagConventions.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include <vector>
 #include <stdlib.h>
 #include <iostream>

diff --git a/test/h5file/h5regression.cpp b/test/h5file/h5regression.cpp
index eed72c3..584bfd6 100644
--- a/test/h5file/h5regression.cpp
+++ b/test/h5file/h5regression.cpp
@@ -3,7 +3,7 @@
 #include "moab/Range.hpp"
 #include "moab/ReadUtilIface.hpp"
 #include "WriteHDF5.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 
 #ifdef USE_MPI
 #include "moab_mpi.h"

diff --git a/test/io/exodus_test.cc b/test/io/exodus_test.cc
index 9707431..c5d8786 100644
--- a/test/io/exodus_test.cc
+++ b/test/io/exodus_test.cc
@@ -4,7 +4,7 @@
 #include "moab/CN.hpp"
 #include "moab/Range.hpp"
 #include "ReadNCDF.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #define IS_BUILDING_MB
 #include "ExoIIUtil.hpp"
 #include <math.h>

diff --git a/test/parallel/parallel_unit_tests.cpp b/test/parallel/parallel_unit_tests.cpp
index 864ebae..45ef1c5 100644
--- a/test/parallel/parallel_unit_tests.cpp
+++ b/test/parallel/parallel_unit_tests.cpp
@@ -1,7 +1,7 @@
 #include "moab/ParallelComm.hpp"
 #include "MBParallelConventions.h"
 #include "ReadParallel.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "MBTagConventions.hpp"
 #include "moab/Core.hpp"
 #include "moab_mpi.h"

diff --git a/test/parallel/pcomm_serial.cpp b/test/parallel/pcomm_serial.cpp
index 5e63851..fe05194 100644
--- a/test/parallel/pcomm_serial.cpp
+++ b/test/parallel/pcomm_serial.cpp
@@ -2,7 +2,7 @@
 #include "MBParallelConventions.h"
 #include "MBTagConventions.hpp"
 #include "moab/Core.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "ReadParallel.hpp"
 #include "TestUtil.hpp"
 #include <vector>

diff --git a/test/parallel/pcomm_unit.cpp b/test/parallel/pcomm_unit.cpp
index f0eb372..bb6e57c 100644
--- a/test/parallel/pcomm_unit.cpp
+++ b/test/parallel/pcomm_unit.cpp
@@ -4,7 +4,7 @@
 #include "moab/Core.hpp"
 #include "moab/MeshTopoUtil.hpp"
 #include "ReadParallel.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "TestUtil.hpp"
 #include <algorithm>
 #include <vector>

diff --git a/test/parallel/uber_parallel_test.cpp b/test/parallel/uber_parallel_test.cpp
index 665d620..d995342 100644
--- a/test/parallel/uber_parallel_test.cpp
+++ b/test/parallel/uber_parallel_test.cpp
@@ -1,7 +1,7 @@
 #include "moab/ParallelComm.hpp"
 #include "MBParallelConventions.h"
 #include "ReadParallel.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "MBTagConventions.hpp"
 #include "moab/Core.hpp"
 #include "moab_mpi.h"

diff --git a/tools/dagmc/DagMC.cpp b/tools/dagmc/DagMC.cpp
index d50c615..87f84cb 100755
--- a/tools/dagmc/DagMC.cpp
+++ b/tools/dagmc/DagMC.cpp
@@ -4,7 +4,7 @@
 #include "moab/Range.hpp"
 #include "moab/Core.hpp"
 #include "moab/GeomUtil.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 
 #ifdef CGM
 #include "InitCGMA.hpp"

diff --git a/tools/mbcoupler/ElemUtil.hpp b/tools/mbcoupler/ElemUtil.hpp
index 597c264..a3f9a1c 100644
--- a/tools/mbcoupler/ElemUtil.hpp
+++ b/tools/mbcoupler/ElemUtil.hpp
@@ -8,12 +8,12 @@
 // to access data structures for spectral elements
 
 extern "C"{
-#include "types.h"
-#include "poly.h"
-#include "tensor.h"
+#include "moab/point_locater/lotte/types.h"
+#include "moab/point_locater/lotte/poly.h"
+#include "moab/point_locater/lotte/tensor.h"
 //#include "findpt.h"
-#include "extrafindpt.h"
-#include "errmem.h"
+#include "moab/point_locater/lotte/extrafindpt.h"
+#include "moab/point_locater/lotte/errmem.h"
 }
 
 namespace moab {

diff --git a/tools/mbcoupler/ssn_test.cpp b/tools/mbcoupler/ssn_test.cpp
index dff80b9..426c91e 100644
--- a/tools/mbcoupler/ssn_test.cpp
+++ b/tools/mbcoupler/ssn_test.cpp
@@ -2,7 +2,7 @@
 #include "moab/ParallelComm.hpp"
 #include "MBParallelConventions.h"
 #include "moab/Core.hpp"
-#include "FileOptions.hpp"
+#include "moab/FileOptions.hpp"
 #include "ReadParallel.hpp"
 #include "Coupler.hpp"
 #include "iMesh_extensions.h"

diff --git a/tools/mcnpmit/main.cpp b/tools/mcnpmit/main.cpp
index c138970..7eb0011 100644
--- a/tools/mcnpmit/main.cpp
+++ b/tools/mcnpmit/main.cpp
@@ -12,7 +12,7 @@
 #include "MBTagConventions.hpp"
 #include "moab/AdaptiveKDTree.hpp"
 #include "moab/GeomUtil.hpp"
-#include "tools/mbcoupler/ElemUtil.hpp"
+#include "../tools/mbcoupler/ElemUtil.hpp"
 
 #define MBI mb_instance()

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list