src/proto2/Application.cc
branchno-netsession
changeset 36 785d220fc6b7
parent 35 e21cfda0edde
child 38 4189b8bf3a5b
equal deleted inserted replaced
35:e21cfda0edde 36:785d220fc6b7
     1 
     1 
     2 #include "Engine.hh"
     2 #include "Engine.hh"
       
     3 #include "Error.hh"
     3 
     4 
     4 #include <stdexcept>
     5 #include <stdexcept>
     5 #include <cassert>
     6 #include <cassert>
     6 
     7 
     7 #include <ClanLib/core.h>
     8 #include <ClanLib/core.h>
     8 #include <ClanLib/application.h>
     9 #include <ClanLib/application.h>
     9 
    10 
    10 class ArgumentError : public std::exception {
    11 class ArgumentError : public Error {
    11     private:
       
    12         const char *message;
       
    13     
       
    14     public:
    12     public:
    15         ArgumentError (const std::string &message) : message(message.c_str()) { }
    13         ArgumentError (const std::string &message) : Error(message) { }
    16 
       
    17         virtual const char* what() const throw() {
       
    18             return message;
       
    19         }
       
    20 };
    14 };
    21 
    15 
    22 class Main : public CL_ClanApplication {
    16 class Main : public CL_ClanApplication {
    23     private:
    17     private:
    24         // arguments
    18         // arguments