mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Changed cStringNoCopy to cString
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3105 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ec5df7b10a
commit
bebb8238e5
4 changed files with 17 additions and 7 deletions
|
@ -1,4 +1,6 @@
|
|||
/* A demonstration of writing and reading GNU Objective C objects to a file. */
|
||||
// Fri Oct 23 03:01:09 MET DST 1998 dave@turbocat.de
|
||||
// cStringNoCopy -> cString
|
||||
|
||||
#include <gnustep/base/Archiver.h>
|
||||
#include <gnustep/base/BinaryCStream.h>
|
||||
|
@ -70,14 +72,14 @@ int main(int argc, char *argv[])
|
|||
/* Read in the Array */
|
||||
[archiver decodeObjectAt: &array withName: &name];
|
||||
if (name)
|
||||
printf ("got object named %s\n", [name cStringNoCopy]);
|
||||
printf ("got object named %s\n", [name cString]);
|
||||
else
|
||||
printf ("got object named (unnamed)\n");
|
||||
|
||||
/* Read in the Dictionary */
|
||||
[archiver decodeObjectAt: &dictionary withName: &name];
|
||||
if (name)
|
||||
printf ("got object named %s\n", [name cStringNoCopy]);
|
||||
printf ("got object named %s\n", [name cString]);
|
||||
else
|
||||
printf ("got object named (unnamed)\n");
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/* A demonstration of writing and reading with NSArchiver */
|
||||
// Fri Oct 23 03:02:04 MET DST 1998 dave@turbocat.de
|
||||
// cStringNoCopy -> cString
|
||||
|
||||
#if 1
|
||||
|
||||
|
@ -30,7 +32,7 @@ int main()
|
|||
{
|
||||
id o, e = [set objectEnumerator];
|
||||
while ((o = [e nextObject]))
|
||||
printf("%s\n", [o cStringNoCopy]);
|
||||
printf("%s\n", [o cString]);
|
||||
}
|
||||
|
||||
apl = [[NSAutoreleasePool alloc] init];
|
||||
|
@ -68,7 +70,7 @@ printf("%u\n", [arc retainCount]);
|
|||
{
|
||||
id o, e = [set objectEnumerator];
|
||||
while ((o = [e nextObject]))
|
||||
printf("%s\n", [o cStringNoCopy]);
|
||||
printf("%s\n", [o cString]);
|
||||
}
|
||||
|
||||
/* Do the autorelease. */
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Fri Oct 23 03:02:52 MET DST 1998 dave@turbocat.de
|
||||
// cStringNoCopy -> cString
|
||||
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSHost.h>
|
||||
|
@ -12,10 +15,10 @@ displayHost(NSHost* h)
|
|||
printf("\n");
|
||||
a = [h names];
|
||||
for (i = 0; i < [a count]; i++)
|
||||
printf("%s\n", [[a objectAtIndex:i] cStringNoCopy]);
|
||||
printf("%s\n", [[a objectAtIndex:i] cString]);
|
||||
a = [h addresses];
|
||||
for (i = 0; i < [a count]; i++)
|
||||
printf("%s\n", [[a objectAtIndex:i] cStringNoCopy]);
|
||||
printf("%s\n", [[a objectAtIndex:i] cString]);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
#include <Foundation/NSString.h>
|
||||
|
||||
// Fri Oct 23 02:58:47 MET DST 1998 dave@turbocat.de
|
||||
// cStringNoCopy -> cString
|
||||
|
||||
/* For demo of Strings as Collections of char's. */
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSAutoreleasePool.h>
|
||||
|
@ -7,7 +10,7 @@
|
|||
void
|
||||
print_string(NSString* s)
|
||||
{
|
||||
printf("The string [%s], length %d\n", [s cStringNoCopy], [s length]);
|
||||
printf("The string [%s], length %d\n", [s cString], [s length]);
|
||||
}
|
||||
|
||||
#include <Foundation/NSString.h>
|
||||
|
|
Loading…
Reference in a new issue