[cig-commits] r13704 - cs/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Wed Dec 17 02:31:35 PST 2008


Author: luis
Date: 2008-12-17 02:31:35 -0800 (Wed, 17 Dec 2008)
New Revision: 13704

Modified:
   cs/cigma/trunk/src/io_hdf5.h
   cs/cigma/trunk/src/io_hdf5_reader.cpp
Log:
Removed commented out code (leave only prototypes in header)

Modified: cs/cigma/trunk/src/io_hdf5.h
===================================================================
--- cs/cigma/trunk/src/io_hdf5.h	2008-12-17 10:31:34 UTC (rev 13703)
+++ cs/cigma/trunk/src/io_hdf5.h	2008-12-17 10:31:35 UTC (rev 13704)
@@ -41,163 +41,33 @@
 /**
  * Load H5File from filename.
  */
-H5::H5File* h5_open_file(const char *filename, const char *mode);/*
-{
-    std::string m(mode);
-    H5::H5File *file = 0;
+H5::H5File* h5_open_file(const char *filename, const char *mode);
 
-    try
-    {
-        H5::Exception::dontPrint();
 
-        if (m == "a")
-        {
-            try
-            {
-                // open existing file in read/write mode
-                file = new H5::H5File(filename, H5F_ACC_RDWR);
-            }
-            catch (H5::FileIException e)
-            {
-            }
-
-            if (file == 0)
-            {
-                // previous attempt failed: force creation of new file
-                file = new H5::H5File(filename, H5F_ACC_TRUNC);
-            }
-        }
-        else if (m == "rw")
-        {
-            // open existing file in read/write mode (fail otherwise)
-            file = new H5::H5File(filename, H5F_ACC_RDWR);
-        }
-        else if (m == "r")
-        {
-            // opens existing file in read-only mode (fail otherwise)
-            file = new H5::H5File(filename, H5F_ACC_RDONLY);
-        }
-        else if (m == "w")
-        {
-            // creates new file
-            file = new H5::H5File(filename, H5F_ACC_TRUNC);
-        }
-        else if (m == "x")
-        {
-            // creates file, but fails if it already exists
-            file = new H5::H5File(filename, H5F_ACC_EXCL);
-        }
-        else
-        {
-            std::cerr << "Error: Unknown file mode '" << mode << "'" << std::endl;
-        }
-    }
-    catch (H5::FileIException error)
-    {
-        error.printError();
-    }
-
-    return file;
-}
-// */
-
-
 /**
  * Load group from location
  */
-H5::Group* h5_open_group(H5::H5File *file, const char *loc);/*
-{
-    H5::Group* group = 0;
+H5::Group* h5_open_group(H5::H5File *file, const char *loc);
 
-    if (file)
-    {
-        H5::Exception::dontPrint();
 
-        try
-        {
-            group = new H5::Group(file->openGroup(loc));
-        }
-        catch (H5::Exception error)
-        {
-        }
-    }
-
-    return group;
-}
-// */
-
-
 /**
  * Load dataset from location.
  */
-H5::DataSet* h5_open_dataset(H5::H5File *file, const char *loc);/*
-{
-    H5::DataSet* dataset = 0;
+H5::DataSet* h5_open_dataset(H5::H5File *file, const char *loc);
 
-    if (file)
-    {
-        H5::Exception::dontPrint();
 
-        try
-        {
-            dataset = new H5::DataSet(file->openDataSet(loc));
-        }
-        catch (H5::Exception error)
-        {
-        }
-    }
-
-    return dataset;
-}
-// */
-
-
 /**
  * Load object from location, whether it is a group or dataset.
  */
-H5::H5Object* h5_open_object(H5::H5File *file, const char *loc);/*
-{
-    H5::H5Object* obj = 0;
+H5::H5Object* h5_open_object(H5::H5File *file, const char *loc);
 
-    if (file)
-    {
-        obj = h5_open_group(file, loc);
 
-        if (obj == 0)
-        {
-            obj = h5_open_dataset(file, loc);
-        }
-    }
-
-    return obj;
-}
-// */
-
-
 /**
  * Load attribute from object
  */
-H5::Attribute* h5_open_attribute(H5::H5Object *obj, const char *attr_name);/*
-{
-    H5::Attribute *attribute = 0;
+H5::Attribute* h5_open_attribute(H5::H5Object *obj, const char *attr_name);
 
-    if (obj)
-    {
-        try
-        {
-            attribute = new H5::Attribute(obj->openAttribute(attr_name));
-        }
-        catch (H5::Exception error)
-        {
-        }
-    }
 
-    return attribute;
-}
-// */
-
-
-
 /**
  * Read entire dataset into memory.
  * @param MT C++ memory type of data array

Modified: cs/cigma/trunk/src/io_hdf5_reader.cpp
===================================================================
--- cs/cigma/trunk/src/io_hdf5_reader.cpp	2008-12-17 10:31:34 UTC (rev 13703)
+++ cs/cigma/trunk/src/io_hdf5_reader.cpp	2008-12-17 10:31:35 UTC (rev 13704)
@@ -110,7 +110,7 @@
 
 HDF5_Reader::HDF5_Reader()
 {
-    throw cigma::Exception("HDF5_Reader", "Can't create HDF5_Reader. Cigma is not configured with the C++ HDF5 Library");
+    throw cigma::Exception("HDF5_Reader", "Can't create HDF5_Reader. Cigma is not configured with C++ HDF5 Library");
 }
 
 HDF5_Reader::~HDF5_Reader()
@@ -163,7 +163,6 @@
     return -1;
 }
 
-
 int HDF5_Reader::readAttrDouble(const char *loc, const char *attr_name, double& val)
 {
     return -1;



More information about the CIG-COMMITS mailing list