Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Sister method: -[KSXMLWriter currentElementHasAttributes]

  • Loading branch information...
commit d7376e368d4b67fce45c66d79f0c38580906638f 1 parent 375a5b9
@mikeabdullah mikeabdullah authored
Showing with 11 additions and 0 deletions.
  1. +5 −0 KSHTMLWriter.m
  2. +1 −0  KSXMLWriter.h
  3. +5 −0 KSXMLWriter.m
View
5 KSHTMLWriter.m
@@ -145,6 +145,11 @@ - (KSElementInfo *)currentElementInfo;
return result;
}
+- (BOOL)currentElementHasAttributes;
+{
+ return ([super currentElementHasAttributes] || [_classNames count]);
+}
+
#pragma mark HTML Fragments
- (void)writeHTMLString:(NSString *)html;
View
1  KSXMLWriter.h
@@ -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
5 KSXMLWriter.m
@@ -268,6 +268,11 @@ - (KSElementInfo *)currentElementInfo;
return result;
}
+- (BOOL)currentElementHasAttributes;
+{
+ return [_currentElement hasAttributes];
+}
+
#pragma mark Attributes
- (void)writeAttributeValue:(NSString *)value;
Please sign in to comment.
Something went wrong with that request. Please try again.