[Liblas-commits] r1277 - trunk/apps

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Jun 8 21:52:13 EDT 2009


Author: hobu
Date: Wed May 20 15:17:29 2009
New Revision: 1277
URL: http://liblas.org/changeset/1277

Log:
revert r1276

Modified:
   trunk/apps/lasindex.cpp

Modified: trunk/apps/lasindex.cpp
==============================================================================
--- trunk/apps/lasindex.cpp	(original)
+++ trunk/apps/lasindex.cpp	Wed May 20 15:17:29 2009
@@ -52,8 +52,8 @@
 {
     int rc = 0;
 
-    std::string* input = 0;
-    std::string* output = 0;
+    std::string input;
+    std::string output;
     
     for (int i = 1; i < argc; i++)
     {
@@ -71,7 +71,7 @@
                 )
         {
             i++;
-            input = new std::string(argv[i]);
+            input = std::string(argv[i]);
         }
         else if (   strcmp(argv[i],"--output") == 0  ||
                     strcmp(argv[i],"--out") == 0     ||
@@ -80,19 +80,19 @@
                 )
         {
             i++;
-            output = new std::string(argv[i]);
+            output = std::string(argv[i]);
         }
-        else if (i == argc - 2 && output->empty() && input->empty())
+        else if (i == argc - 2 && output.empty() && input.empty())
         {
-            input = new std::string(argv[i]);
+            input = std::string(argv[i]);
         }
-        else if (i == argc - 1 && output->empty() && input->empty())
+        else if (i == argc - 1 && output.empty() && input.empty())
         {
-            input = new std::string(argv[i]);
+            input = std::string(argv[i]);
         }
-        else if (i == argc - 1 && output->empty() && input->empty())
+        else if (i == argc - 1 && output.empty() && input.empty())
         {
-            output = new std::string(argv[i]);
+            output = std::string(argv[i]);
         }
         else 
         {
@@ -101,26 +101,26 @@
         }
     }
     
-    if (input->empty()) {
+    if (input.empty()) {
         usage();
         exit(-1);
     }
-    std::cout << "input: " << *input<<  " output: " <<output<<std::endl;
+    std::cout << "input: " << input<<  " output: " <<output<<std::endl;
     // 
-    std::istream* istrm = OpenInput(*input);
+    std::istream* istrm = OpenInput(input);
     LASReader* reader = new LASReader(*istrm);
     
     
     LASIndexDataStream* idxstrm = new LASIndexDataStream(reader);
 
-    LASIndex* index = new LASIndex( *input);
+    LASIndex* index = new LASIndex( input);
     index->Initialize(*idxstrm);
     
     delete idxstrm;
     delete index;
     delete reader;
     
-    LASIndex* idx = new LASIndex(*input);
+    LASIndex* idx = new LASIndex(input);
     
     idx->Initialize();
     std::vector<liblas::uint32_t>* ids = 0;
@@ -215,7 +215,4 @@
     // std::cout << "Vec length" << ids->size() << std::endl;
     // delete reader;
     // delete istrm;
-    
-    if (input != 0) delete input;
-    if (output != 0) delete output;
 }


More information about the Liblas-commits mailing list