[Liblas-commits] r1197 - trunk/src/detail

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Apr 9 14:53:46 EDT 2009


Author: hobu
Date: Thu Apr  9 14:53:43 2009
New Revision: 1197
URL: http://liblas.org/changeset/1197

Log:
fix the tests for the case when we have a file that is just header and has no padding #124 #125

Modified:
   trunk/src/detail/reader10.cpp
   trunk/src/detail/reader11.cpp
   trunk/src/detail/reader12.cpp

Modified: trunk/src/detail/reader10.cpp
==============================================================================
--- trunk/src/detail/reader10.cpp	(original)
+++ trunk/src/detail/reader10.cpp	Thu Apr  9 14:53:43 2009
@@ -210,10 +210,17 @@
     // The 1.0 version *requires* the pad bytes, but in 
     // many instances, there are files without them.  What 
     // a fucking mess -- hobu.
+    m_has_pad_bytes = false;
+
     try {
         SkipPointDataSignature();
         m_has_pad_bytes = true;
     }
+    catch (std::out_of_range const& e)
+    {
+        // Ignore the out_of_range here for the case of a 
+        // file with just a header and no pad
+    }
     catch (std::domain_error const& e)
     {
         // TODO: We'll want to put this error on the validation errors stack

Modified: trunk/src/detail/reader11.cpp
==============================================================================
--- trunk/src/detail/reader11.cpp	(original)
+++ trunk/src/detail/reader11.cpp	Thu Apr  9 14:53:43 2009
@@ -211,6 +211,8 @@
     header.SetMax(x1, y1, z1);
     header.SetMin(x2, y2, z2);
 
+    m_has_pad_bytes = false;
+
     m_ifs.seekg(header.GetDataOffset(), std::ios::beg);
     try {
         // If this call succeeds, we'll want to put this on the 
@@ -219,6 +221,12 @@
         SkipPointDataSignature();
         m_has_pad_bytes = true;
     }
+    catch (std::out_of_range const& e)
+    {
+        // Ignore the out_of_range here for the case of a 
+        // file with just a header and no pad
+    }
+
     catch (std::domain_error const& e)
     {
     }

Modified: trunk/src/detail/reader12.cpp
==============================================================================
--- trunk/src/detail/reader12.cpp	(original)
+++ trunk/src/detail/reader12.cpp	Thu Apr  9 14:53:43 2009
@@ -216,6 +216,8 @@
 
     header.SetMax(x1, y1, z1);
     header.SetMin(x2, y2, z2);
+    
+    m_has_pad_bytes = false;
 
     m_ifs.seekg(header.GetDataOffset(), std::ios::beg);
     try {
@@ -225,10 +227,15 @@
         SkipPointDataSignature();
         m_has_pad_bytes = true;
     }
+    catch (std::out_of_range const& e)
+    {
+        // Ignore the out_of_range here for the case of a 
+        // file with just a header and no pad
+    }
     catch (std::domain_error const& e)
     {
     }
-
+    
 
     Reset(header);
     


More information about the Liblas-commits mailing list