mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
XML property list support completed.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@10501 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
06ee1f7be5
commit
d96a040986
10 changed files with 489 additions and 116 deletions
|
@ -1,3 +1,8 @@
|
|||
2001-07-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSString.m: Finish off and enable XML property list code
|
||||
* Source/GSCompatibility.m: ditto
|
||||
|
||||
2001-07-16 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* Source/NSUserDefaults.m ([NSUserDefaults +userLanguages]): Put
|
||||
|
|
|
@ -71,11 +71,67 @@
|
|||
<dl>
|
||||
<dt>GSMacOSXCompatibleGeometry
|
||||
<dd>
|
||||
Specifies whether the functions for producing strings describing
|
||||
geometrical structures (NSStringFromPoint(), NSStringFromSize(),
|
||||
and NSStringFromRect()) should produce strings conforming to the
|
||||
OpenStep specification or to MacOS-X behavior. The functions
|
||||
for parsing those strings should cope with both cases anyway.
|
||||
<p>
|
||||
|
||||
Specifies whether the functions for producing strings
|
||||
describing geometric structures (NSStringFromPoint(),
|
||||
NSStringFromSize(), and NSStringFromRect()) should produce
|
||||
strings conforming to the OpenStep specification or to
|
||||
MacOS-X behavior. The functions for parsing those strings
|
||||
should cope with both cases anyway.
|
||||
</p>
|
||||
|
||||
|
||||
<dt>GSMacOSXCompatiblePropertyLists
|
||||
<dd>
|
||||
<p>
|
||||
|
||||
Specifies whether text property-list output should be in
|
||||
the default MacOS-X format (XML), or in the more human
|
||||
readable (but less powerful) original OpenStep format.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
Reading of property lists is supported in either format,
|
||||
but <em>only</em> if GNUstep is built with the libxml
|
||||
library (which is needed to handle XML parsing).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
NB. MacOS-X generates illegal XML for some strings - those
|
||||
which contain characters not legal in XML. GNUstep always
|
||||
generates legal XML, at the cost of a certain degree of
|
||||
compatibility. GNUstep XML property lists use a backslash
|
||||
to escape illegal chatracters, and consequently any string
|
||||
containing either a backslash or an illegal character will
|
||||
be written differently to the same string on MacOS-X.
|
||||
</p>
|
||||
|
||||
|
||||
<dt>NSWriteOldStylePropertyLists
|
||||
<dd>
|
||||
<p>
|
||||
|
||||
Specifies whether text property-list output should be in
|
||||
the default MacOS-X format (XML), or in the more human
|
||||
readable (but less powerful) original OpenStep format.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
If, GSMacOSXCompatible is YES, this default is treated
|
||||
as being NO if it is not set, otherwise, this default
|
||||
is treated as YES.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
This default is <em>NOT</em> used if
|
||||
GSMacOSXCompatiblePropertyLists is specified.
|
||||
</p>
|
||||
|
||||
|
||||
</dl>
|
||||
<h4><a name ="cont-4">Environment variables</a></h4>
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
<dl>
|
||||
<dt><a href ="http://www.gnustep.org/developers/whoiswho.html">Richard Frith-Macdonald</a>
|
||||
<dd>
|
||||
<dt>Pierre-Yves Rivaille
|
||||
<dd>
|
||||
</dl>
|
||||
<p>Version: $Revision$</p>
|
||||
<p>Date: $Date$</p>
|
||||
|
@ -32,8 +34,8 @@
|
|||
<li ><a href ="NSArray.html#method-2">+arrayWithArray:</a>
|
||||
<li ><a href ="NSArray.html#method-3">+arrayWithContentsOfFile:</a>
|
||||
<li ><a href ="NSArray.html#method-4">+arrayWithObject:</a>
|
||||
<li ><a href ="NSArray.html#method-6">+arrayWithObjects:</a>
|
||||
<li ><a href ="NSArray.html#method-5">+arrayWithObjects:</a>
|
||||
<li ><a href ="NSArray.html#method-6">+arrayWithObjects:count:</a>
|
||||
<li ><a href ="NSArray.html#method-7">-arrayByAddingObject:</a>
|
||||
<li ><a href ="NSArray.html#method-8">-arrayByAddingObjectsFromArray:</a>
|
||||
<li ><a href ="NSArray.html#method-9">-componentsJoinedByString:</a>
|
||||
|
@ -42,16 +44,16 @@
|
|||
<li ><a href ="NSArray.html#method-12">-descriptionWithLocale:</a>
|
||||
<li ><a href ="NSArray.html#method-13">-descriptionWithLocale:</a>
|
||||
<li ><a href ="NSArray.html#method-14">-firstObjectCommonWithArray:</a>
|
||||
<li ><a href ="NSArray.html#method-16">-getObjects:</a>
|
||||
<li ><a href ="NSArray.html#method-15">-getObjects:</a>
|
||||
<li ><a href ="NSArray.html#method-16">-getObjects:range:</a>
|
||||
<li ><a href ="NSArray.html#method-17">-indexOfObject:</a>
|
||||
<li ><a href ="NSArray.html#method-18">-indexOfObject:</a>
|
||||
<li ><a href ="NSArray.html#method-20">-indexOfObjectIdenticalTo:</a>
|
||||
<li ><a href ="NSArray.html#method-18">-indexOfObject:range:</a>
|
||||
<li ><a href ="NSArray.html#method-19">-indexOfObjectIdenticalTo:</a>
|
||||
<li ><a href ="NSArray.html#method-20">-indexOfObjectIdenticalTo:range:</a>
|
||||
<li ><a href ="NSArray.html#method-21">-initWithArray:</a>
|
||||
<li ><a href ="NSArray.html#method-22">-initWithContentsOfFile:</a>
|
||||
<li ><a href ="NSArray.html#method-24">-initWithObjects:</a>
|
||||
<li ><a href ="NSArray.html#method-23">-initWithObjects:</a>
|
||||
<li ><a href ="NSArray.html#method-24">-initWithObjects:count:</a>
|
||||
<li ><a href ="NSArray.html#method-25">-isEqualToArray:</a>
|
||||
<li ><a href ="NSArray.html#method-26">-lastObject</a>
|
||||
<li ><a href ="NSArray.html#method-27">-makeObjectsPerformSelector:</a>
|
||||
|
@ -63,205 +65,288 @@
|
|||
<li ><a href ="NSArray.html#method-33">-sortedArrayHint</a>
|
||||
<li ><a href ="NSArray.html#method-34">-sortedArrayUsingFunction:context:</a>
|
||||
<li ><a href ="NSArray.html#method-35">-sortedArrayUsingFunction:context:</a>
|
||||
<li ><a href ="NSArray.html#method-36">-sortedArrayUsingSelector:</a>
|
||||
<li ><a href ="NSArray.html#method-36">-sortedArrayUsingSelector:hint:</a>
|
||||
<li ><a href ="NSArray.html#method-37">-subarrayWithRange:</a>
|
||||
<li ><a href ="NSArray.html#method-38">-writeToFile:atomically:</a>
|
||||
<li ><a href ="NSArray.html#method-39">-writeToURL:atomically:</a>
|
||||
</ul>
|
||||
<hr><h2>Class Methods </h2>
|
||||
<h3><a name ="method-0">allocWithZone:</a></h3>
|
||||
+ (id) <b>allocWithZone:</b> (NSZone*)zone;<br>
|
||||
|
||||
TODO
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-1">array</a></h3>
|
||||
+ (id) <b>array</b>;<br>
|
||||
|
||||
Returns a new empty array.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-2">arrayWithArray:</a></h3>
|
||||
+ (id) <b>arrayWithArray:</b> (NSArray*)anArray;<br>
|
||||
|
||||
Returns a new array containing the same elements as anArray.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-3">arrayWithContentsOfFile:</a></h3>
|
||||
+ (id) <b>arrayWithContentsOfFile:</b> (NSString*)aPath;<br>
|
||||
|
||||
Returns a new array based upon the file located at aPath.
|
||||
This file may be in property list format or in XML format (if XML is available).
|
||||
This method returns nil if the file does not represent an array.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-4">arrayWithObject:</a></h3>
|
||||
+ (id) <b>arrayWithObject:</b> (id)anObject;<br>
|
||||
|
||||
Returns a new array containing only one object, anObject.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-5">arrayWithObjects:</a></h3>
|
||||
+ (id) <b>arrayWithObjects:</b> (id)firstObj,;<br>
|
||||
|
||||
Returns a new array containing the objects passed as arguments to the method. The order is preserved.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-6">arrayWithObjects:</a></h3>
|
||||
+ (id) <b>arrayWithObjects:</b> (id*)objects;<br>
|
||||
<h3><a name ="method-6">arrayWithObjects:count:</a></h3>
|
||||
+ (id) <b>arrayWithObjects:</b> (id*)objects <b>count:</b> (unsigned)count;<br>
|
||||
|
||||
Returns a new array containing the objects that are in
|
||||
the C-array objects and which size is count.
|
||||
The order is preserved.
|
||||
|
||||
<hr>
|
||||
<hr><h2>Instances Methods </h2>
|
||||
<h3><a name ="method-7">arrayByAddingObject:</a></h3>
|
||||
- (NSArray*) <b>arrayByAddingObject:</b> (id)anObject;<br>
|
||||
|
||||
Returns a new array created by adding anObject at the end of seld. The order is respected.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-8">arrayByAddingObjectsFromArray:</a></h3>
|
||||
- (NSArray*) <b>arrayByAddingObjectsFromArray:</b> (NSArray*)otherArray;<br>
|
||||
|
||||
Returns a new array which is the concatenation of self and otherArray (in this precise order).
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-9">componentsJoinedByString:</a></h3>
|
||||
- (NSString*) <b>componentsJoinedByString:</b> (NSString*)separator;<br>
|
||||
|
||||
Returns a string created by the concatenation of self's elements' description separated by the string separator.
|
||||
The order is preserved.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-10">containsObject:</a></h3>
|
||||
- (BOOL) <b>containsObject:</b> (id)anObject;<br>
|
||||
|
||||
Returns YES if anObject belongs to self. No otherwise. The isEqual: method of anObject is used to test equality.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-11">count</a></h3>
|
||||
- (unsigned int) <b>count</b>;<br>
|
||||
|
||||
Returns the number of elements contained in self.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-12">descriptionWithLocale:</a></h3>
|
||||
- (NSString*) <b>descriptionWithLocale:</b> (NSDictionary*)locale;<br>
|
||||
|
||||
TODO
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-13">descriptionWithLocale:</a></h3>
|
||||
- (NSString*) <b>descriptionWithLocale:</b> (NSDictionary*)locale;<br>
|
||||
|
||||
TODO
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-14">firstObjectCommonWithArray:</a></h3>
|
||||
- (id) <b>firstObjectCommonWithArray:</b> (NSArray*)otherArray;<br>
|
||||
|
||||
Returns the first element of the array which can be found in otherArray.
|
||||
Equality is tested with the isEqual method.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-15">getObjects:</a></h3>
|
||||
- (void) <b>getObjects:</b> (id*)aBuffer;<br>
|
||||
|
||||
This methods store all the elements of self inside aBuffer which is a C-array.
|
||||
The order is preserved. You should get sure aBuffer's size is sufficient.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-16">getObjects:</a></h3>
|
||||
- (void) <b>getObjects:</b> (id*)aBuffer;<br>
|
||||
<h3><a name ="method-16">getObjects:range:</a></h3>
|
||||
- (void) <b>getObjects:</b> (id*)aBuffer <b>range:</b> (NSRange)aRange;<br>
|
||||
|
||||
This methods store the elements of self in the range aRange inside aBuffer which is a C-array.
|
||||
The order is preserved. You should get sure aBuffer's size is sufficient.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-17">indexOfObject:</a></h3>
|
||||
- (unsigned int) <b>indexOfObject:</b> (id)anObject;<br>
|
||||
|
||||
Returns the index of the first object of the array which is equal to anObject.
|
||||
Equality is tested with the isEqual: method of anObject.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-18">indexOfObject:</a></h3>
|
||||
- (unsigned int) <b>indexOfObject:</b> (id)anObject;<br>
|
||||
<h3><a name ="method-18">indexOfObject:range:</a></h3>
|
||||
- (unsigned int) <b>indexOfObject:</b> (id)anObject <b>range:</b> (NSRange)aRange;<br>
|
||||
|
||||
Returns the index of the first object of the array which is equal to anObject and which is in aRange range.
|
||||
Equality is tested with the isEqual: method of anObject.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-19">indexOfObjectIdenticalTo:</a></h3>
|
||||
- (unsigned int) <b>indexOfObjectIdenticalTo:</b> (id)anObject;<br>
|
||||
|
||||
Returns the index of the first object of the array which is physically equal to anObject.
|
||||
Physical equality is tested with ==.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-20">indexOfObjectIdenticalTo:</a></h3>
|
||||
- (unsigned int) <b>indexOfObjectIdenticalTo:</b> (id)anObject;<br>
|
||||
<h3><a name ="method-20">indexOfObjectIdenticalTo:range:</a></h3>
|
||||
- (unsigned int) <b>indexOfObjectIdenticalTo:</b> (id)anObject <b>range:</b> (NSRange)aRange;<br>
|
||||
|
||||
Returns the index of the first object of the array which is physically equal to anObject and which is in aRange range.
|
||||
Physical equality is tested with ==.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-21">initWithArray:</a></h3>
|
||||
- (id) <b>initWithArray:</b> (NSArray*)anArray;<br>
|
||||
|
||||
Initialize the array with the content of anArray. The order is preserved.
|
||||
Returns self.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-22">initWithContentsOfFile:</a></h3>
|
||||
- (id) <b>initWithContentsOfFile:</b> (NSString*)aPath;<br>
|
||||
|
||||
Initialize the array based upon the file located at aPath.
|
||||
This file may be in property list format or in XML format (if XML is available).
|
||||
If the file does not represent an array, self is left uninitialized and nil is returned.
|
||||
Otherwise self is returned.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-23">initWithObjects:</a></h3>
|
||||
- (id) <b>initWithObjects:</b> (id)firstObj,;<br>
|
||||
|
||||
Initialize the array with the objects passed as arguments. The order is preserved.
|
||||
Returns self.
|
||||
NSInvalidArgumentException is raised if nil is one of the objects.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-24">initWithObjects:</a></h3>
|
||||
- (id) <b>initWithObjects:</b> (id*)objects;<br>
|
||||
<h3><a name ="method-24">initWithObjects:count:</a></h3>
|
||||
- (id) <b>initWithObjects:</b> (id*)objects <b>count:</b> (unsigned)count;<br>
|
||||
|
||||
Initialize the array with the objects contained in the
|
||||
C-array argument which size is count.
|
||||
The order is preserved.
|
||||
Returns self.
|
||||
NSInvalidArgumentException is raised if nil is one of the objects.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-25">isEqualToArray:</a></h3>
|
||||
- (BOOL) <b>isEqualToArray:</b> (NSArray*)otherArray;<br>
|
||||
|
||||
Returns YES if the two arrays contain the same elements,
|
||||
i.e. the two arrays have the same length and <br>
|
||||
for i from 0 to length - 1,
|
||||
[[self objectAtIndex: i] isEqual: [anArray objectAtIndex: i]] returns YES.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-26">lastObject</a></h3>
|
||||
- (id) <b>lastObject</b>;<br>
|
||||
|
||||
Returns the last element of the array. If the array is empty, returns nil.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-27">makeObjectsPerformSelector:</a></h3>
|
||||
- (void) <b>makeObjectsPerformSelector:</b> (SEL)aSelector;<br>
|
||||
|
||||
Perform aSelector on every object of the array.
|
||||
This is done sequentially from the last to the first object.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-28">makeObjectsPerformSelector:withObject:</a></h3>
|
||||
- (void) <b>makeObjectsPerformSelector:</b> (SEL)aSelector <b>withObject:</b> (id)anObject;<br>
|
||||
|
||||
Perform aSelector with the argument anObject on every object of the array.
|
||||
This is done sequentially from the last to the first object.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-29">objectAtIndex:</a></h3>
|
||||
- (id) <b>objectAtIndex:</b> (unsigned int)index;<br>
|
||||
|
||||
Returns located in the array at position index.
|
||||
Raise NSRangeException if index is out of bounds
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-30">objectEnumerator</a></h3>
|
||||
- (NSEnumerator*) <b>objectEnumerator</b>;<br>
|
||||
|
||||
Returns an enumerator describing the array sequentially
|
||||
from the first to the last element.<br>
|
||||
If you use a mutable subclass of NSArray,
|
||||
you should not modify the array during enumeration
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-31">pathsMatchingExtensions:</a></h3>
|
||||
- (NSArray*) <b>pathsMatchingExtensions:</b> (NSArray*)filterTypes;<br>
|
||||
|
||||
Returns all the elements of the array which are NSString which
|
||||
extensions are within the filterTypes NSArray.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-32">reverseObjectEnumerator</a></h3>
|
||||
- (NSEnumerator*) <b>reverseObjectEnumerator</b>;<br>
|
||||
|
||||
Returns an enumerator describing the array sequentially
|
||||
from the last to the first element.<br>
|
||||
If you use a mutable subclass of NSArray,
|
||||
you should not modify the array during enumeration
|
||||
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-33">sortedArrayHint</a></h3>
|
||||
- (NSData*) <b>sortedArrayHint</b>;<br>
|
||||
|
||||
Returns nil. Does not do anything. TODO
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-34">sortedArrayUsingFunction:context:</a></h3>
|
||||
- (NSArray*) <b>sortedArrayUsingFunction:</b> (int(*)(id,id,void*))comparator <b>context:</b> (void*)context;<br>
|
||||
|
||||
TODO
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-35">sortedArrayUsingFunction:context:</a></h3>
|
||||
- (NSArray*) <b>sortedArrayUsingFunction:</b> (int(*)(id,id,void*))compare <b>context:</b> (void*)context;<br>
|
||||
|
||||
TODO
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-36">sortedArrayUsingSelector:</a></h3>
|
||||
- (NSArray*) <b>sortedArrayUsingSelector:</b> (SEL)comparator;<br>
|
||||
<h3><a name ="method-36">sortedArrayUsingSelector:hint:</a></h3>
|
||||
- (NSArray*) <b>sortedArrayUsingSelector:</b> (SEL)comparator <b>hint:</b> (NSDate*)hint;<br>
|
||||
|
||||
TODO
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-37">subarrayWithRange:</a></h3>
|
||||
- (NSArray*) <b>subarrayWithRange:</b> (NSRange)range;<br>
|
||||
|
||||
Returns a new array which contains self's elements located in range.
|
||||
The order is preserved.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-38">writeToFile:atomically:</a></h3>
|
||||
- (BOOL) <b>writeToFile:</b> (NSString*)path <b>atomically:</b> (BOOL)flag;<br>
|
||||
|
||||
TODO
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-39">writeToURL:atomically:</a></h3>
|
||||
- (BOOL) <b>writeToURL:</b> (NSURL*)url <b>atomically:</b> (BOOL)flag;<br>
|
||||
|
||||
TODO
|
||||
|
||||
<hr>
|
||||
</body>
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
<li ><a href ="NSDictionary.html#method-32">-objectForKey:</a>
|
||||
<li ><a href ="NSDictionary.html#method-33">-objectsForKeys:notFoundMarker:</a>
|
||||
<li ><a href ="NSDictionary.html#method-34">-writeToFile:atomically:</a>
|
||||
<li ><a href ="NSDictionary.html#method-35">-writeToURL:atomically:</a>
|
||||
</ul>
|
||||
<hr><h2>Class Methods </h2>
|
||||
<h3><a name ="method-0">allocWithZone:</a></h3>
|
||||
|
@ -284,6 +285,12 @@
|
|||
|
||||
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-35">writeToURL:atomically:</a></h3>
|
||||
- (BOOL) <b>writeToURL:</b> (NSURL*)url <b>atomically:</b> (BOOL)flag;<br>
|
||||
|
||||
|
||||
|
||||
<hr>
|
||||
</body>
|
||||
|
||||
|
|
|
@ -91,31 +91,45 @@
|
|||
<h3><a name ="method-8">mutableBytes</a></h3>
|
||||
- (void*) <b>mutableBytes</b>;<br>
|
||||
|
||||
Returns a pointer to the data storage of the receiver.<br>
|
||||
Modifications to the memory pointed to by this pointer will
|
||||
change the contents of the object. It is important that
|
||||
your code should not try to modify the memory beyond the
|
||||
number of bytes given by the <code>-length</code> method.<br>
|
||||
NB. if the object is released, or any method that changes its
|
||||
size or content is called, then the pointer previously returned
|
||||
by this method may cease to be valid.<br>
|
||||
This is a 'primitive' method ... you need to implement it
|
||||
if you write a subclass of NSMutableData.
|
||||
<p>
|
||||
|
||||
Returns a pointer to the data storage of the receiver.<br>
|
||||
Modifications to the memory pointed to by this pointer will
|
||||
change the contents of the object. It is important that
|
||||
your code should not try to modify the memory beyond the
|
||||
number of bytes given by the <code>-length</code> method.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
NB. if the object is released, or any method that changes its
|
||||
size or content is called, then the pointer previously returned
|
||||
by this method may cease to be valid.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
This is a 'primitive' method ... you need to implement it
|
||||
if you write a subclass of NSMutableData.
|
||||
</p>
|
||||
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-9">replaceBytesInRange:withBytes:</a></h3>
|
||||
- (void) <b>replaceBytesInRange:</b> (NSRange)range <b>withBytes:</b> (const void*)bytes;<br>
|
||||
|
||||
Replaces the bytes of data in the specified range with a
|
||||
copy of the new bytes supplied.<br>
|
||||
If the location of the range specified lies beyond the end
|
||||
of the data (<code>[self length] < range.location</code>)
|
||||
then a range exception is raised.<br>
|
||||
Otherwise, if the range specified extends beyond the end
|
||||
of the data, then the size of the data is increased to
|
||||
accomodate the new bytes.<br>
|
||||
This is a 'primitive' method ... you need to implement it
|
||||
if you write a subclass of NSMutableData.
|
||||
<p>
|
||||
|
||||
Replaces the bytes of data in the specified range with a
|
||||
copy of the new bytes supplied.<br>
|
||||
If the location of the range specified lies beyond the end
|
||||
of the data (<code>[self length] < range.location</code>)
|
||||
then a range exception is raised.<br>
|
||||
Otherwise, if the range specified extends beyond the end
|
||||
of the data, then the size of the data is increased to
|
||||
accomodate the new bytes.<br>
|
||||
</p>
|
||||
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-10">resetBytesInRange:</a></h3>
|
||||
|
@ -161,6 +175,19 @@
|
|||
<h3><a name ="method-18">setLength:</a></h3>
|
||||
- (void) <b>setLength:</b> (unsigned int)length;<br>
|
||||
|
||||
<p>
|
||||
|
||||
Sets the length of the NSMutableData object.
|
||||
If the length is increased, the newly allocated data area
|
||||
is filled with zero bytes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
This is a 'primitive' method ... you need to implement it
|
||||
if you write a subclass of NSMutableData.
|
||||
</p>
|
||||
|
||||
|
||||
<hr>
|
||||
</body>
|
||||
|
|
|
@ -34,8 +34,9 @@
|
|||
<li ><a href ="NSProcessInfo.html#method-4">-hostName</a>
|
||||
<li ><a href ="NSProcessInfo.html#method-5">-operatingSystem</a>
|
||||
<li ><a href ="NSProcessInfo.html#method-6">-operatingSystemName</a>
|
||||
<li ><a href ="NSProcessInfo.html#method-7">-processName</a>
|
||||
<li ><a href ="NSProcessInfo.html#method-8">-setProcessName:</a>
|
||||
<li ><a href ="NSProcessInfo.html#method-7">-processIdentifier</a>
|
||||
<li ><a href ="NSProcessInfo.html#method-8">-processName</a>
|
||||
<li ><a href ="NSProcessInfo.html#method-9">-setProcessName:</a>
|
||||
</ul>
|
||||
<hr><h2>Class Methods </h2>
|
||||
<h3><a name ="method-0">processInfo</a></h3>
|
||||
|
@ -74,12 +75,22 @@
|
|||
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-7">processName</a></h3>
|
||||
<h3><a name ="method-7">processIdentifier</a></h3>
|
||||
- (int) <b>processIdentifier</b>;<br>
|
||||
|
||||
<p>
|
||||
|
||||
Returns the number identifying this process on this system.
|
||||
</p>
|
||||
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-8">processName</a></h3>
|
||||
- (NSString*) <b>processName</b>;<br>
|
||||
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-8">setProcessName:</a></h3>
|
||||
<h3><a name ="method-9">setProcessName:</a></h3>
|
||||
- (void) <b>setProcessName:</b> (NSString*)newName;<br>
|
||||
|
||||
|
||||
|
|
|
@ -37,20 +37,23 @@
|
|||
<li ><a href ="NSTask.html#method-5">-isRunning</a>
|
||||
<li ><a href ="NSTask.html#method-6">-launch</a>
|
||||
<li ><a href ="NSTask.html#method-7">-launchPath</a>
|
||||
<li ><a href ="NSTask.html#method-8">-setArguments:</a>
|
||||
<li ><a href ="NSTask.html#method-9">-setCurrentDirectoryPath:</a>
|
||||
<li ><a href ="NSTask.html#method-10">-setEnvironment:</a>
|
||||
<li ><a href ="NSTask.html#method-11">-setLaunchPath:</a>
|
||||
<li ><a href ="NSTask.html#method-12">-setStandardError:</a>
|
||||
<li ><a href ="NSTask.html#method-13">-setStandardInput:</a>
|
||||
<li ><a href ="NSTask.html#method-14">-setStandardOutput:</a>
|
||||
<li ><a href ="NSTask.html#method-15">-standardError</a>
|
||||
<li ><a href ="NSTask.html#method-16">-standardInput</a>
|
||||
<li ><a href ="NSTask.html#method-17">-standardOutput</a>
|
||||
<li ><a href ="NSTask.html#method-18">-terminate</a>
|
||||
<li ><a href ="NSTask.html#method-19">-terminationStatus</a>
|
||||
<li ><a href ="NSTask.html#method-20">-usePseudoTerminal</a>
|
||||
<li ><a href ="NSTask.html#method-21">-waitUntilExit</a>
|
||||
<li ><a href ="NSTask.html#method-8">-processIdentifer</a>
|
||||
<li ><a href ="NSTask.html#method-19">-resume</a>
|
||||
<li ><a href ="NSTask.html#method-9">-setArguments:</a>
|
||||
<li ><a href ="NSTask.html#method-10">-setCurrentDirectoryPath:</a>
|
||||
<li ><a href ="NSTask.html#method-11">-setEnvironment:</a>
|
||||
<li ><a href ="NSTask.html#method-12">-setLaunchPath:</a>
|
||||
<li ><a href ="NSTask.html#method-13">-setStandardError:</a>
|
||||
<li ><a href ="NSTask.html#method-14">-setStandardInput:</a>
|
||||
<li ><a href ="NSTask.html#method-15">-setStandardOutput:</a>
|
||||
<li ><a href ="NSTask.html#method-16">-standardError</a>
|
||||
<li ><a href ="NSTask.html#method-17">-standardInput</a>
|
||||
<li ><a href ="NSTask.html#method-18">-standardOutput</a>
|
||||
<li ><a href ="NSTask.html#method-20">-suspend</a>
|
||||
<li ><a href ="NSTask.html#method-21">-terminate</a>
|
||||
<li ><a href ="NSTask.html#method-22">-terminationStatus</a>
|
||||
<li ><a href ="NSTask.html#method-23">-usePseudoTerminal</a>
|
||||
<li ><a href ="NSTask.html#method-24">-waitUntilExit</a>
|
||||
</ul>
|
||||
<hr><h2>Class Methods </h2>
|
||||
<h3><a name ="method-0">launchedTaskWithLaunchPath:arguments:</a></h3>
|
||||
|
@ -112,7 +115,13 @@
|
|||
Returns the launch path set for the task.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-8">setArguments:</a></h3>
|
||||
<h3><a name ="method-8">processIdentifer</a></h3>
|
||||
- (int) <b>processIdentifer</b>;<br>
|
||||
|
||||
Returns the number identifying the child process on this system.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-9">setArguments:</a></h3>
|
||||
- (void) <b>setArguments:</b> (NSArray*)arguments;<br>
|
||||
|
||||
Sets an array of arguments to be supplied to the task when it
|
||||
|
@ -121,7 +130,7 @@
|
|||
it raises an NSInvalidArgumentException.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-9">setCurrentDirectoryPath:</a></h3>
|
||||
<h3><a name ="method-10">setCurrentDirectoryPath:</a></h3>
|
||||
- (void) <b>setCurrentDirectoryPath:</b> (NSString*)path;<br>
|
||||
|
||||
Sets the home directory in which the task is to be run.
|
||||
|
@ -130,7 +139,7 @@
|
|||
it raises an NSInvalidArgumentException.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-10">setEnvironment:</a></h3>
|
||||
<h3><a name ="method-11">setEnvironment:</a></h3>
|
||||
- (void) <b>setEnvironment:</b> (NSDictionary*)environmentDictionary;<br>
|
||||
|
||||
Sets the environment variables for the task to be run.
|
||||
|
@ -139,7 +148,7 @@
|
|||
it raises an NSInvalidArgumentException.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-11">setLaunchPath:</a></h3>
|
||||
<h3><a name ="method-12">setLaunchPath:</a></h3>
|
||||
- (void) <b>setLaunchPath:</b> (NSString*)path;<br>
|
||||
|
||||
Sets the path to the executable file to be run.
|
||||
|
@ -148,7 +157,7 @@
|
|||
it raises an NSInvalidArgumentException.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-12">setStandardError:</a></h3>
|
||||
<h3><a name ="method-13">setStandardError:</a></h3>
|
||||
- (void) <b>setStandardError:</b> (id)file;<br>
|
||||
|
||||
Sets the standard error stream for the task.<br>
|
||||
|
@ -161,7 +170,7 @@
|
|||
it raises an NSInvalidArgumentException.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-13">setStandardInput:</a></h3>
|
||||
<h3><a name ="method-14">setStandardInput:</a></h3>
|
||||
- (void) <b>setStandardInput:</b> (id)file;<br>
|
||||
|
||||
Sets the standard input stream for the task.<br>
|
||||
|
@ -174,7 +183,7 @@
|
|||
it raises an NSInvalidArgumentException.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-14">setStandardOutput:</a></h3>
|
||||
<h3><a name ="method-15">setStandardOutput:</a></h3>
|
||||
- (void) <b>setStandardOutput:</b> (id)file;<br>
|
||||
|
||||
Sets the standard output stream for the task.<br>
|
||||
|
@ -187,28 +196,44 @@
|
|||
it raises an NSInvalidArgumentException.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-15">standardError</a></h3>
|
||||
<h3><a name ="method-16">standardError</a></h3>
|
||||
- (id) <b>standardError</b>;<br>
|
||||
|
||||
Returns the standard error stream for the task - an NSFileHandle
|
||||
unless an NSPipe was passed to setStandardError:
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-16">standardInput</a></h3>
|
||||
<h3><a name ="method-17">standardInput</a></h3>
|
||||
- (id) <b>standardInput</b>;<br>
|
||||
|
||||
Returns the standard input stream for the task - an NSFileHandle
|
||||
unless an NSPipe was passed to setStandardInput:
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-17">standardOutput</a></h3>
|
||||
<h3><a name ="method-18">standardOutput</a></h3>
|
||||
- (id) <b>standardOutput</b>;<br>
|
||||
|
||||
Returns the standard output stream for the task - an NSFileHandle
|
||||
unless an NSPipe was passed to setStandardOutput:
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-18">terminate</a></h3>
|
||||
<h3><a name ="method-19">resume</a></h3>
|
||||
- (BOOL) <b>resume</b>;<br>
|
||||
|
||||
Sends a cont signal to the receiver and any subtasks.<br>
|
||||
If the task has not been launched, raises an
|
||||
NSInvalidArgumentException.<br>
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-20">suspend</a></h3>
|
||||
- (BOOL) <b>suspend</b>;<br>
|
||||
|
||||
Sends a stop signal to the receiver and any subtasks.<br>
|
||||
If the task has not been launched, raises an
|
||||
NSInvalidArgumentException.<br>
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-21">terminate</a></h3>
|
||||
- (void) <b>terminate</b>;<br>
|
||||
|
||||
Sends a terminate signal to the receiver and any subtasks.<br>
|
||||
|
@ -220,7 +245,7 @@
|
|||
posted.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-19">terminationStatus</a></h3>
|
||||
<h3><a name ="method-22">terminationStatus</a></h3>
|
||||
- (int) <b>terminationStatus</b>;<br>
|
||||
|
||||
Returns the termination status of the task.<br>
|
||||
|
@ -228,7 +253,7 @@
|
|||
NSInvalidArgumentException.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-20">usePseudoTerminal</a></h3>
|
||||
<h3><a name ="method-23">usePseudoTerminal</a></h3>
|
||||
- (BOOL) <b>usePseudoTerminal</b>;<br>
|
||||
Standards: GNUstep NotMacOS-X NotOpenStep<br>
|
||||
|
||||
|
@ -244,7 +269,7 @@ Standards: GNUstep NotMacOS-X NotOpenStep<br>
|
|||
The method returns YES on success, NO on failure.
|
||||
|
||||
<hr>
|
||||
<h3><a name ="method-21">waitUntilExit</a></h3>
|
||||
<h3><a name ="method-24">waitUntilExit</a></h3>
|
||||
- (void) <b>waitUntilExit</b>;<br>
|
||||
|
||||
Suspends the current thread until the task terminates, by
|
||||
|
|
|
@ -73,7 +73,22 @@ static BOOL MacOSXCompatiblePropertyLists = NO;
|
|||
}
|
||||
else
|
||||
{
|
||||
MacOSXCompatiblePropertyLists = MacOSXCompatible;
|
||||
def = [defaults objectForKey: @"NSWriteOldStylePropertyLists"];
|
||||
if (def != nil && [def isKindOfClass: sClass] == YES)
|
||||
{
|
||||
if ([def boolBalue] == YES)
|
||||
{
|
||||
MacOSXCompatiblePropertyLists = NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
MacOSXCompatiblePropertyLists = YES;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MacOSXCompatiblePropertyLists = MacOSXCompatible;
|
||||
}
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
@ -109,8 +124,6 @@ BOOL GSMacOSXCompatibleGeometry()
|
|||
|
||||
BOOL GSMacOSXCompatiblePropertyLists()
|
||||
{
|
||||
/* HACK until xml propertylists fully working */
|
||||
return NO;
|
||||
if (setupDone == NO)
|
||||
compatibilitySetup();
|
||||
return MacOSXCompatiblePropertyLists;
|
||||
|
@ -170,11 +183,30 @@ encodeBase64(NSData *source)
|
|||
initWithCStringNoCopy: dBuf length: destlen-1 freeWhenDone: YES];
|
||||
}
|
||||
|
||||
static NSCharacterSet *quotables = nil;
|
||||
|
||||
static void setupQuotables()
|
||||
{
|
||||
if (quotables == nil)
|
||||
{
|
||||
NSMutableCharacterSet *s;
|
||||
|
||||
s = [[NSCharacterSet characterSetWithCharactersInString:
|
||||
@"&<>'\\\""] mutableCopy];
|
||||
[s addCharactersInRange: NSMakeRange(0x0001, 0x001f)];
|
||||
[s removeCharactersInRange: NSMakeRange(0x0009, 0x0002)];
|
||||
[s removeCharactersInRange: NSMakeRange(0x000D, 0x0001)];
|
||||
[s addCharactersInRange: NSMakeRange(0xD800, 0x07FF)];
|
||||
[s addCharactersInRange: NSMakeRange(0xFFFE, 0x0002)];
|
||||
quotables = [s copy];
|
||||
RELEASE(s);
|
||||
}
|
||||
}
|
||||
|
||||
static NSString*
|
||||
XMLString(NSString* obj)
|
||||
{
|
||||
static NSCharacterSet *quotables = nil;
|
||||
static char *hexdigits = "0123456789ABCDEF";
|
||||
static char *hexdigits = "0123456789ABCDEF";
|
||||
unsigned end;
|
||||
|
||||
end = [obj length];
|
||||
|
@ -185,7 +217,7 @@ XMLString(NSString* obj)
|
|||
|
||||
if (quotables == nil)
|
||||
{
|
||||
// setupQuotables();
|
||||
setupQuotables();
|
||||
}
|
||||
|
||||
if ([obj rangeOfCharacterFromSet: quotables].length > 0)
|
||||
|
@ -213,7 +245,7 @@ XMLString(NSString* obj)
|
|||
break;
|
||||
case '\'':
|
||||
case '"':
|
||||
len += 5;
|
||||
len += 6;
|
||||
break;
|
||||
case '\\':
|
||||
len += 1;
|
||||
|
@ -302,27 +334,27 @@ XMLString(NSString* obj)
|
|||
else
|
||||
{
|
||||
map[wpos++] = '\\';
|
||||
map[wpos++] = hexdigits[(c>>4) & 0xff];
|
||||
map[wpos++] = hexdigits[c & 0xff];
|
||||
map[wpos++] = '\\';
|
||||
map[wpos++] = '0' + ((c / 64) & 7);
|
||||
map[wpos++] = '0' + ((c / 8) & 7);
|
||||
map[wpos++] = '0' + (c & 7);
|
||||
}
|
||||
}
|
||||
else if (c > 0xD7FF && c < 0xE000)
|
||||
{
|
||||
map[wpos++] = '\\';
|
||||
map[wpos++] = hexdigits[(c>>12) & 0xff];
|
||||
map[wpos++] = hexdigits[(c>>8) & 0xff];
|
||||
map[wpos++] = hexdigits[(c>>4) & 0xff];
|
||||
map[wpos++] = hexdigits[c & 0xff];
|
||||
map[wpos++] = '\\';
|
||||
map[wpos++] = 'U';
|
||||
map[wpos++] = hexdigits[(c>>12) & 0xf];
|
||||
map[wpos++] = hexdigits[(c>>8) & 0xf];
|
||||
map[wpos++] = hexdigits[(c>>4) & 0xf];
|
||||
map[wpos++] = hexdigits[c & 0xf];
|
||||
}
|
||||
else if (c > 0xFFFD)
|
||||
{
|
||||
map[wpos++] = '\\';
|
||||
map[wpos++] = hexdigits[(c>>12) & 0xff];
|
||||
map[wpos++] = hexdigits[(c>>8) & 0xff];
|
||||
map[wpos++] = hexdigits[(c>>4) & 0xff];
|
||||
map[wpos++] = hexdigits[c & 0xff];
|
||||
map[wpos++] = hexdigits[(c>>12) & 0xf];
|
||||
map[wpos++] = hexdigits[(c>>8) & 0xf];
|
||||
map[wpos++] = hexdigits[(c>>4) & 0xf];
|
||||
map[wpos++] = hexdigits[c & 0xf];
|
||||
map[wpos++] = '\\';
|
||||
}
|
||||
else
|
||||
|
|
|
@ -563,12 +563,24 @@ failure:
|
|||
- (NSString*) description
|
||||
{
|
||||
NSString *str;
|
||||
const char *src = [self bytes];
|
||||
const char *src;
|
||||
char *dest;
|
||||
int length = [self length];
|
||||
int i,j;
|
||||
NSZone *z = [self zone];
|
||||
int length;
|
||||
int i;
|
||||
int j;
|
||||
NSZone *z;
|
||||
extern BOOL GSMacOSXCompatiblePropertyLists();
|
||||
|
||||
if (GSMacOSXCompatiblePropertyLists() == YES)
|
||||
{
|
||||
extern NSString *GSXMLPlMake(id obj, NSDictionary *loc, unsigned lev);
|
||||
|
||||
return GSXMLPlMake(self, nil, 0);
|
||||
}
|
||||
|
||||
src = [self bytes];
|
||||
length = [self length];
|
||||
z = [self zone];
|
||||
#define num2char(num) ((num) < 0xa ? ((num)+'0') : ((num)+0x57))
|
||||
|
||||
/* we can just build a cString and convert it to an NSString */
|
||||
|
@ -578,16 +590,20 @@ failure:
|
|||
dest = (char*) NSZoneMalloc(z, 2*length+length/4+3);
|
||||
#endif
|
||||
if (dest == 0)
|
||||
[NSException raise: NSMallocException
|
||||
format: @"No memory for description of NSData object"];
|
||||
{
|
||||
[NSException raise: NSMallocException
|
||||
format: @"No memory for description of NSData object"];
|
||||
}
|
||||
dest[0] = '<';
|
||||
for (i=0,j=1; i<length; i++,j++)
|
||||
for (i = 0, j = 1; i < length; i++, j++)
|
||||
{
|
||||
dest[j++] = num2char((src[i]>>4) & 0x0f);
|
||||
dest[j] = num2char(src[i] & 0x0f);
|
||||
if ((i&0x3) == 3 && i != length-1)
|
||||
/* if we've just finished a 32-bit int, print a space */
|
||||
dest[++j] = ' ';
|
||||
{
|
||||
/* if we've just finished a 32-bit int, print a space */
|
||||
dest[++j] = ' ';
|
||||
}
|
||||
}
|
||||
dest[j++] = '>';
|
||||
dest[j] = '\0';
|
||||
|
|
|
@ -3154,8 +3154,17 @@ handle_printf_atsign (FILE *stream,
|
|||
indent: (unsigned)level
|
||||
to: (id<GNUDescriptionDestination>)output
|
||||
{
|
||||
extern BOOL GSMacOSXCompatiblePropertyLists();
|
||||
unsigned length;
|
||||
|
||||
if (GSMacOSXCompatiblePropertyLists() == YES)
|
||||
{
|
||||
extern NSString *GSXMLPlMake(id obj, NSDictionary *loc, unsigned lev);
|
||||
|
||||
[output appendString: GSXMLPlMake(self, aLocale, level)];
|
||||
return;
|
||||
}
|
||||
|
||||
if ((length = [self length]) == 0)
|
||||
{
|
||||
[output appendString: @"\"\""];
|
||||
|
@ -3790,9 +3799,7 @@ handle_printf_atsign (FILE *stream,
|
|||
#if HAVE_LIBXML
|
||||
#include <Foundation/GSXML.h>
|
||||
|
||||
#ifndef __XML_TREE_H__
|
||||
static int XML_ELEMENT_NODE;
|
||||
#endif
|
||||
|
||||
static void
|
||||
decodeBase64Unit(const char* ptr, unsigned char *out)
|
||||
|
@ -4332,12 +4339,115 @@ nodeToObject(GSXMLNode* node)
|
|||
content = [children content];
|
||||
children = elementNode(children);
|
||||
|
||||
if ([name isEqualToString: @"string"])
|
||||
{
|
||||
return content;
|
||||
}
|
||||
else if ([name isEqualToString: @"key"])
|
||||
if ([name isEqualToString: @"string"]
|
||||
|| [name isEqualToString: @"key"])
|
||||
{
|
||||
NSRange r;
|
||||
|
||||
r = [content rangeOfString: @"\\"];
|
||||
if (r.length == 1)
|
||||
{
|
||||
unsigned len = [content length];
|
||||
unichar buf[len];
|
||||
unsigned pos = r.location;
|
||||
|
||||
[content getCharacters: buf];
|
||||
while (pos < len)
|
||||
{
|
||||
if (++pos < len)
|
||||
{
|
||||
if (buf[pos] == '/')
|
||||
{
|
||||
len--;
|
||||
memcpy(&buf[pos], &buf[pos+1],
|
||||
(len - pos) * sizeof(unichar));
|
||||
}
|
||||
else if (buf[pos] == 'U')
|
||||
{
|
||||
unichar val = 0;
|
||||
unsigned i;
|
||||
|
||||
if (len < pos + 4)
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"Short escape sequence"];
|
||||
}
|
||||
for (i = 1; i < 5; i++)
|
||||
{
|
||||
unichar c = buf[pos + i];
|
||||
|
||||
if (c >= '0' && c <= '9')
|
||||
{
|
||||
val = (val << 4) + c - '0';
|
||||
}
|
||||
else if (c >= 'A' && c <= 'F')
|
||||
{
|
||||
val = (val << 4) + c - 'A' + 10;
|
||||
}
|
||||
else if (c >= 'a' && c <= 'f')
|
||||
{
|
||||
val = (val << 4) + c - 'a' + 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
[NSException raise:
|
||||
NSInternalInconsistencyException
|
||||
format: @"bad hex escape sequence"];
|
||||
}
|
||||
}
|
||||
len -= 5;
|
||||
memcpy(&buf[pos], &buf[pos+5],
|
||||
(len - pos) * sizeof(unichar));
|
||||
buf[pos - 1] = val;
|
||||
}
|
||||
else if (buf[pos] >= '0' && buf[pos] <= '7')
|
||||
{
|
||||
unichar val = 0;
|
||||
unsigned i;
|
||||
|
||||
if (len < pos + 2)
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"Short escape sequence"];
|
||||
}
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
unichar c = buf[pos + i];
|
||||
|
||||
if (c >= '0' && c <= '7')
|
||||
{
|
||||
val = (val << 3) + c - '0';
|
||||
}
|
||||
else
|
||||
{
|
||||
[NSException raise:
|
||||
NSInternalInconsistencyException
|
||||
format: @"bad octal escape sequence"];
|
||||
}
|
||||
}
|
||||
len -= 3;
|
||||
memcpy(&buf[pos], &buf[pos+3],
|
||||
(len - pos) * sizeof(unichar));
|
||||
buf[pos - 1] = val;
|
||||
}
|
||||
else
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"Short escape sequence"];
|
||||
}
|
||||
while (pos < len && buf[pos] != '\\')
|
||||
{
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"Short escape sequence"];
|
||||
}
|
||||
}
|
||||
content = [NSString stringWithCharacters: buf length: len];
|
||||
}
|
||||
return content;
|
||||
}
|
||||
else if ([name isEqualToString: @"true"])
|
||||
|
@ -4408,12 +4518,10 @@ static void
|
|||
setupPl()
|
||||
{
|
||||
#if HAVE_LIBXML
|
||||
#ifndef __XML_TREE_H__
|
||||
/*
|
||||
* Cache XML node information.
|
||||
*/
|
||||
XML_ELEMENT_NODE = [GSXMLNode typeFromDescription: @"XML_ELEMENT_NODE"];
|
||||
#endif
|
||||
#endif
|
||||
plAlloc = (id (*)(id, SEL, NSZone*))
|
||||
[NSStringClass methodForSelector: @selector(allocWithZone:)];
|
||||
|
@ -4453,6 +4561,11 @@ GSPropertyList(NSString *string)
|
|||
return nil;
|
||||
}
|
||||
|
||||
if (plAlloc == 0)
|
||||
{
|
||||
setupPl();
|
||||
}
|
||||
|
||||
#if HAVE_LIBXML
|
||||
if (whitespaceBitmapRep == NULL)
|
||||
{
|
||||
|
@ -4502,10 +4615,6 @@ GSPropertyList(NSString *string)
|
|||
_pld.end = length + 1;
|
||||
_pld.err = nil;
|
||||
_pld.lin = 1;
|
||||
if (plAlloc == 0)
|
||||
{
|
||||
setupPl();
|
||||
}
|
||||
pl = AUTORELEASE(parsePlItem(pld));
|
||||
if (pl == nil && _pld.err != nil)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue