mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-24 00:00:05 +08:00
Wrap server entry
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// OpenVPNServerEntry+Internal.h
|
||||
// OpenVPN Adapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 26.04.17.
|
||||
//
|
||||
//
|
||||
|
||||
#import <client/ovpncli.hpp>
|
||||
|
||||
#import "OpenVPNServerEntry.h"
|
||||
|
||||
using namespace openvpn;
|
||||
|
||||
@interface OpenVPNServerEntry (Internal)
|
||||
|
||||
- (instancetype)initWithServerEntry:(ClientAPI::ServerEntry)entry;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// OpenVPNServerEntry.h
|
||||
// OpenVPN Adapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 26.04.17.
|
||||
//
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface OpenVPNServerEntry : NSObject
|
||||
|
||||
@property (nullable, readonly, nonatomic) NSString *server;
|
||||
@property (nullable, readonly, nonatomic) NSString *friendlyName;
|
||||
|
||||
- (nonnull instancetype) __unavailable init;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// OpenVPNServerEntry.mm
|
||||
// OpenVPN Adapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 26.04.17.
|
||||
//
|
||||
//
|
||||
|
||||
#import "OpenVPNServerEntry.h"
|
||||
#import "OpenVPNServerEntry+Internal.h"
|
||||
|
||||
@implementation OpenVPNServerEntry
|
||||
|
||||
- (instancetype)initWithServerEntry:(ClientAPI::ServerEntry)entry {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_server = !entry.server.empty() ? [NSString stringWithUTF8String:entry.server.c_str()] : nil;
|
||||
_friendlyName = !entry.friendlyName.empty() ? [NSString stringWithUTF8String:entry.friendlyName.c_str()] : nil;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -20,7 +20,9 @@ FOUNDATION_EXPORT const unsigned char OpenVPNAdapterVersionString[];
|
||||
#import <OpenVPNAdapter/OpenVPNEvent.h>
|
||||
#import <OpenVPNAdapter/OpenVPNConfiguration.h>
|
||||
#import <OpenVPNAdapter/OpenVPNCredentials.h>
|
||||
#import <OpenVPNAdapter/OpenVPNServerEntry.h>
|
||||
#import <OpenVPNAdapter/OpenVPNConnectionInfo.h>
|
||||
#import <OpenVPNAdapter/OpenVPNTransportStats.h>
|
||||
#import <OpenVPNAdapter/OpenVPNInterfaceStats.h>
|
||||
#import <OpenVPNAdapter/OpenVPNAdapter.h>
|
||||
#import <OpenVPNAdapter/OpenVPNAdapter+Public.h>
|
||||
|
||||
Reference in New Issue
Block a user