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

« back to all changes in this revision

Viewing changes to include/liblas/external/property_tree/exceptions.hpp

  • 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
// Copyright (C) 2002-2006 Marcin Kalicinski
 
3
// Copyright (C) 2009 Sebastian Redl
 
4
//
 
5
// Distributed under the Boost Software License, Version 1.0. 
 
6
// (See accompanying file LICENSE_1_0.txt or copy at 
 
7
// http://www.boost.org/LICENSE_1_0.txt)
 
8
//
 
9
// For more information, see www.boost.org
 
10
// ----------------------------------------------------------------------------
 
11
 
 
12
#ifndef LIBLAS_BOOST_PROPERTY_TREE_EXCEPTIONS_HPP_INCLUDED
 
13
#define LIBLAS_BOOST_PROPERTY_TREE_EXCEPTIONS_HPP_INCLUDED
 
14
 
 
15
#include <liblas/external/property_tree/ptree_fwd.hpp>
 
16
 
 
17
#include <boost/any.hpp>
 
18
#include <string>
 
19
#include <stdexcept>
 
20
 
 
21
namespace liblas { namespace property_tree
 
22
{
 
23
 
 
24
    /// Base class for all property tree errors. Derives from
 
25
    /// @c std::runtime_error. Call member function @c what to get human
 
26
    /// readable message associated with the error.
 
27
    class ptree_error : public std::runtime_error
 
28
    {
 
29
    public:
 
30
        /// Instantiate a ptree_error instance with the given message.
 
31
        /// @param what The message to associate with this error.
 
32
        ptree_error(const std::string &what);
 
33
 
 
34
        ~ptree_error() throw();
 
35
    };
 
36
 
 
37
 
 
38
    /// Error indicating that translation from given value to the property tree
 
39
    /// data_type (or vice versa) failed. Derives from ptree_error.
 
40
    class ptree_bad_data : public ptree_error
 
41
    {
 
42
    public:
 
43
        /// Instantiate a ptree_bad_data instance with the given message and
 
44
        /// data.
 
45
        /// @param what The message to associate with this error.
 
46
        /// @param data The value associated with this error that was the source
 
47
        ///             of the translation failure.
 
48
        template<class T> ptree_bad_data(const std::string &what,
 
49
                                         const T &data);
 
50
 
 
51
        ~ptree_bad_data() throw();
 
52
 
 
53
        /// Retrieve the data associated with this error. This is the source
 
54
        /// value that failed to be translated.
 
55
        template<class T> T data();
 
56
    private:
 
57
        boost::any m_data;
 
58
    };
 
59
 
 
60
 
 
61
    /// Error indicating that specified path does not exist. Derives from
 
62
    /// ptree_error.
 
63
    class ptree_bad_path : public ptree_error
 
64
    {
 
65
    public:
 
66
        /// Instantiate a ptree_bad_path with the given message and path data.
 
67
        /// @param what The message to associate with this error.
 
68
        /// @param path The path that could not be found in the property_tree.
 
69
        template<class T> ptree_bad_path(const std::string &what,
 
70
                                         const T &path);
 
71
 
 
72
        ~ptree_bad_path() throw();
 
73
 
 
74
        /// Retrieve the invalid path.
 
75
        template<class T> T path();
 
76
    private:
 
77
        boost::any m_path;
 
78
    };
 
79
 
 
80
}}
 
81
 
 
82
#include <liblas/external/property_tree/detail/exception_implementation.hpp>
 
83
 
 
84
#endif