|
Packit Service |
e3b512 |
/* Copyright (C) 2005 The cairomm Development Team
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* This library is free software; you can redistribute it and/or
|
|
Packit Service |
e3b512 |
* modify it under the terms of the GNU Library General Public
|
|
Packit Service |
e3b512 |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
e3b512 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* This library is distributed in the hope that it will be useful,
|
|
Packit Service |
e3b512 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
e3b512 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
e3b512 |
* Library General Public License for more details.
|
|
Packit Service |
e3b512 |
*
|
|
Packit Service |
e3b512 |
* You should have received a copy of the GNU Library General Public
|
|
Packit Service |
e3b512 |
* License along with this library; if not, write to the Free Software
|
|
Packit Service |
e3b512 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
Packit Service |
e3b512 |
* 02110-1301, USA.
|
|
Packit Service |
e3b512 |
*/
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
#ifndef __CAIROMM_PRIVATE_H
|
|
Packit Service |
e3b512 |
#define __CAIROMM_PRIVATE_H
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
#include <cairomm/enums.h>
|
|
Packit Service |
e3b512 |
#include <cairomm/exception.h>
|
|
Packit Service |
e3b512 |
#include <string>
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
#ifndef DOXYGEN_IGNORE_THIS
|
|
Packit Service |
e3b512 |
namespace Cairo
|
|
Packit Service |
e3b512 |
{
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
/// Throws the appropriate exception, if exceptions are enabled.
|
|
Packit Service |
e3b512 |
void throw_exception(ErrorStatus status);
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
//We inline this because it is called so often.
|
|
Packit Service |
e3b512 |
inline void check_status_and_throw_exception(ErrorStatus status)
|
|
Packit Service |
e3b512 |
{
|
|
Packit Service |
e3b512 |
if(status != CAIRO_STATUS_SUCCESS)
|
|
Packit Service |
e3b512 |
throw_exception(status); //This part doesn't need to be inline because it would rarely be called.
|
|
Packit Service |
e3b512 |
}
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
template<class T>
|
|
Packit Service |
e3b512 |
void check_object_status_and_throw_exception(const T& object)
|
|
Packit Service |
e3b512 |
{
|
|
Packit Service |
e3b512 |
//get_status() is normally an inlined member method.
|
|
Packit Service |
e3b512 |
check_status_and_throw_exception(object.get_status());
|
|
Packit Service |
e3b512 |
}
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
} // namespace Cairo
|
|
Packit Service |
e3b512 |
#endif //DOXYGEN_IGNORE_THIS
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
#endif //__CAIROMM_PRIVATE_H
|
|
Packit Service |
e3b512 |
|
|
Packit Service |
e3b512 |
// vim: ts=2 sw=2 et
|