ObjFW  Artifact [8613058bed]

Artifact 8613058bed74b329c33d4611a62dda2057bbc16d33a4321fe6a13cf1057dd7c4:

  • File src/exceptions/OFUnboundNamespaceException.h — part of check-in [3d16a30f41] at 2013-06-22 12:12:36 on branch trunk — Rework exceptions.

    This mostly removes the argument for the class in which the exception
    occurred. As backtraces were recently added for all platforms, the
    passed class does not give any extra information on where the exception
    occurred anymore.

    This also removes a few other arguments which were not too helpful. In
    the past, the idea was to pass as many arguments as possible so that it
    is easier to find the origin of the exception. However, as backtraces
    are a much better way to find the origin, those are not useful anymore
    and just make the exception more cumbersome to use. The rule is now to
    only pass arguments that might help in recovering from the exception or
    provide information that is otherwise not easily accessible. (user: js, size: 2042) [annotate] [blame] [check-ins using]


/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFException.h"

@class OFXMLElement;

/*!
 * @brief An exception indicating an attempt to use an unbound namespace.
 */
@interface OFUnboundNamespaceException: OFException
{
	OFString *_namespace;
	OFXMLElement *_element;
}

#ifdef OF_HAVE_PROPERTIES
# ifdef __cplusplus
@property (readonly, copy, nonatomic, getter=namespace) OFString *namespace_;
# else
@property (readonly, copy, nonatomic) OFString *namespace;
# endif
@property (readonly, retain, nonatomic) OFXMLElement *element;
#endif

/*!
 * @brief Creates a new, autoreleased unbound namespace exception.
 *
 * @param namespace_ The namespace which is unbound
 * @param element The element in which the namespace was not bound
 * @return A new, autoreleased unbound namespace exception
 */
+ (instancetype)exceptionWithNamespace: (OFString*)namespace_
			       element: (OFXMLElement*)element;

/*!
 * @brief Initializes an already allocated unbound namespace exception.
 *
 * @param namespace_ The namespace which is unbound
 * @param element The element in which the namespace was not bound
 * @return An initialized unbound namespace exception
 */
- initWithNamespace: (OFString*)namespace_
	    element: (OFXMLElement*)element;

/*!
 * @brief Returns the unbound namespace.
 *
 * @return The unbound namespace
 */
- (OFString*)namespace;

/*!
 * @brief Returns the element in which the namespace was not bound.
 *
 * @return The element in which the namespace was not bound
 */
- (OFXMLElement*)element;
@end