Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 121 lines (95 sloc) 4.191 kb
a6f5816 Robbie Hanson Adding iPhone support
authored
1 #import <Foundation/Foundation.h>
7218639 Robbie Hanson Version 2.0 of the XMPPFramework
authored
2
3 #if TARGET_OS_IPHONE
4 #import "DDXML.h"
5 #endif
6
b1184eb Robbie Hanson Added XMPPClient class, which gives a lightweight wrapper around XMPPStr...
authored
7
fcef3d8 Robbie Hanson Switching to standard naming convention for categories. This prevents a ...
authored
8 @interface NSXMLElement (XMPP)
b1184eb Robbie Hanson Added XMPPClient class, which gives a lightweight wrapper around XMPPStr...
authored
9
6d2f106 Robbie Hanson Adding several more convenience methods to the categories.
authored
10 /**
11 * Creating elements with explicit xmlns values.
12 *
13 * Use these instead of [NSXMLElement initWithName:URI:].
14 * The category methods below are more readable, and they actually work.
15 **/
16
506bdf1 Robbie Hanson NSXML doesn't output the default namespace (via XMLString) if it was set...
authored
17 + (NSXMLElement *)elementWithName:(NSString *)name xmlns:(NSString *)ns;
33c48dd Robbie Hanson [NSXMLElementAdditions] Adding initWithName:xmlns: (An autoreleased ver...
authored
18 - (id)initWithName:(NSString *)name xmlns:(NSString *)ns;
9b681c4 Robbie Hanson Adding new NSXMLElement category methods from Shaun Harrison. Taking adv...
authored
19
6d2f106 Robbie Hanson Adding several more convenience methods to the categories.
authored
20 /**
4421f3a Robbie Hanson Adding category for XEP-0085 : Chat states
authored
21 * Extracting multiple elements.
22 **/
23
24 - (NSArray *)elementsForXmlns:(NSString *)ns;
25
26 /**
6d2f106 Robbie Hanson Adding several more convenience methods to the categories.
authored
27 * Extracting a single element.
28 **/
29
b1184eb Robbie Hanson Added XMPPClient class, which gives a lightweight wrapper around XMPPStr...
authored
30 - (NSXMLElement *)elementForName:(NSString *)name;
31 - (NSXMLElement *)elementForName:(NSString *)name xmlns:(NSString *)xmlns;
506bdf1 Robbie Hanson NSXML doesn't output the default namespace (via XMLString) if it was set...
authored
32
6d2f106 Robbie Hanson Adding several more convenience methods to the categories.
authored
33 /**
34 * Working with the common xmpp xmlns value.
35 *
36 * Use these instead of getting/setting the URI.
37 * The category methods below are more readable, and they actually work.
38 **/
39
b1184eb Robbie Hanson Added XMPPClient class, which gives a lightweight wrapper around XMPPStr...
authored
40 - (NSString *)xmlns;
506bdf1 Robbie Hanson NSXML doesn't output the default namespace (via XMLString) if it was set...
authored
41 - (void)setXmlns:(NSString *)ns;
42
6d2f106 Robbie Hanson Adding several more convenience methods to the categories.
authored
43 /**
44 * Convenience methods for printing xml elements with different styles.
45 **/
46
6bc99da Robbie Hanson Adding convenience method to "pretty print" an XML element.
authored
47 - (NSString *)prettyXMLString;
d66361c Robbie Hanson Now sending elements using the compact form to shave bytes.
authored
48 - (NSString *)compactXMLString;
49
6d2f106 Robbie Hanson Adding several more convenience methods to the categories.
authored
50 /**
51 * Convenience methods for adding attributes.
52 **/
53
97a430b Robbie Hanson Adding a bit of support for XEP-100 (thanks to Shaun Harrison)
authored
54 - (void)addAttributeWithName:(NSString *)name stringValue:(NSString *)string;
b2900ea Robbie Hanson Switching to the new protocol/optional syntax, away from the old categor...
authored
55
6d2f106 Robbie Hanson Adding several more convenience methods to the categories.
authored
56 /**
57 * Convenience methods for extracting attribute values in different formats.
58 *
59 * E.g. <beer name="guinness" price="4.50"/> // float price = [beer attributeFloatValueForName:@"price"];
60 **/
61
b2900ea Robbie Hanson Switching to the new protocol/optional syntax, away from the old categor...
authored
62 - (int)attributeIntValueForName:(NSString *)name;
63 - (BOOL)attributeBoolValueForName:(NSString *)name;
64 - (float)attributeFloatValueForName:(NSString *)name;
65 - (double)attributeDoubleValueForName:(NSString *)name;
6d2f106 Robbie Hanson Adding several more convenience methods to the categories.
authored
66 - (int32_t)attributeInt32ValueForName:(NSString *)name;
67 - (uint32_t)attributeUInt32ValueForName:(NSString *)name;
68 - (int64_t)attributeInt64ValueForName:(NSString *)name;
69 - (uint64_t)attributeUInt64ValueForName:(NSString *)name;
70 - (NSInteger)attributeIntegerValueForName:(NSString *)name;
71 - (NSUInteger)attributeUnsignedIntegerValueForName:(NSString *)name;
b2900ea Robbie Hanson Switching to the new protocol/optional syntax, away from the old categor...
authored
72 - (NSString *)attributeStringValueForName:(NSString *)name;
a5c6c23 Robbie Hanson A bit of code cleanup. Added some new element creation methods to XMPPI...
authored
73 - (NSNumber *)attributeNumberIntValueForName:(NSString *)name;
74 - (NSNumber *)attributeNumberBoolValueForName:(NSString *)name;
6d2f106 Robbie Hanson Adding several more convenience methods to the categories.
authored
75 - (NSNumber *)attributeNumberFloatValueForName:(NSString *)name;
76 - (NSNumber *)attributeNumberDoubleValueForName:(NSString *)name;
77 - (NSNumber *)attributeNumberInt32ValueForName:(NSString *)name;
78 - (NSNumber *)attributeNumberUInt32ValueForName:(NSString *)name;
79 - (NSNumber *)attributeNumberInt64ValueForName:(NSString *)name;
80 - (NSNumber *)attributeNumberUInt64ValueForName:(NSString *)name;
81 - (NSNumber *)attributeNumberIntegerValueForName:(NSString *)name;
82 - (NSNumber *)attributeNumberUnsignedIntegerValueForName:(NSString *)name;
b2900ea Robbie Hanson Switching to the new protocol/optional syntax, away from the old categor...
authored
83
84 - (int)attributeIntValueForName:(NSString *)name withDefaultValue:(int)defaultValue;
85 - (BOOL)attributeBoolValueForName:(NSString *)name withDefaultValue:(BOOL)defaultValue;
86 - (float)attributeFloatValueForName:(NSString *)name withDefaultValue:(float)defaultValue;
87 - (double)attributeDoubleValueForName:(NSString *)name withDefaultValue:(double)defaultValue;
88 - (NSString *)attributeStringValueForName:(NSString *)name withDefaultValue:(NSString *)defaultValue;
a5c6c23 Robbie Hanson A bit of code cleanup. Added some new element creation methods to XMPPI...
authored
89 - (NSNumber *)attributeNumberIntValueForName:(NSString *)name withDefaultValue:(int)defaultValue;
90 - (NSNumber *)attributeNumberBoolValueForName:(NSString *)name withDefaultValue:(BOOL)defaultValue;
b2900ea Robbie Hanson Switching to the new protocol/optional syntax, away from the old categor...
authored
91
0b818f7 Robbie Hanson The attributesAsDictionary method now returns a mutable dictionary. It d...
authored
92 - (NSMutableDictionary *)attributesAsDictionary;
b1184eb Robbie Hanson Added XMPPClient class, which gives a lightweight wrapper around XMPPStr...
authored
93
6d2f106 Robbie Hanson Adding several more convenience methods to the categories.
authored
94 /**
95 * Convenience methods for extracting element values in different formats.
96 *
97 * E.g. <price>9.99</price> // float price = [priceElement stringValueAsFloat];
98 **/
99
100 - (int)stringValueAsInt;
101 - (BOOL)stringValueAsBool;
102 - (float)stringValueAsFloat;
103 - (double)stringValueAsDouble;
104 - (int32_t)stringValueAsInt32;
105 - (uint32_t)stringValueAsUInt32;
106 - (int64_t)stringValueAsInt64;
107 - (uint64_t)stringValueAsUInt64;
108 - (NSInteger)stringValueAsNSInteger;
109 - (NSUInteger)stringValueAsNSUInteger;
110
111 /**
112 * Working with namespaces.
113 **/
114
7218639 Robbie Hanson Version 2.0 of the XMPPFramework
authored
115 - (void)addNamespaceWithPrefix:(NSString *)prefix stringValue:(NSString *)string;
116
117 - (NSString *)namespaceStringValueForPrefix:(NSString *)prefix;
118 - (NSString *)namespaceStringValueForPrefix:(NSString *)prefix withDefaultValue:(NSString *)defaultValue;
119
b1184eb Robbie Hanson Added XMPPClient class, which gives a lightweight wrapper around XMPPStr...
authored
120 @end
Something went wrong with that request. Please try again.