//
//  LKFErrorFormat.swift
//  lkfc
//
//  Created by Alexander Holzer on 14.11.21.
//  Copyright © 2021 Alexander Holzer. All rights reserved.
//

import Foundation
@_implementationOnly import LibLKF

public class LKFErrorFormat {
    var ptr: OpaquePointer?
    
    public init (fieldIds:[UInt32]) {
        fieldIds.withUnsafeBufferPointer { unsafe in
            ptr = LibLKF.lkf_createErrorFormat(UInt32 (fieldIds.count), unsafe.baseAddress)
        }
    }
    
    public convenience init (fields:[LKFErrorField]) {
        self.init(fieldIds: fields.map { f in
            f.rawValue
        })
    }
}
