Permalink
Browse files

Merge branch 'release-1.2'

  • Loading branch information...
2 parents 0fb49ea + d7376e3 commit 0e374403872628097dd7128fc9397d287d560d96 @mikeabdullah mikeabdullah committed Jul 23, 2011
Showing with 18 additions and 1 deletion.
  1. +5 −0 KSHTMLWriter.m
  2. +1 −0 KSXMLAttributes.h
  3. +5 −0 KSXMLAttributes.m
  4. +2 −1 KSXMLWriter.h
  5. +5 −0 KSXMLWriter.m
View
@@ -145,6 +145,11 @@ - (KSXMLAttributes *)currentAttributes;
return result;
}
+- (BOOL)hasCurrentAttributes;
+{
+ return ([super hasCurrentAttributes] || [_classNames count]);
+}
+
#pragma mark HTML Fragments
- (void)writeHTMLString:(NSString *)html;
View
@@ -18,6 +18,7 @@
- (id)initWithXMLAttributes:(KSXMLAttributes *)info;
@property(nonatomic, copy) NSDictionary *attributesAsDictionary;
+- (BOOL)hasAttributes;
- (void)addAttribute:(NSString *)attribute value:(id)value;
- (void)close; // removes all attributes
View
@@ -60,6 +60,11 @@ - (void)setAttributesAsDictionary:(NSDictionary *)dictionary;
}
}
+- (BOOL)hasAttributes;
+{
+ return [_attributes count];
+}
+
- (void)addAttribute:(NSString *)attribute value:(id)value;
{
NSParameterAssert(value);
View
@@ -113,7 +113,8 @@
* - Can sneak extra attributes in when using a convenience method (e.g. for HTML)
*/
- (void)pushAttribute:(NSString *)attribute value:(id)value;
-- (KSXMLAttributes *)currentAttributes; // modifying this object will not affect writing
+- (KSXMLAttributes *)currentAttributes; // modifying this object will not affect writing
+- (BOOL)hasCurrentAttributes; // faster than querying -currentAttributes
#pragma mark Attributes
View
@@ -273,6 +273,11 @@ - (KSXMLAttributes *)currentAttributes;
return result;
}
+- (BOOL)hasCurrentAttributes;
+{
+ return [_currentElement hasAttributes];
+}
+
#pragma mark Attributes
- (void)writeAttributeValue:(NSString *)value;

0 comments on commit 0e37440

Please sign in to comment.