Rss::Blocks 0.2
a codeblocks plugin that shows rss feeds
|
00001 /*************************************************************** 00002 * Name: virtuosonic.hpp 00003 * Purpose: common utility functions 00004 * Author: Gabriel Espinoza 00005 * Created: 11-Abr-2011 00006 * Copyright: Gabriel Espinoza 00007 * License: GPLv3+ 00008 **************************************************************/ 00009 #ifndef VIRTUOSONIC_HPP 00010 #define VIRTUOSONIC_HPP 00011 00013 namespace virtuosonic 00014 { 00015 #ifdef __WXWINDOWS__ 00016 #include <exception> 00017 #include <wx/string.h> 00022 class wxException : public std::exception 00023 { 00024 public: 00025 wxException(std::exception e){m_str=wxString::Format(_T("%s"),e.what());} 00026 wxException(const wxString& arg){m_str = arg;} 00027 ~wxException() throw(){} 00028 wxString what() 00029 { 00030 if (!m_str.IsEmpty()) 00031 return m_str; 00032 //ELSE 00033 return wxString::Format(_T("%s"),exception::what()); 00034 } 00035 private: 00036 wxString m_str; 00037 }; 00039 class wxInvalidArg : 00040 public std::invalid_argument, public wxException{}; 00041 #endif//__WXWINDOWS__ 00042 //gettext 00043 #ifndef _ 00044 #define _(x) x 00045 #endif 00046 00047 00048 }//namespace virtuosonic 00049 00050 #endif // VIRTUOSONIC_HPP