Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merging patch for issue #23. (Support for GNUSTEP)

  • Loading branch information...
commit 6cb105ab7b0c5aadbdcb125a1759d7756768b883 1 parent 65628ab
@robbiehanson authored
Showing with 13 additions and 6 deletions.
  1. +4 −4 DDXMLNode.m
  2. +1 −1  NSStringAdditions.h
  3. +8 −1 NSStringAdditions.m
View
8 DDXMLNode.m
@@ -318,7 +318,7 @@ - (id)copyWithZone:(NSZone *)zone
{
xmlNsPtr copyNsPtr = xmlCopyNamespace((xmlNsPtr)genericPtr);
- return [[DDXMLNode alloc] initWithUncheckedPrimitive:(xmlKindPtr)copyNsPtr nsParent:nil];
+ return [[DDXMLNode alloc] initWithUncheckedPrimitive:(xmlKindPtr)copyNsPtr nsParent:NULL];
}
if([self isXmlDtdPtr])
@@ -1076,8 +1076,8 @@ - (NSString *)XMLStringWithOptions:(NSUInteger)options
}
else
{
- NSMutableString *result = [NSMutableString stringWithUTF8String:(const char *)bufferPtr->content];
- CFStringTrimWhitespace((CFMutableStringRef)result);
+ NSMutableString *resTmp = [NSMutableString stringWithUTF8String:(const char *)bufferPtr->content];
+ NSString *result = [resTmp stringByTrimming];
xmlBufferFree(bufferPtr);
@@ -1811,7 +1811,7 @@ + (NSError *)lastError
[lastErrorValue getValue:&lastError];
int errCode = lastError.code;
- NSString *errMsg = [[NSString stringWithFormat:@"%s", lastError.message] trimWhitespace];
+ NSString *errMsg = [[NSString stringWithFormat:@"%s", lastError.message] stringByTrimming];
NSDictionary *info = [NSDictionary dictionaryWithObject:errMsg forKey:NSLocalizedDescriptionKey];
View
2  NSStringAdditions.h
@@ -9,6 +9,6 @@
**/
- (const xmlChar *)xmlChar;
-- (NSString *)trimWhitespace;
+- (NSString *)stringByTrimming;
@end
View
9 NSStringAdditions.m
@@ -8,7 +8,13 @@ - (const xmlChar *)xmlChar
return (const xmlChar *)[self UTF8String];
}
-- (NSString *)trimWhitespace
+#ifdef GNUSTEP
+- (NSString *)stringByTrimming
+{
+ return [self stringByTrimmingSpaces];
+}
+#else
+- (NSString *)stringByTrimming
{
NSMutableString *mStr = [self mutableCopy];
CFStringTrimWhitespace((CFMutableStringRef)mStr);
@@ -18,5 +24,6 @@ - (NSString *)trimWhitespace
[mStr release];
return [result autorelease];
}
+#endif
@end
Please sign in to comment.
Something went wrong with that request. Please try again.