Current Version: 1.0.33
Project Name: csspp
exception.h
Go to the documentation of this file.
1// Copyright (c) 2015-2025 Made to Order Software Corp. All Rights Reserved
2//
3// This program is free software; you can redistribute it and/or modify
4// it under the terms of the GNU General Public License as published by
5// the Free Software Foundation; either version 2 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License along
14// with this program; if not, write to the Free Software Foundation, Inc.,
15// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16#pragma once
17
18// C++
19//
20#include <stdexcept>
21
22
23namespace csspp
24{
25
26class csspp_exception_logic : public std::logic_error
27{
28public:
29 csspp_exception_logic(std::string const & whatmsg) : logic_error(whatmsg) {}
30};
31
32class csspp_exception_runtime : public std::runtime_error
33{
34public:
35 csspp_exception_runtime(std::string const & whatmsg) : std::runtime_error(whatmsg) {}
36};
37
38class csspp_exception_overflow : public std::overflow_error
39{
40public:
41 csspp_exception_overflow(std::string const & whatmsg) : overflow_error(whatmsg) {}
42};
43
45{
46public:
47 csspp_exception_lexer(std::string const & whatmsg) : csspp_exception_runtime(whatmsg) {}
48};
49
51{
52public:
53 csspp_exception_invalid_character(std::string const & whatmsg) : csspp_exception_runtime(whatmsg) {}
54};
55
57{
58public:
59 csspp_exception_invalid_token(std::string const & whatmsg) : csspp_exception_runtime(whatmsg) {}
60};
61
63{
64public:
65 csspp_exception_unexpected_token(std::string const & whatmsg) : csspp_exception_runtime(whatmsg) {}
66};
67
69{
70public:
71 csspp_exception_exit(int new_exit_code) : csspp_exception_runtime("fatal error"), f_exit_code(new_exit_code) {}
72
73 int exit_code() const { return f_exit_code; }
74
75private:
76 int f_exit_code = 0;
77};
78
79} // namespace csspp
80// vim: ts=4 sw=4 et
csspp_exception_exit(int new_exit_code)
Definition exception.h:71
csspp_exception_invalid_character(std::string const &whatmsg)
Definition exception.h:53
csspp_exception_invalid_token(std::string const &whatmsg)
Definition exception.h:59
csspp_exception_lexer(std::string const &whatmsg)
Definition exception.h:47
csspp_exception_logic(std::string const &whatmsg)
Definition exception.h:29
csspp_exception_overflow(std::string const &whatmsg)
Definition exception.h:41
csspp_exception_runtime(std::string const &whatmsg)
Definition exception.h:35
csspp_exception_unexpected_token(std::string const &whatmsg)
Definition exception.h:65
The namespace of all the classes in the CSS Preprocessor.
Definition csspp.h:48

Documentation of CSS Preprocessor.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.