mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Range updates
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/freeze-1_0_0@9493 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
feae94c21d
commit
be2f7d723a
3 changed files with 54 additions and 2 deletions
|
@ -179,7 +179,7 @@
|
|||
</list>
|
||||
</section>
|
||||
<section>
|
||||
<heading>The OpenStep functions</heading>
|
||||
<heading>The OpenStep functions and types</heading>
|
||||
<list>
|
||||
<item><uref url="NSFunctions.html">Functions</uref></item>
|
||||
</list>
|
||||
|
|
|
@ -12,7 +12,39 @@
|
|||
</head>
|
||||
<body>
|
||||
<chapter>
|
||||
<heading>NSFunctions</heading>
|
||||
<heading>Functions</heading>
|
||||
</chapter>
|
||||
<chapter>
|
||||
<heading>Types</heading>
|
||||
<type name="NSRange">
|
||||
<typespec>
|
||||
struct { unsigned long location; unsigned long length; }
|
||||
</typespec>
|
||||
<declared>Foundation/NSRange.h</declared>
|
||||
<desc>
|
||||
<p>
|
||||
The NSRange type is used to specify ranges of locations,
|
||||
typically items in an array, characters in a string, and bytes
|
||||
in a data object.
|
||||
</p>
|
||||
<p>
|
||||
As 'boundary' or 'fencepost' errors are a particularly common
|
||||
problem in programming, it is important that you understand
|
||||
how an NSRange works.
|
||||
</p>
|
||||
<p>
|
||||
An NSRange consists of a location and a length. The points
|
||||
that are considered to lie in a range are the integers from
|
||||
the location to the location plus the length, so the number
|
||||
of points in a range is the length of the range plus one.<br />
|
||||
However, if you consider these points like the marks on a
|
||||
ruler, you can only store information <strong>between</strong>
|
||||
points. So the number of items that can be stored in a range
|
||||
is the length of the range.
|
||||
</p>
|
||||
</desc>
|
||||
<standards><OpenStep/><MacOS-X/><GNUstep/></standards>
|
||||
</type>
|
||||
</chapter>
|
||||
</body>
|
||||
</gsdoc>
|
||||
|
|
|
@ -71,6 +71,16 @@
|
|||
<method type="void*">
|
||||
<sel>mutableBytes</sel>
|
||||
<desc>
|
||||
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.
|
||||
</desc>
|
||||
</method>
|
||||
<method type="void">
|
||||
|
@ -79,6 +89,16 @@
|
|||
<sel>withBytes:</sel>
|
||||
<arg type="const void*">bytes</arg>
|
||||
<desc>
|
||||
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.
|
||||
</desc>
|
||||
</method>
|
||||
<method type="void">
|
||||
|
|
Loading…
Reference in a new issue