Use instancetype.

This commit is contained in:
Jonathan Schleifer 2013-06-23 23:41:47 +02:00
parent 4fead04d9a
commit 9ae39edeb4
32 changed files with 153 additions and 153 deletions

View file

@ -39,12 +39,12 @@ typedef void (^xmpp_callback_block_t)(XMPPConnection*, XMPPIQ*);
}
#ifdef OF_HAVE_BLOCKS
+ callbackWithBlock: (xmpp_callback_block_t)callback;
+ (instancetype)callbackWithBlock: (xmpp_callback_block_t)callback;
- initWithBlock: (xmpp_callback_block_t)callback;
#endif
+ callbackWithTarget: (id)target
selector: (SEL)selector;
+ (instancetype)callbackWithTarget: (id)target
selector: (SEL)selector;
- initWithTarget: (id)target
selector: (SEL)selector;

View file

@ -28,7 +28,7 @@
@implementation XMPPCallback
#ifdef OF_HAVE_BLOCKS
+ callbackWithBlock: (xmpp_callback_block_t)block
+ (instancetype)callbackWithBlock: (xmpp_callback_block_t)block
{
return [[(XMPPCallback*)[self alloc] initWithBlock: block] autorelease];
}
@ -48,8 +48,8 @@
}
#endif
+ callbackWithTarget: (id)target
selector: (SEL)selector
+ (instancetype)callbackWithTarget: (id)target
selector: (SEL)selector
{
return [[[self alloc] initWithTarget: target
selector: selector] autorelease];

View file

@ -218,7 +218,7 @@
*
* \return A new autoreleased XMPPConnection
*/
+ connection;
+ (instancetype)connection;
/**
* \brief Adds the specified delegate.

View file

@ -117,7 +117,7 @@
@end
@implementation XMPPConnection
+ connection
+ (instancetype)connection
{
return [[[self alloc] init] autorelease];
}

View file

@ -58,7 +58,7 @@
* \param connection The XMPPConnection to serve responses on.
* \return A new autoreleased XMPPDiscoEntity
*/
+ discoEntityWithConnection: (XMPPConnection*)connection;
+ (instancetype)discoEntityWithConnection: (XMPPConnection*)connection;
/**
* \brief Creates a new autoreleased XMPPDiscoEntity with the specified
@ -68,8 +68,8 @@
* \param capsNode The node advertised for the entity's capabilites
* \return A new autoreleased XMPPDiscoEntity
*/
+ discoEntityWithConnection: (XMPPConnection*)connection
capsNode: (OFString*)capsNode;
+ (instancetype)discoEntityWithConnection: (XMPPConnection*)connection
capsNode: (OFString*)capsNode;
/**
* \brief Initializes an already allocated XMPPDiscoEntity with the specified

View file

@ -26,13 +26,13 @@
#import "namespaces.h"
@implementation XMPPDiscoEntity
+ discoEntityWithConnection: (XMPPConnection*)connection
+ (instancetype)discoEntityWithConnection: (XMPPConnection*)connection
{
return [[[self alloc] initWithConnection: connection] autorelease];
}
+ discoEntityWithConnection: (XMPPConnection*)connection
capsNode: (OFString*)capsNode
+ (instancetype)discoEntityWithConnection: (XMPPConnection*)connection
capsNode: (OFString*)capsNode
{
return [[[self alloc] initWithConnection: connection
capsNode: capsNode] autorelease];

View file

@ -47,9 +47,9 @@
* \param name The name of the identity
* \return A new autoreleased XMPPDiscoIdentity
*/
+ identityWithCategory: (OFString*)category
type: (OFString*)type
name: (OFString*)name;
+ (instancetype)identityWithCategory: (OFString*)category
type: (OFString*)type
name: (OFString*)name;
/**
* \brief Creates a new autoreleased XMPPDiscoIdentity with the specified
@ -59,8 +59,8 @@
* \param type The type of the identity
* \return A new autoreleased XMPPDiscoIdentity
*/
+ identityWithCategory: (OFString*)category
type: (OFString*)type;
+ (instancetype)identityWithCategory: (OFString*)category
type: (OFString*)type;
/**
* \brief Initializes an already allocated XMPPDiscoIdentity with the specified

View file

@ -23,17 +23,17 @@
#import "XMPPDiscoIdentity.h"
@implementation XMPPDiscoIdentity
+ identityWithCategory: (OFString*)category
type: (OFString*)type
name: (OFString*)name
+ (instancetype)identityWithCategory: (OFString*)category
type: (OFString*)type
name: (OFString*)name
{
return [[[self alloc] initWithCategory: category
type: type
name: name] autorelease];
}
+ identityWithCategory: (OFString*)category
type: (OFString*)type
+ (instancetype)identityWithCategory: (OFString*)category
type: (OFString*)type
{
return [[[self alloc] initWithCategory: category
type: type] autorelease];

View file

@ -61,8 +61,8 @@
* \param node The node's opaque name
* \return A new autoreleased XMPPDiscoNode
*/
+ discoNodeWithJID: (XMPPJID*)JID
node: (OFString*)node;
+ (instancetype)discoNodeWithJID: (XMPPJID*)JID
node: (OFString*)node;
/**
* \brief Creates a new autoreleased XMPPDiscoNode with the specified
@ -73,8 +73,8 @@
* \param name The node's human friendly name
* \return A new autoreleased XMPPDiscoNode
*/
+ discoNodeWithJID: (XMPPJID*)JID
node: (OFString*)node
+ (instancetype)discoNodeWithJID: (XMPPJID*)JID
node: (OFString*)node
name: (OFString*)name;
/**

View file

@ -28,17 +28,17 @@
#import "namespaces.h"
@implementation XMPPDiscoNode
+ discoNodeWithJID: (XMPPJID*)JID
node: (OFString*)node;
+ (instancetype)discoNodeWithJID: (XMPPJID*)JID
node: (OFString*)node;
{
return [[[self alloc] initWithJID: JID
node: node] autorelease];
}
+ discoNodeWithJID: (XMPPJID*)JID
node: (OFString*)node
name: (OFString*)name
+ (instancetype)discoNodeWithJID: (XMPPJID*)JID
node: (OFString*)node
name: (OFString*)name
{
return [[[self alloc] initWithJID: JID
node: node

View file

@ -32,7 +32,7 @@
*
* \return A new autoreleased XMPPEXTERNALAuth
*/
+ EXTERNALAuth;
+ (instancetype)EXTERNALAuth;
/**
* \brief Creates a new autoreleased XMPPEXTERNALAuth with an authzid.
@ -40,5 +40,5 @@
* \param authzid The authzid to get authorization for
* \return A new autoreleased XMPPEXTERNALAuth
*/
+ EXTERNALAuthWithAuthzid: (OFString*)authzid;
+ (instancetype)EXTERNALAuthWithAuthzid: (OFString*)authzid;
@end

View file

@ -27,13 +27,13 @@
#import "XMPPEXTERNALAuth.h"
@implementation XMPPEXTERNALAuth: XMPPAuthenticator
+ EXTERNALAuth
+ (instancetype)EXTERNALAuth
{
return [[[self alloc] initWithAuthcid: nil
password: nil] autorelease];
}
+ EXTERNALAuthWithAuthzid: (OFString*)authzid
+ (instancetype)EXTERNALAuthWithAuthzid: (OFString*)authzid
{
return [[[self alloc] initWithAuthzid: authzid
authcid: nil

View file

@ -45,7 +45,7 @@
* for this exception
* \return A new XMPPException
*/
+ exceptionWithConnection: (XMPPConnection*)connection;
+ (instancetype)exceptionWithConnection: (XMPPConnection*)connection;
/**
* \brief Initializes an already allocated XMPPException.
@ -82,9 +82,9 @@
* \param reason The descriptive free-form text specified by the stream error
* \return A new XMPPStreamErrorException
*/
+ exceptionWithConnection: (XMPPConnection*)connection
condition: (OFString*)condition
reason: (OFString*)reason;
+ (instancetype)exceptionWithConnection: (XMPPConnection*)connection
condition: (OFString*)condition
reason: (OFString*)reason;
/**
* \brief Initializes an already allocated XMPPStreamErrorException.
@ -126,9 +126,9 @@
* \param string The string that failed the stringprep profile
* \return A new XMPPStringPrepFailedException
*/
+ exceptionWithConnection: (XMPPConnection*)connection
profile: (OFString*)profile
string: (OFString*)string;
+ (instancetype)exceptionWithConnection: (XMPPConnection*)connection
profile: (OFString*)profile
string: (OFString*)string;
/**
* \brief Initializes an already allocated XMPPStringPrepFailedException.
@ -169,9 +169,9 @@
* \param string The string that could not be translated
* \return A new XMPPIDNATranslationFailedException
*/
+ exceptionWithConnection: (XMPPConnection*)connection
operation: (OFString*)operation
string: (OFString*)string;
+ (instancetype)exceptionWithConnection: (XMPPConnection*)connection
operation: (OFString*)operation
string: (OFString*)string;
/**
* \brief Initializes an already allocated XMPPIDNATranslationFailedException.
@ -209,8 +209,8 @@
* \param reason The reason the authentication failed
* \return A new XMPPAuthFailedException
*/
+ exceptionWithConnection: (XMPPConnection*)connection
reason: (OFString*)reason;
+ (instancetype)exceptionWithConnection: (XMPPConnection*)connection
reason: (OFString*)reason;
/**
* \brief Initializes an already allocated XMPPAuthFailedException.

View file

@ -30,7 +30,7 @@
#import "XMPPConnection.h"
@implementation XMPPException
+ exceptionWithConnection: (XMPPConnection*)connection
+ (instancetype)exceptionWithConnection: (XMPPConnection*)connection
{
return [[[self alloc] initWithConnection: connection] autorelease];
}
@ -75,9 +75,9 @@
@end
@implementation XMPPStreamErrorException
+ exceptionWithConnection: (XMPPConnection*)connection
condition: (OFString*)condition
reason: (OFString*)reason;
+ (instancetype)exceptionWithConnection: (XMPPConnection*)connection
condition: (OFString*)condition
reason: (OFString*)reason;
{
return [[[self alloc] initWithConnection: connection
condition: condition
@ -139,9 +139,9 @@
@end
@implementation XMPPStringPrepFailedException
+ exceptionWithConnection: (XMPPConnection*)connection
profile: (OFString*)profile
string: (OFString*)string
+ (instancetype)exceptionWithConnection: (XMPPConnection*)connection
profile: (OFString*)profile
string: (OFString*)string
{
return [[[self alloc] initWithConnection: connection
profile: profile
@ -204,9 +204,9 @@
@end
@implementation XMPPIDNATranslationFailedException
+ exceptionWithConnection: (XMPPConnection*)connection
operation: (OFString*)operation
string: (OFString*)string
+ (instancetype)exceptionWithConnection: (XMPPConnection*)connection
operation: (OFString*)operation
string: (OFString*)string
{
return [[[self alloc] initWithConnection: connection
operation: operation
@ -268,8 +268,8 @@
@end
@implementation XMPPAuthFailedException
+ exceptionWithConnection: (XMPPConnection*)connection
reason: (OFString*)reason;
+ (instancetype)exceptionWithConnection: (XMPPConnection*)connection
reason: (OFString*)reason;
{
return [[[self alloc] initWithConnection: connection
reason: reason] autorelease];

View file

@ -34,8 +34,8 @@
* \param ID The value for the stanza's id attribute
* \return A new autoreleased XMPPIQ
*/
+ IQWithType: (OFString*)type
ID: (OFString*)ID;
+ (instancetype)IQWithType: (OFString*)type
ID: (OFString*)ID;
/**
* \brief Initializes an already allocated XMPPIQ with the specified type and

View file

@ -29,8 +29,8 @@
#import "XMPPIQ.h"
@implementation XMPPIQ
+ IQWithType: (OFString*)type
ID: (OFString*)ID
+ (instancetype)IQWithType: (OFString*)type
ID: (OFString*)ID
{
return [[[self alloc] initWithType: type
ID: ID] autorelease];

View file

@ -45,7 +45,7 @@
*
* \return A new autoreleased XMPPJID
*/
+ JID;
+ (instancetype)JID;
/**
* \brief Creates a new autoreleased XMPPJID from a string.
@ -53,7 +53,7 @@
* \param string The string to parse into a JID object
* \return A new autoreleased XMPPJID
*/
+ JIDWithString: (OFString*)string;
+ (instancetype)JIDWithString: (OFString*)string;
/**
* \brief Initializes an already allocated XMPPJID with a string.

View file

@ -33,12 +33,12 @@
#import "XMPPExceptions.h"
@implementation XMPPJID
+ JID
+ (instancetype)JID
{
return [[[self alloc] init] autorelease];
}
+ JIDWithString: (OFString*)string
+ (instancetype)JIDWithString: (OFString*)string
{
return [[[self alloc] initWithString: string] autorelease];
}

View file

@ -37,7 +37,7 @@
*
* \return A new autoreleased XMPPMessage
*/
+ message;
+ (instancetype)message;
/**
* \brief Creates a new autoreleased XMPPMessage with the specified ID.
@ -45,7 +45,7 @@
* \param ID The value for the stanza's id attribute
* \return A new autoreleased XMPPMessage
*/
+ messageWithID: (OFString*)ID;
+ (instancetype)messageWithID: (OFString*)ID;
/**
* \brief Creates a new autoreleased XMPPMessage with the specified type.
@ -53,7 +53,7 @@
* \param type The value for the stanza's type attribute
* \return A new autoreleased XMPPMessage
*/
+ messageWithType: (OFString*)type;
+ (instancetype)messageWithType: (OFString*)type;
/**
* \brief Creates a new autoreleased XMPPMessage with the specified type and ID.
@ -62,8 +62,8 @@
* \param ID The value for the stanza's id attribute
* \return A new autoreleased XMPPMessage
*/
+ messageWithType: (OFString*)type
ID: (OFString*)ID;
+ (instancetype)messageWithType: (OFString*)type
ID: (OFString*)ID;
/**
* \brief Initializes an already allocated XMPPMessage with the specified ID.

View file

@ -29,22 +29,22 @@
#import "namespaces.h"
@implementation XMPPMessage
+ message
+ (instancetype)message
{
return [[[self alloc] init] autorelease];
}
+ messageWithID: (OFString*)ID
+ (instancetype)messageWithID: (OFString*)ID
{
return [[[self alloc] initWithID: ID] autorelease];
}
+ messageWithType: (OFString*)type
+ (instancetype)messageWithType: (OFString*)type
{
return [[[self alloc] initWithType: type] autorelease];
}
+ messageWithType: (OFString*)type
+ (instancetype)messageWithType: (OFString*)type
ID: (OFString*)ID
{
return [[[self alloc] initWithType: type

View file

@ -34,8 +34,8 @@
* \param password The password to authenticate with
* \return A new autoreleased XMPPPLAINAuth
*/
+ PLAINAuthWithAuthcid: (OFString*)authcid
password: (OFString*)password;
+ (instancetype)PLAINAuthWithAuthcid: (OFString*)authcid
password: (OFString*)password;
/**
* \brief Creates a new autoreleased XMPPPLAINAuth with an authzid, authcid and
@ -46,7 +46,7 @@
* \param password The password to authenticate with
* \return A new autoreleased XMPPPLAINAuth
*/
+ PLAINAuthWithAuthzid: (OFString*)authzid
authcid: (OFString*)authcid
+ (instancetype)PLAINAuthWithAuthzid: (OFString*)authzid
authcid: (OFString*)authcid
password: (OFString*)password;
@end

View file

@ -28,16 +28,16 @@
#import "XMPPExceptions.h"
@implementation XMPPPLAINAuth
+ PLAINAuthWithAuthcid: (OFString*)authcid
password: (OFString*)password
+ (instancetype)PLAINAuthWithAuthcid: (OFString*)authcid
password: (OFString*)password
{
return [[[self alloc] initWithAuthcid: authcid
password: password] autorelease];
}
+ PLAINAuthWithAuthzid: (OFString*)authzid
authcid: (OFString*)authcid
password: (OFString*)password
+ (instancetype)PLAINAuthWithAuthzid: (OFString*)authzid
authcid: (OFString*)authcid
password: (OFString*)password
{
return [[[self alloc] initWithAuthzid: authzid
authcid: authcid

View file

@ -42,7 +42,7 @@
*
* \return A new autoreleased XMPPPresence
*/
+ presence;
+ (instancetype)presence;
/**
* \brief Creates a new autoreleased XMPPPresence with the specified ID.
@ -50,7 +50,7 @@
* \param ID The value for the stanza's id attribute
* \return A new autoreleased XMPPPresence
*/
+ presenceWithID: (OFString*)ID;
+ (instancetype)presenceWithID: (OFString*)ID;
/**
* \brief Creates a new autoreleased XMPPPresence with the specified type.
@ -58,7 +58,7 @@
* \param type The value for the stanza's type attribute
* \return A new autoreleased XMPPPresence
*/
+ presenceWithType: (OFString*)type;
+ (instancetype)presenceWithType: (OFString*)type;
/**
* \brief Creates a new autoreleased XMPPPresence with the specified type and
@ -68,8 +68,8 @@
* \param ID The value for the stanza's id attribute
* \return A new autoreleased XMPPPresence
*/
+ presenceWithType: (OFString*)type
ID: (OFString*)ID;
+ (instancetype)presenceWithType: (OFString*)type
ID: (OFString*)ID;
/**
* \brief Initializes an already allocated XMPPPresence with the specified ID.

View file

@ -43,23 +43,23 @@ static int show_to_int(OFString *show)
}
@implementation XMPPPresence
+ presence
+ (instancetype)presence
{
return [[[self alloc] init] autorelease];
}
+ presenceWithID: (OFString*)ID
+ (instancetype)presenceWithID: (OFString*)ID
{
return [[[self alloc] initWithID: ID] autorelease];
}
+ presenceWithType: (OFString*)type
+ (instancetype)presenceWithType: (OFString*)type
{
return [[[self alloc] initWithType: type] autorelease];
}
+ presenceWithType: (OFString*)type
ID: (OFString*)ID
+ (instancetype)presenceWithType: (OFString*)type
ID: (OFString*)ID
{
return [[[self alloc] initWithType: type
ID: ID] autorelease];

View file

@ -51,7 +51,7 @@
*
* \return A new autoreleased roster item.
*/
+ rosterItem;
+ (instancetype)rosterItem;
- (void)setJID: (XMPPJID*)JID;
- (XMPPJID*)JID;

View file

@ -30,7 +30,7 @@
#import <ObjFW/macros.h>
@implementation XMPPRosterItem
+ rosterItem
+ (instancetype)rosterItem
{
return [[[self alloc] init] autorelease];
}

View file

@ -49,11 +49,11 @@
* \param plusAvailable Whether the PLUS variant was offered
* \return A new autoreleased XMPPSCRAMAuth
*/
+ SCRAMAuthWithAuthcid: (OFString*)authcid
password: (OFString*)password
connection: (XMPPConnection*)connection
hash: (Class)hash
plusAvailable: (bool)plusAvailable;
+ (instancetype)SCRAMAuthWithAuthcid: (OFString*)authcid
password: (OFString*)password
connection: (XMPPConnection*)connection
hash: (Class)hash
plusAvailable: (bool)plusAvailable;
/**
* \brief Creates a new autoreleased XMPPSCRAMAuth with an authzid, authcid and
@ -67,12 +67,12 @@
* \param plusAvailable Whether the PLUS variant was offered
* \return A new autoreleased XMPPSCRAMAuth
*/
+ SCRAMAuthWithAuthzid: (OFString*)authzid
authcid: (OFString*)authcid
password: (OFString*)password
connection: (XMPPConnection*)connection
hash: (Class)hash
plusAvailable: (bool)plusAvailable;
+ (instancetype)SCRAMAuthWithAuthzid: (OFString*)authzid
authcid: (OFString*)authcid
password: (OFString*)password
connection: (XMPPConnection*)connection
hash: (Class)hash
plusAvailable: (bool)plusAvailable;
/**
* \brief Initializes an already allocated XMPPSCRAMAuth with an authcid and

View file

@ -38,11 +38,11 @@
#define HMAC_OPAD 0x5c
@implementation XMPPSCRAMAuth
+ SCRAMAuthWithAuthcid: (OFString*)authcid
password: (OFString*)password
connection: (XMPPConnection*)connection
hash: (Class)hash
plusAvailable: (bool)plusAvailable
+ (instancetype)SCRAMAuthWithAuthcid: (OFString*)authcid
password: (OFString*)password
connection: (XMPPConnection*)connection
hash: (Class)hash
plusAvailable: (bool)plusAvailable
{
return [[[self alloc] initWithAuthcid: authcid
password: password
@ -51,12 +51,12 @@
plusAvailable: plusAvailable] autorelease];
}
+ SCRAMAuthWithAuthzid: (OFString*)authzid
authcid: (OFString*)authcid
password: (OFString*)password
connection: (XMPPConnection*)connection
hash: (Class)hash
plusAvailable: (bool)plusAvailable
+ (instancetype)SCRAMAuthWithAuthzid: (OFString*)authzid
authcid: (OFString*)authcid
password: (OFString*)password
connection: (XMPPConnection*)connection
hash: (Class)hash
plusAvailable: (bool)plusAvailable
{
return [[[self alloc] initWithAuthzid: authzid
authcid: authcid

View file

@ -43,12 +43,12 @@
@property (readonly, copy) OFString *target;
#endif
+ entryWithPriority: (uint16_t)priority
weight: (uint16_t)weight
port: (uint16_t)port
target: (OFString*)target;
+ entryWithResourceRecord: (ns_rr)resourceRecord
handle: (ns_msg)handle;
+ (instancetype)entryWithPriority: (uint16_t)priority
weight: (uint16_t)weight
port: (uint16_t)port
target: (OFString*)target;
+ (instancetype)entryWithResourceRecord: (ns_rr)resourceRecord
handle: (ns_msg)handle;
- initWithPriority: (uint16_t)priority
weight: (uint16_t)weight
port: (uint16_t)port
@ -74,7 +74,7 @@
@property (readonly, copy) OFString *domain;
#endif
+ lookupWithDomain: (OFString*)domain;
+ (instancetype)lookupWithDomain: (OFString*)domain;
- initWithDomain: (OFString*)domain;
- (void)XMPP_lookup;

View file

@ -37,10 +37,10 @@
#import "XMPPSRVLookup.h"
@implementation XMPPSRVEntry
+ entryWithPriority: (uint16_t)priority
weight: (uint16_t)weight
port: (uint16_t)port
target: (OFString*)target
+ (instancetype)entryWithPriority: (uint16_t)priority
weight: (uint16_t)weight
port: (uint16_t)port
target: (OFString*)target
{
return [[[self alloc] initWithPriority: priority
weight: weight
@ -48,8 +48,8 @@
target: target] autorelease];
}
+ entryWithResourceRecord: (ns_rr)resourceRecord
handle: (ns_msg)handle
+ (instancetype)entryWithResourceRecord: (ns_rr)resourceRecord
handle: (ns_msg)handle
{
return [[[self alloc] initWithResourceRecord: resourceRecord
handle: handle] autorelease];
@ -163,7 +163,7 @@
@end
@implementation XMPPSRVLookup
+ lookupWithDomain: (OFString*)domain
+ (instancetype)lookupWithDomain: (OFString*)domain
{
return [[[self alloc] initWithDomain: domain] autorelease];
}

View file

@ -52,7 +52,7 @@
* \param name The stanza's name (one of iq, message or presence)
* \return A new autoreleased XMPPStanza
*/
+ stanzaWithName: (OFString*)name;
+ (instancetype)stanzaWithName: (OFString*)name;
/**
* \brief Creates a new autoreleased XMPPStanza with the specified name and
@ -62,8 +62,8 @@
* \param type The value for the stanza's type attribute
* \return A new autoreleased XMPPStanza
*/
+ stanzaWithName: (OFString*)name
type: (OFString*)type;
+ (instancetype)stanzaWithName: (OFString*)name
type: (OFString*)type;
/**
* \brief Creates a new autoreleased XMPPStanza with the specified name and ID.
@ -72,8 +72,8 @@
* \param ID The value for the stanza's id attribute
* \return A new autoreleased XMPPStanza
*/
+ stanzaWithName: (OFString*)name
ID: (OFString*)ID;
+ (instancetype)stanzaWithName: (OFString*)name
ID: (OFString*)ID;
/**
* \brief Creates a new autoreleased XMPPStanza with the specified name, type
@ -84,9 +84,9 @@
* \param ID The value for the stanza's id attribute
* \return A new autoreleased XMPPStanza
*/
+ stanzaWithName: (OFString*)name
type: (OFString*)type
ID: (OFString*)ID;
+ (instancetype)stanzaWithName: (OFString*)name
type: (OFString*)type
ID: (OFString*)ID;
/**
* \brief Creates a new autoreleased XMPPStanza from an OFXMLElement.
@ -94,7 +94,7 @@
* \param element The element to base the XMPPStanza on
* \return A new autoreleased XMPPStanza
*/
+ stanzaWithElement: (OFXMLElement*)element;
+ (instancetype)stanzaWithElement: (OFXMLElement*)element;
/**
* \brief Initializes an already allocated XMPPStanza with the specified name.

View file

@ -30,35 +30,35 @@
#import "namespaces.h"
@implementation XMPPStanza
+ stanzaWithName: (OFString*)name
+ (instancetype)stanzaWithName: (OFString*)name
{
return [[[self alloc] initWithName: name] autorelease];
}
+ stanzaWithName: (OFString*)name
type: (OFString*)type
+ (instancetype)stanzaWithName: (OFString*)name
type: (OFString*)type
{
return [[[self alloc] initWithName: name
type: type] autorelease];
}
+ stanzaWithName: (OFString*)name
ID: (OFString*)ID
+ (instancetype)stanzaWithName: (OFString*)name
ID: (OFString*)ID
{
return [[[self alloc] initWithName: name
ID: ID] autorelease];
}
+ stanzaWithName: (OFString*)name
type: (OFString*)type
ID: (OFString*)ID
+ (instancetype)stanzaWithName: (OFString*)name
type: (OFString*)type
ID: (OFString*)ID
{
return [[[self alloc] initWithName: name
type: type
ID: ID] autorelease];
}
+ stanzaWithElement: (OFXMLElement*)element
+ (instancetype)stanzaWithElement: (OFXMLElement*)element
{
return [[[self alloc] initWithElement: element] autorelease];
}