LCOV - code coverage report
Current view: top level - include/as2js - exceptions.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 25 25 100.0 %
Date: 2014-11-22 Functions: 25 37 67.6 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #ifndef AS2JS_EXCEPTIONS_H
       2             : #define AS2JS_EXCEPTIONS_H
       3             : /* exceptions.h -- written by Alexis WILKE for Made to Order Software Corp. (c) 2005-2014 */
       4             : 
       5             : /*
       6             : 
       7             : Copyright (c) 2005-2014 Made to Order Software Corp.
       8             : 
       9             : http://snapwebsites.org/project/as2js
      10             : 
      11             : Permission is hereby granted, free of charge, to any
      12             : person obtaining a copy of this software and
      13             : associated documentation files (the "Software"), to
      14             : deal in the Software without restriction, including
      15             : without limitation the rights to use, copy, modify,
      16             : merge, publish, distribute, sublicense, and/or sell
      17             : copies of the Software, and to permit persons to whom
      18             : the Software is furnished to do so, subject to the
      19             : following conditions:
      20             : 
      21             : The above copyright notice and this permission notice
      22             : shall be included in all copies or substantial
      23             : portions of the Software.
      24             : 
      25             : THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
      26             : ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
      27             : LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
      28             : FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
      29             : EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
      30             : LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
      31             : WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
      32             : ARISING FROM, OUT OF OR IN CONNECTION WITH THE
      33             : SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
      34             : SOFTWARE.
      35             : 
      36             : */
      37             : 
      38             : #include    <stdexcept>
      39             : 
      40             : 
      41             : namespace as2js
      42             : {
      43             : 
      44    62065527 : class exception_internal_error : public std::logic_error
      45             : {
      46             : public:
      47    62065449 :     exception_internal_error(char const *msg)        : logic_error(msg) {}
      48          78 :     exception_internal_error(std::string const& msg) : logic_error(msg) {}
      49             : };
      50             : 
      51             : 
      52          13 : class exception_exit : public std::runtime_error
      53             : {
      54             : public:
      55          13 :     exception_exit(int exit_code, char const *msg)        : runtime_error(msg), f_exit_code(exit_code) {}
      56             :     exception_exit(int exit_code, std::string const& msg) : runtime_error(msg), f_exit_code(exit_code) {}
      57             : 
      58             :     int         get_exit_code() const { return f_exit_code; }
      59             : 
      60             : private:
      61             :     int const   f_exit_code;
      62             : };
      63             : 
      64             : 
      65        2042 : class exception_locked_node : public std::runtime_error
      66             : {
      67             : public:
      68        2042 :     exception_locked_node(char const *msg)        : runtime_error(msg) {}
      69             :     exception_locked_node(std::string const& msg) : runtime_error(msg) {}
      70             : };
      71             : 
      72             : 
      73             : class exception_invalid_float : public std::runtime_error
      74             : {
      75             : public:
      76             :     exception_invalid_float(char const *msg)        : runtime_error(msg) {}
      77             :     exception_invalid_float(std::string const& msg) : runtime_error(msg) {}
      78             : };
      79             : 
      80             : 
      81           2 : class exception_invalid_index : public std::runtime_error
      82             : {
      83             : public:
      84           2 :     exception_invalid_index(char const *msg)        : runtime_error(msg) {}
      85             :     exception_invalid_index(std::string const& msg) : runtime_error(msg) {}
      86             : };
      87             : 
      88             : 
      89       11099 : class exception_incompatible_node_type : public std::runtime_error
      90             : {
      91             : public:
      92       11099 :     exception_incompatible_node_type(char const *msg)        : runtime_error(msg) {}
      93             :     exception_incompatible_node_type(std::string const& msg) : runtime_error(msg) {}
      94             : };
      95             : 
      96             : 
      97         100 : class exception_incompatible_node_data : public std::runtime_error
      98             : {
      99             : public:
     100         100 :     exception_incompatible_node_data(char const *msg)        : runtime_error(msg) {}
     101             :     exception_incompatible_node_data(std::string const& msg) : runtime_error(msg) {}
     102             : };
     103             : 
     104             : 
     105          12 : class exception_invalid_data : public std::runtime_error
     106             : {
     107             : public:
     108          12 :     exception_invalid_data(char const *msg)        : runtime_error(msg) {}
     109             :     exception_invalid_data(std::string const& msg) : runtime_error(msg) {}
     110             : };
     111             : 
     112             : 
     113         200 : class exception_already_defined : public std::runtime_error
     114             : {
     115             : public:
     116         200 :     exception_already_defined(char const *msg)        : runtime_error(msg) {}
     117             :     exception_already_defined(std::string const& msg) : runtime_error(msg) {}
     118             : };
     119             : 
     120             : 
     121           2 : class exception_no_parent : public std::runtime_error
     122             : {
     123             : public:
     124           2 :     exception_no_parent(char const *msg)        : runtime_error(msg) {}
     125             :     exception_no_parent(std::string const& msg) : runtime_error(msg) {}
     126             : };
     127             : 
     128             : 
     129         341 : class exception_index_out_of_range : public std::out_of_range
     130             : {
     131             : public:
     132         341 :     exception_index_out_of_range(char const *msg)        : out_of_range(msg) {}
     133             :     exception_index_out_of_range(std::string const& msg) : out_of_range(msg) {}
     134             : };
     135             : 
     136             : 
     137             : class exception_cannot_open_file : public std::runtime_error
     138             : {
     139             : public:
     140             :     exception_cannot_open_file(char const *msg)        : runtime_error(msg) {}
     141             :     exception_cannot_open_file(std::string const& msg) : runtime_error(msg) {}
     142             : };
     143             : 
     144             : 
     145           3 : class exception_file_already_open : public std::logic_error
     146             : {
     147             : public:
     148             :     exception_file_already_open(char const *msg)        : logic_error(msg) {}
     149           3 :     exception_file_already_open(std::string const& msg) : logic_error(msg) {}
     150             : };
     151             : 
     152             : 
     153          20 : class exception_cyclical_structure : public std::logic_error
     154             : {
     155             : public:
     156          20 :     exception_cyclical_structure(char const *msg)        : logic_error(msg) {}
     157             :     exception_cyclical_structure(std::string const& msg) : logic_error(msg) {}
     158             : };
     159             : 
     160             : 
     161             : }
     162             : // namespace as2js
     163             : #endif
     164             : // #ifndef AS2JS_AS_H
     165             : 
     166             : // vim: ts=4 sw=4 et

Generated by: LCOV version 1.10