mirror of
https://github.com/TomHarte/CLK.git
synced 2024-10-05 23:56:33 +00:00
Ensures that machine name reaches Swift.
This commit is contained in:
parent
2432151bf8
commit
ed0c4c117b
@ -34,6 +34,7 @@ typedef NS_ENUM(NSInteger, CSMachineKeyboardInputMode) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
@interface CSMissingROM: NSObject
|
@interface CSMissingROM: NSObject
|
||||||
|
@property (nonatomic, readonly, nonnull) NSString *machineName;
|
||||||
@property (nonatomic, readonly, nonnull) NSString *fileName;
|
@property (nonatomic, readonly, nonnull) NSString *fileName;
|
||||||
@property (nonatomic, readonly, nullable) NSString *descriptiveName;
|
@property (nonatomic, readonly, nullable) NSString *descriptiveName;
|
||||||
@property (nonatomic, readonly) NSUInteger size;
|
@property (nonatomic, readonly) NSUInteger size;
|
||||||
|
@ -75,6 +75,7 @@ struct ActivityObserver: public Activity::Observer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
@interface CSMissingROM (Mutability)
|
@interface CSMissingROM (Mutability)
|
||||||
|
@property (nonatomic, nonnull, copy) NSString *machineName;
|
||||||
@property (nonatomic, nonnull, copy) NSString *fileName;
|
@property (nonatomic, nonnull, copy) NSString *fileName;
|
||||||
@property (nonatomic, nullable, copy) NSString *descriptiveName;
|
@property (nonatomic, nullable, copy) NSString *descriptiveName;
|
||||||
@property (nonatomic, readwrite) NSUInteger size;
|
@property (nonatomic, readwrite) NSUInteger size;
|
||||||
@ -82,12 +83,21 @@ struct ActivityObserver: public Activity::Observer {
|
|||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation CSMissingROM {
|
@implementation CSMissingROM {
|
||||||
|
NSString *_machineName;
|
||||||
NSString *_fileName;
|
NSString *_fileName;
|
||||||
NSString *_descriptiveName;
|
NSString *_descriptiveName;
|
||||||
NSUInteger _size;
|
NSUInteger _size;
|
||||||
NSArray<NSNumber *> *_crc32s;
|
NSArray<NSNumber *> *_crc32s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *)machineName {
|
||||||
|
return _machineName;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setMachineName:(NSString *)machineName {
|
||||||
|
_machineName = [machineName copy];
|
||||||
|
}
|
||||||
|
|
||||||
- (NSString *)fileName {
|
- (NSString *)fileName {
|
||||||
return _fileName;
|
return _fileName;
|
||||||
}
|
}
|
||||||
@ -155,8 +165,9 @@ struct ActivityObserver: public Activity::Observer {
|
|||||||
CSMissingROM *rom = [[CSMissingROM alloc] init];
|
CSMissingROM *rom = [[CSMissingROM alloc] init];
|
||||||
|
|
||||||
// Copy/convert the primitive fields.
|
// Copy/convert the primitive fields.
|
||||||
|
rom.machineName = [NSString stringWithUTF8String:missing_rom.machine_name.c_str()];
|
||||||
rom.fileName = [NSString stringWithUTF8String:missing_rom.file_name.c_str()];
|
rom.fileName = [NSString stringWithUTF8String:missing_rom.file_name.c_str()];
|
||||||
rom.descriptiveName = [NSString stringWithUTF8String:missing_rom.descriptive_name.c_str()];
|
rom.descriptiveName = missing_rom.descriptive_name.empty() ? nil : [NSString stringWithUTF8String:missing_rom.descriptive_name.c_str()];
|
||||||
rom.size = missing_rom.size;
|
rom.size = missing_rom.size;
|
||||||
|
|
||||||
// Convert the CRC list.
|
// Convert the CRC list.
|
||||||
|
Loading…
Reference in New Issue
Block a user