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

View file

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

View file

@ -48,6 +48,20 @@ GS_PRIVATE_INTERNAL(NSByteCountFormatter)
@implementation 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 - (id) init
{ {
@ -59,6 +73,9 @@ GS_PRIVATE_INTERNAL(NSByteCountFormatter)
GS_CREATE_INTERNAL(NSByteCountFormatter); GS_CREATE_INTERNAL(NSByteCountFormatter);
internal->_countStyle = NSByteCountFormatterCountStyleFile;
internal->_allowedUnits |= NSByteCountFormatterUseMB;
return self; return self;
} }