mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-01-31 00:00:06 +08:00
Wrap file content property
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
// TODO: Wrap ClientAPI::Config into Objective-C class
|
||||
|
||||
@interface OpenVPNConfiguration : NSObject
|
||||
|
||||
@property (nullable, nonatomic) NSData *fileContent;
|
||||
|
||||
@end
|
||||
|
||||
@@ -25,5 +25,12 @@
|
||||
|
||||
@implementation OpenVPNConfiguration
|
||||
|
||||
-(NSData *)fileContent {
|
||||
return _config.content.size() != 0 ? [NSData dataWithBytes:_config.content.data() length:_config.content.size()] : nil;
|
||||
}
|
||||
|
||||
- (void)setFileContent:(NSData *)fileContent {
|
||||
_config.content = fileContent != nil ? std::string((const char *)fileContent.bytes) : "";
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user