OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimLasInfo.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // File: ossimLibLasInfo.cpp
4 //
5 // License: LGPL
6 //
7 // See LICENSE.txt file in the top level directory for more details.
8 //
9 // Author: David Burken
10 //
11 // Description: LAS LIDAR info object.
12 //
13 //----------------------------------------------------------------------------
14 // $Id$
15 
18 
19 #include <fstream>
20 
22  : m_file()
23 {
24 }
25 
27 {
28 }
29 
31 {
32  bool result = false;
33  std::ifstream istr;
34  istr.open(file.c_str(), std::ios_base::in | std::ios_base::binary);
35  if ( istr.is_open() )
36  {
37  ossimLasHdr hdr;
38  result = hdr.checkSignature(istr);
39  if (result) m_file = file;
40  }
41  return result;
42 }
43 
45 {
46  std::ifstream istr;
47  istr.open(m_file.c_str(), std::ios_base::in | std::ios_base::binary);
48  if ( istr.is_open() )
49  {
50  ossimLasHdr hdr;
51  if ( hdr.checkSignature(istr) )
52  {
53  istr.seekg(0, std::ios_base::beg);
54  hdr.readStream(istr);
55  hdr.print(out);
56  }
57  }
58  return out;
59 }
std::ostream & print(std::ostream &out) const
print method.
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
bool checkSignature(std::istream &in) const
Checks for LASF in first four bytes.
virtual std::ostream & print(std::ostream &out) const
Print method.
ossimFilename m_file
Definition: ossimLasInfo.h:54
void readStream(std::istream &in)
Method to initialize from input stream.
virtual bool open(const ossimFilename &file)
open method.
virtual ~ossimLasInfo()
virtual destructor
ossimLasInfo()
default constructor
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23