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

luis at geodynamics.org luis at geodynamics.org
Tue Dec 9 18:12:58 PST 2008


Author: luis
Date: 2008-12-09 18:12:57 -0800 (Tue, 09 Dec 2008)
New Revision: 13511

Modified:
   cs/cigma/trunk/src/DataPath.cpp
   cs/cigma/trunk/src/DataPath.h
Log:
Operator for casting a DataPath object to a boolean

Modified: cs/cigma/trunk/src/DataPath.cpp
===================================================================
--- cs/cigma/trunk/src/DataPath.cpp	2008-12-10 02:12:55 UTC (rev 13510)
+++ cs/cigma/trunk/src/DataPath.cpp	2008-12-10 02:12:57 UTC (rev 13511)
@@ -85,6 +85,11 @@
     return (fname == "") && (dname == "");
 }
 
+DataPath::operator bool() const
+{
+    return (fname != "") || (dname != "");
+}
+
 std::string DataPath::extension() const
 {
     return boost::filesystem::extension(fname);

Modified: cs/cigma/trunk/src/DataPath.h
===================================================================
--- cs/cigma/trunk/src/DataPath.h	2008-12-10 02:12:55 UTC (rev 13510)
+++ cs/cigma/trunk/src/DataPath.h	2008-12-10 02:12:57 UTC (rev 13511)
@@ -16,6 +16,7 @@
 
     bool exists() const;
     bool empty() const;
+    operator bool() const;
 
     std::string extension() const;
     std::string filename() const;



More information about the CIG-COMMITS mailing list