[cig-commits] r13749 - cs/cigma/trunk/src
luis at geodynamics.org
luis at geodynamics.org
Wed Dec 17 02:33:02 PST 2008
Author: luis
Date: 2008-12-17 02:33:02 -0800 (Wed, 17 Dec 2008)
New Revision: 13749
Modified:
cs/cigma/trunk/src/DataPath.cpp
cs/cigma/trunk/src/DataPath.h
Log:
Added methods DataPath::is_{text,vtk,hdf5}_file
Modified: cs/cigma/trunk/src/DataPath.cpp
===================================================================
--- cs/cigma/trunk/src/DataPath.cpp 2008-12-17 10:33:00 UTC (rev 13748)
+++ cs/cigma/trunk/src/DataPath.cpp 2008-12-17 10:33:02 UTC (rev 13749)
@@ -90,11 +90,6 @@
return (fname != "") || (dname != "");
}
-std::string DataPath::extension() const
-{
- return boost::filesystem::extension(fname);
-}
-
std::string DataPath::filename() const
{
return fname;
@@ -125,7 +120,27 @@
this->dname = dname;
}
+std::string DataPath::extension() const
+{
+ return boost::filesystem::extension(fname);
+}
+bool DataPath::is_text_file() const
+{
+ return is_text_extension(this->extension().c_str());
+}
+
+bool DataPath::is_vtk_file() const
+{
+ return is_vtk_extension(this->extension().c_str());
+}
+
+bool DataPath::is_hdf5_file() const
+{
+ return is_hdf5_extension(this->extension().c_str());
+}
+
+
// ----------------------------------------------------------------------------
std::ostream& operator<<(std::ostream& os, const DataPath& dp)
Modified: cs/cigma/trunk/src/DataPath.h
===================================================================
--- cs/cigma/trunk/src/DataPath.h 2008-12-17 10:33:00 UTC (rev 13748)
+++ cs/cigma/trunk/src/DataPath.h 2008-12-17 10:33:02 UTC (rev 13749)
@@ -18,7 +18,6 @@
bool empty() const;
operator bool() const;
- std::string extension() const;
std::string filename() const;
std::string location() const;
std::string first() const;
@@ -27,6 +26,11 @@
void set_filename(std::string fname);
void set_location(std::string dname);
+ std::string extension() const;
+ bool is_text_file() const;
+ bool is_vtk_file() const;
+ bool is_hdf5_file() const;
+
public:
std::string fname;
std::string dname;
More information about the CIG-COMMITS
mailing list