mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 17:10:48 +00:00
(-getBytes:range:): Implemented.
(-isEqual:): New method. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@348 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7678bfaab6
commit
9a3802acdc
1 changed files with 9 additions and 2 deletions
|
@ -71,7 +71,7 @@
|
|||
return [self initWithBytesNoCopy:buf length:length];
|
||||
}
|
||||
|
||||
/* This is one of the designated initializer for NSData */
|
||||
/* This is one of the designated initializers for NSData */
|
||||
- (id) initWithBytesNoCopy: (void*)bytes
|
||||
length: (unsigned int)length
|
||||
{
|
||||
|
@ -125,7 +125,8 @@
|
|||
- (void)getBytes: (void*)buffer
|
||||
range: (NSRange)aRange
|
||||
{
|
||||
[self notImplemented:_cmd];
|
||||
/* xxx need to do range checking */
|
||||
memcpy(buffer, [self bytes] + aRange.location, aRange.length);
|
||||
}
|
||||
|
||||
- (NSData*) subdataWithRange: (NSRange)aRange
|
||||
|
@ -134,6 +135,12 @@
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (BOOL) isEqual: anObject
|
||||
{
|
||||
if ([anObject isKindOf:[NSData class]])
|
||||
return [self isEqualToData:anObject];
|
||||
return NO;
|
||||
}
|
||||
|
||||
// Querying a Data Object
|
||||
- (BOOL) isEqualToData: (NSData*)other;
|
||||
|
|
Loading…
Reference in a new issue