Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improving DDXML.h file by adding optional NSXML prefix on iOS, and ad…

…ding safety net for DDXML_DEBUG_MEMORY_ISSUES definition.
  • Loading branch information...
commit 0044ccd016fe63e3403bda742e76d36c7a7bb687 1 parent 106081e
@robbiehanson authored
Showing with 81 additions and 1 deletion.
  1. +81 −1 KissXML/DDXML.h
View
82 KissXML/DDXML.h
@@ -21,6 +21,82 @@
#import "DDXMLDocument.h"
+
+#if TARGET_OS_IPHONE && 0 // Disabled by default
+
+// Since KissXML is a drop in replacement for NSXML,
+// it may be desireable (when writing cross-platform code to be used on both Mac OS X and iOS)
+// to use the NSXML prefixes instead of the DDXML prefix.
+//
+// This way, on Mac OS X it uses NSXML, and on iOS it uses KissXML.
+
+#ifndef NSXMLNode
+ #define NSXMLNode DDXMLNode
+#endif
+#ifndef NSXMLElement
+ #define NSXMLElement DDXMLElement
+#endif
+#ifndef NSXMLDocument
+ #define NSXMLDocument DDXMLDocument
+#endif
+
+#ifndef NSXMLInvalidKind
+ #define NSXMLInvalidKind DDXMLInvalidKind
+#endif
+#ifndef NSXMLDocumentKind
+ #define NSXMLDocumentKind DDXMLDocumentKind
+#endif
+#ifndef NSXMLElementKind
+ #define NSXMLElementKind DDXMLElementKind
+#endif
+#ifndef NSXMLAttributeKind
+ #define NSXMLAttributeKind DDXMLAttributeKind
+#endif
+#ifndef NSXMLNamespaceKind
+ #define NSXMLNamespaceKind DDXMLNamespaceKind
+#endif
+#ifndef NSXMLProcessingInstructionKind
+ #define NSXMLProcessingInstructionKind DDXMLProcessingInstructionKind
+#endif
+#ifndef NSXMLCommentKind
+ #define NSXMLCommentKind DDXMLCommentKind
+#endif
+#ifndef NSXMLTextKind
+ #define NSXMLTextKind DDXMLTextKind
+#endif
+#ifndef NSXMLDTDKind
+ #define NSXMLDTDKind DDXMLDTDKind
+#endif
+#ifndef NSXMLEntityDeclarationKind
+ #define NSXMLEntityDeclarationKind DDXMLEntityDeclarationKind
+#endif
+#ifndef NSXMLAttributeDeclarationKind
+ #define NSXMLAttributeDeclarationKind DDXMLAttributeDeclarationKind
+#endif
+#ifndef NSXMLElementDeclarationKind
+ #define NSXMLElementDeclarationKind DDXMLElementDeclarationKind
+#endif
+#ifndef NSXMLNotationDeclarationKind
+ #define NSXMLNotationDeclarationKind DDXMLNotationDeclarationKind
+#endif
+
+#ifndef NSXMLNodeOptionsNone
+ #define NSXMLNodeOptionsNone DDXMLNodeOptionsNone
+#endif
+#ifndef NSXMLNodeExpandEmptyElement
+ #define NSXMLNodeExpandEmptyElement DDXMLNodeExpandEmptyElement
+#endif
+#ifndef NSXMLNodeCompactEmptyElement
+ #define NSXMLNodeCompactEmptyElement DDXMLNodeCompactEmptyElement
+#endif
+#ifndef NSXMLNodePrettyPrint
+ #define NSXMLNodePrettyPrint DDXMLNodePrettyPrint
+#endif
+
+#endif // #if TARGET_OS_IPHONE
+
+
+
// KissXML has rather straight-forward memory management:
// https://github.com/robbiehanson/KissXML/wiki/MemoryManagementThreadSafety
//
@@ -113,4 +189,8 @@
//
// The debugging macro adds a significant amount of overhead, and should NOT be enabled on production builds.
-#define DDXML_DEBUG_MEMORY_ISSUES 0
+#if DEBUG
+ #define DDXML_DEBUG_MEMORY_ISSUES 0
+#else
+ #define DDXML_DEBUG_MEMORY_ISSUES 0 // Don't change me!
+#endif
Please sign in to comment.
Something went wrong with that request. Please try again.