Add a class for handling JIDs.
This commit is contained in:
parent
b64ae746e6
commit
6dc9e5e217
5 changed files with 200 additions and 4 deletions
60
src/XMPPJID.h
Normal file
60
src/XMPPJID.h
Normal file
|
@ -0,0 +1,60 @@
|
|||
#import <ObjFW/ObjFW.h>
|
||||
|
||||
/**
|
||||
* \brief A class for easy handling of JIDs
|
||||
*/
|
||||
@interface XMPPJID: OFObject
|
||||
{
|
||||
/**
|
||||
* The JID's localpart
|
||||
*/
|
||||
OFString *node;
|
||||
|
||||
/**
|
||||
* The JID's domainpart
|
||||
*/
|
||||
OFString *domain;
|
||||
|
||||
/**
|
||||
* The JID's resourcepart
|
||||
*/
|
||||
OFString *resource;
|
||||
}
|
||||
|
||||
@property (copy) OFString *node;
|
||||
@property (copy) OFString *domain;
|
||||
@property (copy) OFString *resource;
|
||||
|
||||
/**
|
||||
* Creates a new XMPPJID
|
||||
*
|
||||
* \return A new autoreleased XMPPJID
|
||||
*/
|
||||
+ JID;
|
||||
|
||||
/**
|
||||
* Creates a new XMPPJID from a OFString
|
||||
*
|
||||
* \param str The string to parse into a JID object
|
||||
* \return A new autoreleased XMPPJID
|
||||
*/
|
||||
+ JIDWithString: (OFString*)str;
|
||||
|
||||
/**
|
||||
* Initializes an already allocated XMPPJID using a OFString
|
||||
*
|
||||
* \param str The string to parse into a JID object
|
||||
* \return A initialized XMPPJID
|
||||
*/
|
||||
- initWithString: (OFString*)str;
|
||||
|
||||
/**
|
||||
* \return A OFString containing the bare JID
|
||||
*/
|
||||
- (OFString*)bareJID;
|
||||
|
||||
/**
|
||||
* \return A OFString containing the full JID
|
||||
*/
|
||||
- (OFString*)fullJID;
|
||||
@end
|
Loading…
Add table
Add a link
Reference in a new issue