use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
pub type TKTLVTag = u64;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct TKTLVRecord;
);
extern_conformance!(
unsafe impl NSObjectProtocol for TKTLVRecord {}
);
impl TKTLVRecord {
extern_methods!(
#[unsafe(method(tag))]
#[unsafe(method_family = none)]
pub unsafe fn tag(&self) -> TKTLVTag;
#[unsafe(method(value))]
#[unsafe(method_family = none)]
pub unsafe fn value(&self) -> Retained<NSData>;
#[unsafe(method(data))]
#[unsafe(method_family = none)]
pub unsafe fn data(&self) -> Retained<NSData>;
#[unsafe(method(recordFromData:))]
#[unsafe(method_family = none)]
pub unsafe fn recordFromData(data: &NSData) -> Option<Retained<Self>>;
#[unsafe(method(sequenceOfRecordsFromData:))]
#[unsafe(method_family = none)]
pub unsafe fn sequenceOfRecordsFromData(
data: &NSData,
) -> Option<Retained<NSArray<TKTLVRecord>>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl TKTLVRecord {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(TKTLVRecord, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct TKBERTLVRecord;
);
extern_conformance!(
unsafe impl NSObjectProtocol for TKBERTLVRecord {}
);
impl TKBERTLVRecord {
extern_methods!(
#[unsafe(method(dataForTag:))]
#[unsafe(method_family = none)]
pub unsafe fn dataForTag(tag: TKTLVTag) -> Retained<NSData>;
#[unsafe(method(initWithTag:value:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithTag_value(
this: Allocated<Self>,
tag: TKTLVTag,
value: &NSData,
) -> Retained<Self>;
#[unsafe(method(initWithTag:records:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithTag_records(
this: Allocated<Self>,
tag: TKTLVTag,
records: &NSArray<TKTLVRecord>,
) -> Retained<Self>;
);
}
impl TKBERTLVRecord {
extern_methods!(
#[unsafe(method(recordFromData:))]
#[unsafe(method_family = none)]
pub unsafe fn recordFromData(data: &NSData) -> Option<Retained<Self>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl TKBERTLVRecord {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(TKTLVRecord, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct TKSimpleTLVRecord;
);
extern_conformance!(
unsafe impl NSObjectProtocol for TKSimpleTLVRecord {}
);
impl TKSimpleTLVRecord {
extern_methods!(
#[unsafe(method(initWithTag:value:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithTag_value(
this: Allocated<Self>,
tag: u8,
value: &NSData,
) -> Retained<Self>;
);
}
impl TKSimpleTLVRecord {
extern_methods!(
#[unsafe(method(recordFromData:))]
#[unsafe(method_family = none)]
pub unsafe fn recordFromData(data: &NSData) -> Option<Retained<Self>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl TKSimpleTLVRecord {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(TKTLVRecord, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct TKCompactTLVRecord;
);
extern_conformance!(
unsafe impl NSObjectProtocol for TKCompactTLVRecord {}
);
impl TKCompactTLVRecord {
extern_methods!(
#[unsafe(method(initWithTag:value:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithTag_value(
this: Allocated<Self>,
tag: u8,
value: &NSData,
) -> Retained<Self>;
);
}
impl TKCompactTLVRecord {
extern_methods!(
#[unsafe(method(recordFromData:))]
#[unsafe(method_family = none)]
pub unsafe fn recordFromData(data: &NSData) -> Option<Retained<Self>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl TKCompactTLVRecord {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}