Permalink
Browse files

Sister method: -[KSXMLWriter currentElementHasAttributes]

  • Loading branch information...
mikeabdullah committed Jul 23, 2011
1 parent 375a5b9 commit d7376e368d4b67fce45c66d79f0c38580906638f
Showing with 11 additions and 0 deletions.
  1. +5 −0 KSHTMLWriter.m
  2. +1 −0 KSXMLWriter.h
  3. +5 −0 KSXMLWriter.m
View
@@ -145,6 +145,11 @@ - (KSElementInfo *)currentElementInfo;
return result;
}
+- (BOOL)currentElementHasAttributes;
+{
+ return ([super currentElementHasAttributes] || [_classNames count]);
+}
+
#pragma mark HTML Fragments
- (void)writeHTMLString:(NSString *)html;
View
@@ -112,6 +112,7 @@
*/
- (void)pushAttribute:(NSString *)attribute value:(id)value;
- (KSElementInfo *)currentElementInfo; // modifying this object will not affect writing
+- (BOOL)currentElementHasAttributes; // faster than querying -currentElementInfo
#pragma mark Attributes
View
@@ -268,6 +268,11 @@ - (KSElementInfo *)currentElementInfo;
return result;
}
+- (BOOL)currentElementHasAttributes;
+{
+ return [_currentElement hasAttributes];
+}
+
#pragma mark Attributes
- (void)writeAttributeValue:(NSString *)value;

0 comments on commit d7376e3

Please sign in to comment.