Files
luma/Sources/LumaCore/Models/InstrumentConfigCodec.swift
Ole André Vadla Ravnås 54868d8b9d Extract portable model types into LumaCore
Move pure data types out of Luma/ into Sources/LumaCore/
so they can be shared with the GTK frontend:

- AddressAnchor, CFGGraph, ITraceDecoder (+ all related
  types: TraceEntry, ITraceMetadata, RegisterState, etc.)
- JSInspectValue, SpawnConfig, ProcessModule
- HookPackConfig, HookPackManifest, InstrumentConfigCodec
- InstrumentIcon, InstrumentKind, ConsoleLevel

CFGGraph uses its own Point2D instead of CoreGraphics
types, keeping the core free of Apple frameworks.

Remove premature stubs (Engine, ProcessNode,
InstrumentRuntime, EventStream) that will be properly
built in a later phase once the real implementations
are ready to move.
2026-04-06 19:19:20 +02:00

12 lines
321 B
Swift

import Foundation
public enum InstrumentConfigCodec {
public static func encode<T: Codable>(_ value: T) throws -> Data {
try JSONEncoder().encode(value)
}
public static func decode<T: Codable>(_ type: T.Type, from data: Data) throws -> T {
try JSONDecoder().decode(type, from: data)
}
}