YAPOG  0.0.1
Yet Another Pokemon Online Game
Exception.hpp
Go to the documentation of this file.
1 #ifndef YAPOG_EXCEPTION_HPP
2 # define YAPOG_EXCEPTION_HPP
3 
4 # include <exception>
5 
6 # include "YAPOG/Macros.hpp"
8 # include "YAPOG/System/String.hpp"
9 
10 # define YAPOG_EXCEPTION_MESSAGE_PREFIX \
11  "[YAPOG exception][" __FILE__ ":" + \
12  yap::StringHelper::ToString (__LINE__) + "] "
13 # define YAPOG_THROW(MESSAGE) \
14  throw yap::Exception (YAPOG_EXCEPTION_MESSAGE_PREFIX MESSAGE)
15 
16 namespace yap
17 {
18  class YAPOG_LIB Exception : public std::exception
19  {
20  public:
21 
22  explicit Exception (const String& message);
23  virtual ~Exception () throw ();
24 
25  Exception (const Exception& copy);
26  Exception& operator= (const Exception& copy);
27 
28  OStream& GetMessage (OStream& oStream) const throw ();
29 
30  private:
31 
33  };
34 } // namespace yap
35 
36 #endif // YAPOG_EXCEPTION_HPP