mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 09:41:15 +00:00
Correct names in test output. Add initial coding in formatter
This commit is contained in:
parent
e26b902801
commit
a8658d172f
3 changed files with 23 additions and 2 deletions
|
@ -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>
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -48,6 +48,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
|
||||
{
|
||||
|
@ -59,6 +73,9 @@ GS_PRIVATE_INTERNAL(NSByteCountFormatter)
|
|||
|
||||
GS_CREATE_INTERNAL(NSByteCountFormatter);
|
||||
|
||||
internal->_countStyle = NSByteCountFormatterCountStyleFile;
|
||||
internal->_allowedUnits |= NSByteCountFormatterUseMB;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue