File: parseerror.h

package info (click to toggle)
martchus-cpp-utilities 5.28.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,352 kB
  • sloc: cpp: 12,471; awk: 18; ansic: 12; makefile: 10
file content (38 lines) | stat: -rw-r--r-- 858 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef APPLICATION_UTILITIES_PARSE_ERROR_H
#define APPLICATION_UTILITIES_PARSE_ERROR_H

#include "../global.h"

#include <iosfwd>
#include <stdexcept>

namespace CppUtilities {

class CPP_UTILITIES_EXPORT ParseError : public std::runtime_error {
public:
    ParseError();
    ParseError(const std::string &what);
    ~ParseError() noexcept override;
};

/*!
 * \brief Constructs a new ParseError.
 */
inline ParseError::ParseError()
    : std::runtime_error("undetermined parsing")
{
}

/*!
 * \brief Constructs a new ParseError. \a what is a std::string describing the cause of the ParseError.
 */
inline ParseError::ParseError(const std::string &what)
    : std::runtime_error(what)
{
}

CPP_UTILITIES_EXPORT std::ostream &operator<<(std::ostream &o, const ParseError &failure);

} // namespace CppUtilities

#endif // APPLICATION_UTILITIES_PARSE_ERROR_H