~ubuntu-branches/ubuntu/trusty/liblas/trusty-proposed

« back to all changes in this revision

Viewing changes to src/lasfile.cpp

  • Committer: Package Import Robot
  • Author(s): Francesco Paolo Lovergine
  • Date: 2014-01-05 17:00:29 UTC
  • mfrom: (7.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140105170029-ddtp0j63x5jvck2u
Tags: 1.7.0+dfsg-2
Fixed missing linking of system boost component.
(closes: #733282)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/******************************************************************************
2
 
 * $Id$
3
 
 *
4
 
 * Project:  libLAS - http://liblas.org - A BSD library for LAS format data.
5
 
 * Purpose:  A composite class to handle read/write operations
6
 
 * Author:   Mateusz Loskot, mateusz@loskot.net
7
 
 *
8
 
 ******************************************************************************
9
 
 * Copyright (c) 2008, Mateusz Loskot
10
 
 * Copyright (c) 2008, Howard Butler
11
 
 *
12
 
 * All rights reserved.
13
 
 * 
14
 
 * Redistribution and use in source and binary forms, with or without 
15
 
 * modification, are permitted provided that the following 
16
 
 * conditions are met:
17
 
 * 
18
 
 *     * Redistributions of source code must retain the above copyright 
19
 
 *       notice, this list of conditions and the following disclaimer.
20
 
 *     * Redistributions in binary form must reproduce the above copyright 
21
 
 *       notice, this list of conditions and the following disclaimer in 
22
 
 *       the documentation and/or other materials provided 
23
 
 *       with the distribution.
24
 
 *     * Neither the name of the Martin Isenburg or Iowa Department 
25
 
 *       of Natural Resources nor the names of its contributors may be 
26
 
 *       used to endorse or promote products derived from this software 
27
 
 *       without specific prior written permission.
28
 
 * 
29
 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
30
 
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
31
 
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
32
 
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
33
 
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
34
 
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
35
 
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
36
 
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
37
 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
38
 
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
39
 
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
40
 
 * OF SUCH DAMAGE.
41
 
 ****************************************************************************/
42
 
 
43
 
#include <liblas/lasfile.hpp>
44
 
#include <liblas/lasheader.hpp>
45
 
#include <liblas/detail/file.hpp>
46
 
 
47
 
#include <string>
48
 
#include <stdexcept>
49
 
 
50
 
namespace liblas {
51
 
 
52
 
LASFile::LASFile()
53
 
{
54
 
}
55
 
 
56
 
LASFile::LASFile(std::string const& filename)
57
 
    : m_pimpl(new detail::FileImpl(filename))
58
 
{
59
 
}
60
 
 
61
 
LASFile::LASFile(std::string const& filename, LASHeader const& header, Mode mode)
62
 
    : m_pimpl(new detail::FileImpl(filename, header, mode))
63
 
{
64
 
}
65
 
 
66
 
LASFile::LASFile(LASFile const& other)
67
 
    : m_pimpl(other.m_pimpl)
68
 
{
69
 
}
70
 
 
71
 
LASFile& LASFile::operator=(LASFile const& rhs)
72
 
{
73
 
    m_pimpl = rhs.m_pimpl;
74
 
    return (*this);
75
 
}
76
 
 
77
 
bool LASFile::IsNull() const
78
 
{
79
 
     return (0 == m_pimpl.get());
80
 
}
81
 
 
82
 
std::string LASFile::GetName() const
83
 
{
84
 
    return m_pimpl->GetName();
85
 
}
86
 
 
87
 
LASFile::Mode LASFile::GetMode() const
88
 
{
89
 
    int const mode = m_pimpl->GetMode();
90
 
    if (mode == 0)
91
 
        return eRead;
92
 
    else if (mode == 1)
93
 
        return eWrite;
94
 
    else if (mode == 2)
95
 
        return eAppend;
96
 
 
97
 
    assert("SHOULD NEVER GET HERE");
98
 
    return eRead;
99
 
}
100
 
 
101
 
LASHeader const& LASFile::GetHeader() const
102
 
{
103
 
    return m_pimpl->GetHeader();
104
 
}
105
 
 
106
 
LASReader& LASFile::GetReader()
107
 
{
108
 
    return m_pimpl->GetReader();
109
 
}
110
 
 
111
 
LASWriter& LASFile::GetWriter()
112
 
{
113
 
    return m_pimpl->GetWriter();
114
 
}
115
 
 
116
 
} // namespace liblas