libLAS API Reference  1.8.1
error.hpp
Go to the documentation of this file.
1 /******************************************************************************
2  * $Id$
3  *
4  * Project: libLAS - http://liblas.org - A BSD library for LAS format data.
5  * Purpose: An error encapsulation class
6  * Author: Mateusz Loskot, mateusz@loskot.net
7  *
8  ******************************************************************************
9  * Copyright (c) 2008, Mateusz Loskot
10  * Copyright (c) 2008, Howard Butler
11  * Copyright (c) 2008, Phil Vachon
12  *
13  * All rights reserved.
14  *
15  * Redistribution and use in source and binary forms, with or without
16  * modification, are permitted provided that the following
17  * conditions are met:
18  *
19  * * Redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer.
21  * * Redistributions in binary form must reproduce the above copyright
22  * notice, this list of conditions and the following disclaimer in
23  * the documentation and/or other materials provided
24  * with the distribution.
25  * * Neither the name of the Martin Isenburg or Iowa Department
26  * of Natural Resources nor the names of its contributors may be
27  * used to endorse or promote products derived from this software
28  * without specific prior written permission.
29  *
30  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
33  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
34  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
35  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
36  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
37  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
38  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
39  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
40  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
41  * OF SUCH DAMAGE.
42  ****************************************************************************/
43 
44 #ifndef LIBLAS_LASERROR_HPP_INCLUDED
45 #define LIBLAS_LASERROR_HPP_INCLUDED
46 
47 #include <liblas/export.hpp>
48 //std
49 #include <iosfwd>
50 #include <string>
51 
52 namespace liblas {
53 
59 {
60 public:
61 
64  Error(int code, std::string const& message, std::string const& method);
65 
68  Error(Error const& other);
69 
72  Error& operator=(Error const& rhs);
73 
74  // TODO - mloskot: What about replacing string return by copy with const char* ?
75  // char const* GetMethod() const { return m_method.c_str(); }, etc.
76 
77  int GetCode() const { return m_code; }
78  std::string GetMessage() const { return m_message; }
79  std::string GetMethod() const { return m_method; }
80 
81 private:
82 
83  int m_code;
84  std::string m_message;
85  std::string m_method;
86 };
87 
88 } // namespace liblas
89 
90 #endif // LIBLAS_LASERROR_HPP_INCLUDED
#define LAS_DLL
Definition: export.hpp:58
int GetCode() const
Definition: error.hpp:77
Namespace grouping all elements of libLAS public interface.
Definition: bounds.hpp:60
Definition of error notification used on the level of C API.
Definition: error.hpp:58
std::string GetMessage() const
Definition: error.hpp:78
std::string GetMethod() const
Definition: error.hpp:79