Correct names in test output. Add initial coding in formatter

This commit is contained in:
Gregory John Casamento 2019-07-19 06:22:30 -04:00
parent e26b902801
commit a8658d172f
3 changed files with 23 additions and 2 deletions

View file

@ -17,7 +17,6 @@ Missing headers:
<NSAppleEventDescriptor.h>
<NSAppleEventManager.h>
<NSAppleScript.h>
<NSByteCountFormatter.h>
<NSFileCoordinator.h>
<NSFilePresenter.h>
<NSFileVersion.h>
@ -41,7 +40,6 @@ Missing headers:
-------------------------------------------------------------
Foundation:
<NSOrthography.h>
<NSByteCountFormatter.h>
<NSFileCoordinator.h>
<NSFilePresenter.h>
<NSFileVersion.h>

View file

@ -111,6 +111,12 @@ GS_NSByteCountFormatter_IVARS;
- (NSString *)stringForObjectValue: (id)obj;
- (NSString *)stringFromMeasurement
*/
- (NSString *)stringFromByteCount: (long long)byteCount;
+ (NSString *)stringFromByteCount: (long long)byteCount
countStyle: (NSByteCountFormatterCountStyle)countStyle;
@end
#if defined(__cplusplus)

View file

@ -49,6 +49,20 @@ GS_PRIVATE_INTERNAL(NSByteCountFormatter)
@implementation NSByteCountFormatter
+ (NSString *)stringFromByteCount: (long long)byteCount
countStyle: (NSByteCountFormatterCountStyle)countStyle
{
NSByteCountFormatter *formatter = [[NSByteCountFormatter alloc] init];
[formatter setCountStyle: countStyle];
return [formatter stringFromByteCount: byteCount];
}
- (NSString *)stringFromByteCount: (long long)byteCount
{
return nil;
}
- (id) init
{
self = [super init];
@ -59,6 +73,9 @@ GS_PRIVATE_INTERNAL(NSByteCountFormatter)
GS_CREATE_INTERNAL(NSByteCountFormatter);
internal->_countStyle = NSByteCountFormatterCountStyleFile;
internal->_allowedUnits |= NSByteCountFormatterUseMB;
return self;
}