Merge branch 'master' of ssh://github.com/gnustep/libs-base

This commit is contained in:
Richard Frith-Macdonald 2020-06-23 07:05:34 +01:00
commit 8acf2a5304
5 changed files with 48 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2020-06-14 Gregory John Casamento <greg.casamento@gmail.com>
* Headers/Foundation/NSKeyedArchiver.h
* Source/NSKeyedArchiver.m
* Source/NSKeyedUnarchiver.m: Add setter for requiresSecureCoding.
2020-06-11 Frederik Seiffert <frederik@algoriddim.com>
* Source/NSValueTransformer.m:

View file

@ -70,6 +70,7 @@ extern "C" {
NSMutableDictionary *_enc; /* Object being encoded. */
NSMutableArray *_obj; /* Array of objects. */
NSPropertyListFormat _format;
BOOL _requiresSecureCoding;
#endif
#if GS_NONFRAGILE
#else
@ -121,6 +122,18 @@ extern "C" {
*/
+ (void) setClassName: (NSString*)aString forClass: (Class)aClass;
/**
* Returns whether the current instance of the archiver needs secure
* coding.
*/
- (BOOL) requiresSecureCoding;
/**
* Sets whether the current instance of the archiver needs secure
* coding.
*/
- (void) setRequiresSecureCoding: (BOOL)flag;
/**
* Returns any mapping for the name of aClass which was previously set
* for the receiver using the -setClassName:forClass: method.<br />
@ -257,6 +270,7 @@ extern "C" {
#undef GSIArray
#endif
NSZone *_zone; /* Zone for allocating objs. */
BOOL _requiresSecureCoding;
#endif
#if GS_NONFRAGILE
#else
@ -295,6 +309,18 @@ extern "C" {
*/
+ (id) unarchiveObjectWithFile: (NSString*)aPath;
/**
* Returns whether the current instance of the archiver needs secure
* coding.
*/
- (BOOL) requiresSecureCoding;
/**
* Sets whether the current instance of the archiver needs secure
* coding.
*/
- (void) setRequiresSecureCoding: (BOOL)flag;
/**
* Returns class substituted for class name specified by aString when
* encountered in the archive being decoded from, or nil if there is no
@ -302,7 +328,7 @@ extern "C" {
* translation map, which is searched on decoding if no match found here.
*/
- (Class) classForClassName: (NSString*)aString;
/**
* Sets class substituted for class name specified by aString when
* encountered in the archive being decoded from, or nil if there is no

View file

@ -517,6 +517,16 @@ static NSDictionary *makeReference(unsigned ref)
}
}
- (BOOL) requiresSecureCoding
{
return _requiresSecureCoding;
}
- (void) setRequiresSecureCoding: (BOOL)flag
{
_requiresSecureCoding = flag;
}
- (BOOL) allowsKeyedCoding
{
return YES;

View file

@ -367,12 +367,12 @@ static NSMapTable *globalClassMap = 0;
- (BOOL)requiresSecureCoding
{
return NO;
return _requiresSecureCoding;
}
- (void)setRequiresSecureCoding: (BOOL)secure
{
return;
_requiresSecureCoding = secure;
}
- (Class) classForClassName: (NSString*)aString

View file

@ -141,6 +141,9 @@ int main()
s = makeFormattedString(@"%d.%d%s", 10, 20, "hello");
PASS_EQUAL(s, @"10.20hello", "simple intWithFormat: works");
PASS([@"" isEqual: nil] == NO, "an empty string is not null");
PASS([@"" isEqualToString: nil] == NO, "an empty string is not null");
[arp release]; arp = nil;
return 0;
}