547 lines
27 KiB
Swift
547 lines
27 KiB
Swift
// automatically generated by the FlatBuffers compiler, do not modify
|
|
// swiftlint:disable all
|
|
// swiftformat:disable all
|
|
|
|
#if canImport(Common)
|
|
import Common
|
|
#endif
|
|
|
|
import FlatBuffers
|
|
|
|
public enum Format: Int8, FlatbuffersVectorInitializable, Enum, Verifiable {
|
|
public typealias T = Int8
|
|
public static var byteSize: Int { return MemoryLayout<Int8>.size }
|
|
public var value: Int8 { return self.rawValue }
|
|
case manga = 0
|
|
case novel = 1
|
|
case oneshot = 2
|
|
|
|
public static var max: Format { return .oneshot }
|
|
public static var min: Format { return .manga }
|
|
}
|
|
|
|
|
|
public enum Status: Int8, FlatbuffersVectorInitializable, Enum, Verifiable {
|
|
public typealias T = Int8
|
|
public static var byteSize: Int { return MemoryLayout<Int8>.size }
|
|
public var value: Int8 { return self.rawValue }
|
|
case finished = 0
|
|
case releasing = 1
|
|
case hiatus = 2
|
|
case notyetreleased = 3
|
|
case cancelled = 4
|
|
|
|
public static var max: Status { return .cancelled }
|
|
public static var min: Status { return .finished }
|
|
}
|
|
|
|
|
|
public enum PublicationDemographic: Int8, FlatbuffersVectorInitializable, Enum, Verifiable {
|
|
public typealias T = Int8
|
|
public static var byteSize: Int { return MemoryLayout<Int8>.size }
|
|
public var value: Int8 { return self.rawValue }
|
|
case shounen = 0
|
|
case shoujou = 1
|
|
case seinen = 2
|
|
case josei = 3
|
|
|
|
public static var max: PublicationDemographic { return .josei }
|
|
public static var min: PublicationDemographic { return .shounen }
|
|
}
|
|
|
|
|
|
public enum Source: Int8, FlatbuffersVectorInitializable, Enum, Verifiable {
|
|
public typealias T = Int8
|
|
public static var byteSize: Int { return MemoryLayout<Int8>.size }
|
|
public var value: Int8 { return self.rawValue }
|
|
case original = 0
|
|
case manga = 1
|
|
case lightnovel = 2
|
|
case visualnovel = 3
|
|
case videogame = 4
|
|
case other = 5
|
|
case novel = 6
|
|
case doujinshi = 7
|
|
case anime = 8
|
|
case webnovel = 9
|
|
case liveaction = 10
|
|
case game = 11
|
|
case comic = 12
|
|
case multimediaproject = 13
|
|
case picturebook = 14
|
|
|
|
public static var max: Source { return .picturebook }
|
|
public static var min: Source { return .original }
|
|
}
|
|
|
|
|
|
public enum ContentRating: Int8, FlatbuffersVectorInitializable, Enum, Verifiable {
|
|
public typealias T = Int8
|
|
public static var byteSize: Int { return MemoryLayout<Int8>.size }
|
|
public var value: Int8 { return self.rawValue }
|
|
case safe = 0
|
|
case suggestive = 1
|
|
case erotica = 2
|
|
case pornographic = 3
|
|
|
|
public static var max: ContentRating { return .pornographic }
|
|
public static var min: ContentRating { return .safe }
|
|
}
|
|
|
|
|
|
public enum TagType: Int8, FlatbuffersVectorInitializable, Enum, Verifiable {
|
|
public typealias T = Int8
|
|
public static var byteSize: Int { return MemoryLayout<Int8>.size }
|
|
public var value: Int8 { return self.rawValue }
|
|
case format = 0
|
|
case genre = 1
|
|
case theme = 2
|
|
case content = 3
|
|
|
|
public static var max: TagType { return .content }
|
|
public static var min: TagType { return .format }
|
|
}
|
|
|
|
|
|
public struct MetaValue: NativeStruct, FlatbuffersVectorInitializable, Verifiable, FlatbuffersInitializable {
|
|
|
|
static func validateVersion() { FlatBuffersVersion_25_12_19() }
|
|
|
|
private var _main: UInt32
|
|
private var _bonus: UInt32
|
|
|
|
public init(_ bb: ByteBuffer, o: Int32) {
|
|
self = bb.read(def: Self.self, position: Int(o))
|
|
}
|
|
|
|
public init(main: UInt32, bonus: UInt32) {
|
|
_main = main
|
|
_bonus = bonus
|
|
}
|
|
|
|
public init() {
|
|
_main = 0
|
|
_bonus = 0
|
|
}
|
|
|
|
public var main: UInt32 { _main }
|
|
public var bonus: UInt32 { _bonus }
|
|
|
|
public static func verify<T>(_ verifier: inout Verifier, at position: Int, of type: T.Type) throws where T: Verifiable {
|
|
try verifier.inBuffer(position: position, of: MetaValue.self)
|
|
}
|
|
}
|
|
|
|
public struct MetaValue_Mutable: FlatBufferStruct, FlatbuffersVectorInitializable {
|
|
|
|
static func validateVersion() { FlatBuffersVersion_25_12_19() }
|
|
public var __buffer: ByteBuffer! { return _accessor.bb }
|
|
private var _accessor: Struct
|
|
|
|
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Struct(bb: bb, position: o) }
|
|
|
|
public var main: UInt32 { return _accessor.readBuffer(of: UInt32.self, at: 0) }
|
|
public var bonus: UInt32 { return _accessor.readBuffer(of: UInt32.self, at: 4) }
|
|
}
|
|
|
|
public struct Date: NativeStruct, FlatbuffersVectorInitializable, Verifiable, FlatbuffersInitializable {
|
|
|
|
static func validateVersion() { FlatBuffersVersion_25_12_19() }
|
|
|
|
private var _year: UInt16
|
|
private var _month: UInt8
|
|
private var _day: UInt8
|
|
|
|
public init(_ bb: ByteBuffer, o: Int32) {
|
|
self = bb.read(def: Self.self, position: Int(o))
|
|
}
|
|
|
|
public init(year: UInt16, month: UInt8, day: UInt8) {
|
|
_year = year
|
|
_month = month
|
|
_day = day
|
|
}
|
|
|
|
public init() {
|
|
_year = 0
|
|
_month = 0
|
|
_day = 0
|
|
}
|
|
|
|
public var year: UInt16 { _year }
|
|
public var month: UInt8 { _month }
|
|
public var day: UInt8 { _day }
|
|
|
|
public static func verify<T>(_ verifier: inout Verifier, at position: Int, of type: T.Type) throws where T: Verifiable {
|
|
try verifier.inBuffer(position: position, of: Date.self)
|
|
}
|
|
}
|
|
|
|
public struct Date_Mutable: FlatBufferStruct, FlatbuffersVectorInitializable {
|
|
|
|
static func validateVersion() { FlatBuffersVersion_25_12_19() }
|
|
public var __buffer: ByteBuffer! { return _accessor.bb }
|
|
private var _accessor: Struct
|
|
|
|
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Struct(bb: bb, position: o) }
|
|
|
|
public var year: UInt16 { return _accessor.readBuffer(of: UInt16.self, at: 0) }
|
|
public var month: UInt8 { return _accessor.readBuffer(of: UInt8.self, at: 2) }
|
|
public var day: UInt8 { return _accessor.readBuffer(of: UInt8.self, at: 3) }
|
|
}
|
|
|
|
public struct Size: NativeStruct, FlatbuffersVectorInitializable, Verifiable, FlatbuffersInitializable {
|
|
|
|
static func validateVersion() { FlatBuffersVersion_25_12_19() }
|
|
|
|
private var _width: UInt32
|
|
private var _height: UInt32
|
|
|
|
public init(_ bb: ByteBuffer, o: Int32) {
|
|
self = bb.read(def: Self.self, position: Int(o))
|
|
}
|
|
|
|
public init(width: UInt32, height: UInt32) {
|
|
_width = width
|
|
_height = height
|
|
}
|
|
|
|
public init() {
|
|
_width = 0
|
|
_height = 0
|
|
}
|
|
|
|
public var width: UInt32 { _width }
|
|
public var height: UInt32 { _height }
|
|
|
|
public static func verify<T>(_ verifier: inout Verifier, at position: Int, of type: T.Type) throws where T: Verifiable {
|
|
try verifier.inBuffer(position: position, of: Size.self)
|
|
}
|
|
}
|
|
|
|
public struct Size_Mutable: FlatBufferStruct, FlatbuffersVectorInitializable {
|
|
|
|
static func validateVersion() { FlatBuffersVersion_25_12_19() }
|
|
public var __buffer: ByteBuffer! { return _accessor.bb }
|
|
private var _accessor: Struct
|
|
|
|
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Struct(bb: bb, position: o) }
|
|
|
|
public var width: UInt32 { return _accessor.readBuffer(of: UInt32.self, at: 0) }
|
|
public var height: UInt32 { return _accessor.readBuffer(of: UInt32.self, at: 4) }
|
|
}
|
|
|
|
public struct Tag: FlatBufferTable, FlatbuffersVectorInitializable, Verifiable {
|
|
|
|
static func validateVersion() { FlatBuffersVersion_25_12_19() }
|
|
public var __buffer: ByteBuffer! { return _accessor.bb }
|
|
private var _accessor: Table
|
|
|
|
private init(_ t: Table) { _accessor = t }
|
|
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) }
|
|
|
|
private struct VT {
|
|
static let type: VOffset = 4
|
|
static let value: VOffset = 6
|
|
}
|
|
|
|
public var type: TagType { let o = _accessor.offset(VT.type); return o == 0 ? .format : TagType(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? .format }
|
|
public var value: String? { let o = _accessor.offset(VT.value); return o == 0 ? nil : _accessor.string(at: o) }
|
|
public var valueSegmentArray: [UInt8]? { return _accessor.getVector(at: VT.value) }
|
|
public static func startTag(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 2) }
|
|
public static func add(type: TagType, _ fbb: inout FlatBufferBuilder) { fbb.add(element: type.rawValue, def: 0, at: VT.type) }
|
|
public static func add(value: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: value, at: VT.value) }
|
|
public static func endTag(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset { let end = Offset(offset: fbb.endTable(at: start)); return end }
|
|
public static func createTag(
|
|
_ fbb: inout FlatBufferBuilder,
|
|
type: TagType = .format,
|
|
valueOffset value: Offset = Offset()
|
|
) -> Offset {
|
|
let __start = Tag.startTag(&fbb)
|
|
Tag.add(type: type, &fbb)
|
|
Tag.add(value: value, &fbb)
|
|
return Tag.endTag(&fbb, start: __start)
|
|
}
|
|
|
|
public static func verify<T>(_ verifier: inout Verifier, at position: Int, of type: T.Type) throws where T: Verifiable {
|
|
var _v = try verifier.visitTable(at: position)
|
|
try _v.visit(field: VT.type, fieldName: "type", required: false, type: TagType.self)
|
|
try _v.visit(field: VT.value, fieldName: "value", required: false, type: ForwardOffset<String>.self)
|
|
_v.finish()
|
|
}
|
|
}
|
|
|
|
public struct ImageMetadata: FlatBufferTable, FlatbuffersVectorInitializable, Verifiable {
|
|
|
|
static func validateVersion() { FlatBuffersVersion_25_12_19() }
|
|
public var __buffer: ByteBuffer! { return _accessor.bb }
|
|
private var _accessor: Table
|
|
|
|
private init(_ t: Table) { _accessor = t }
|
|
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) }
|
|
|
|
private struct VT {
|
|
static let doublePage: VOffset = 4
|
|
static let filename: VOffset = 6
|
|
static let firstPage: VOffset = 8
|
|
static let size: VOffset = 10
|
|
}
|
|
|
|
public var doublePage: Bool { let o = _accessor.offset(VT.doublePage); return o == 0 ? false : _accessor.readBuffer(of: Bool.self, at: o) }
|
|
public var filename: String! { let o = _accessor.offset(VT.filename); return _accessor.string(at: o) }
|
|
public var filenameSegmentArray: [UInt8]! { return _accessor.getVector(at: VT.filename) }
|
|
public var firstPage: UInt32 { let o = _accessor.offset(VT.firstPage); return o == 0 ? 0 : _accessor.readBuffer(of: UInt32.self, at: o) }
|
|
public var size: Size! { let o = _accessor.offset(VT.size); return _accessor.readBuffer(of: Size.self, at: o) }
|
|
public var mutableSize: Size_Mutable! { let o = _accessor.offset(VT.size); return Size_Mutable(_accessor.bb, o: o + _accessor.position) }
|
|
public static func startImageMetadata(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 4) }
|
|
public static func add(doublePage: Bool, _ fbb: inout FlatBufferBuilder) { fbb.add(element: doublePage, def: false,
|
|
at: VT.doublePage) }
|
|
public static func add(filename: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: filename, at: VT.filename) }
|
|
public static func add(firstPage: UInt32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: firstPage, def: 0, at: VT.firstPage) }
|
|
public static func add(size: Size?, _ fbb: inout FlatBufferBuilder) { guard let size = size else { return }; fbb.create(struct: size, position: VT.size) }
|
|
public static func endImageMetadata(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset { let end = Offset(offset: fbb.endTable(at: start)); fbb.require(table: end, fields: [6, 10]); return end }
|
|
public static func createImageMetadata(
|
|
_ fbb: inout FlatBufferBuilder,
|
|
doublePage: Bool = false,
|
|
filenameOffset filename: Offset,
|
|
firstPage: UInt32 = 0,
|
|
size: Size
|
|
) -> Offset {
|
|
let __start = ImageMetadata.startImageMetadata(&fbb)
|
|
ImageMetadata.add(doublePage: doublePage, &fbb)
|
|
ImageMetadata.add(filename: filename, &fbb)
|
|
ImageMetadata.add(firstPage: firstPage, &fbb)
|
|
ImageMetadata.add(size: size, &fbb)
|
|
return ImageMetadata.endImageMetadata(&fbb, start: __start)
|
|
}
|
|
|
|
public static func verify<T>(_ verifier: inout Verifier, at position: Int, of type: T.Type) throws where T: Verifiable {
|
|
var _v = try verifier.visitTable(at: position)
|
|
try _v.visit(field: VT.doublePage, fieldName: "doublePage", required: false, type: Bool.self)
|
|
try _v.visit(field: VT.filename, fieldName: "filename", required: true, type: ForwardOffset<String>.self)
|
|
try _v.visit(field: VT.firstPage, fieldName: "firstPage", required: false, type: UInt32.self)
|
|
try _v.visit(field: VT.size, fieldName: "size", required: true, type: Size.self)
|
|
_v.finish()
|
|
}
|
|
}
|
|
|
|
public struct ChapterMetadata: FlatBufferTable, FlatbuffersVectorInitializable, Verifiable {
|
|
|
|
static func validateVersion() { FlatBuffersVersion_25_12_19() }
|
|
public var __buffer: ByteBuffer! { return _accessor.bb }
|
|
private var _accessor: Table
|
|
|
|
private init(_ t: Table) { _accessor = t }
|
|
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) }
|
|
|
|
private struct VT {
|
|
static let chapter: VOffset = 4
|
|
static let name: VOffset = 6
|
|
static let images: VOffset = 8
|
|
}
|
|
|
|
public var chapter: MetaValue! { let o = _accessor.offset(VT.chapter); return _accessor.readBuffer(of: MetaValue.self, at: o) }
|
|
public var mutableChapter: MetaValue_Mutable! { let o = _accessor.offset(VT.chapter); return MetaValue_Mutable(_accessor.bb, o: o + _accessor.position) }
|
|
public var name: String? { let o = _accessor.offset(VT.name); return o == 0 ? nil : _accessor.string(at: o) }
|
|
public var nameSegmentArray: [UInt8]? { return _accessor.getVector(at: VT.name) }
|
|
public var images: FlatbufferVector<ImageMetadata> { return _accessor.vector(at: VT.images, byteSize: 4) }
|
|
public static func startChapterMetadata(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 3) }
|
|
public static func add(chapter: MetaValue?, _ fbb: inout FlatBufferBuilder) { guard let chapter = chapter else { return }; fbb.create(struct: chapter, position: VT.chapter) }
|
|
public static func add(name: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: name, at: VT.name) }
|
|
public static func addVectorOf(images: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: images, at: VT.images) }
|
|
public static func endChapterMetadata(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset { let end = Offset(offset: fbb.endTable(at: start)); fbb.require(table: end, fields: [4]); return end }
|
|
public static func createChapterMetadata(
|
|
_ fbb: inout FlatBufferBuilder,
|
|
chapter: MetaValue,
|
|
nameOffset name: Offset = Offset(),
|
|
imagesVectorOffset images: Offset = Offset()
|
|
) -> Offset {
|
|
let __start = ChapterMetadata.startChapterMetadata(&fbb)
|
|
ChapterMetadata.add(chapter: chapter, &fbb)
|
|
ChapterMetadata.add(name: name, &fbb)
|
|
ChapterMetadata.addVectorOf(images: images, &fbb)
|
|
return ChapterMetadata.endChapterMetadata(&fbb, start: __start)
|
|
}
|
|
|
|
public static func verify<T>(_ verifier: inout Verifier, at position: Int, of type: T.Type) throws where T: Verifiable {
|
|
var _v = try verifier.visitTable(at: position)
|
|
try _v.visit(field: VT.chapter, fieldName: "chapter", required: true, type: MetaValue.self)
|
|
try _v.visit(field: VT.name, fieldName: "name", required: false, type: ForwardOffset<String>.self)
|
|
try _v.visit(field: VT.images, fieldName: "images", required: false, type: ForwardOffset<Vector<ForwardOffset<ImageMetadata>, ImageMetadata>>.self)
|
|
_v.finish()
|
|
}
|
|
}
|
|
|
|
public struct VolumeMetadata: FlatBufferTable, FlatbuffersVectorInitializable, Verifiable {
|
|
|
|
static func validateVersion() { FlatBuffersVersion_25_12_19() }
|
|
public var __buffer: ByteBuffer! { return _accessor.bb }
|
|
private var _accessor: Table
|
|
|
|
private init(_ t: Table) { _accessor = t }
|
|
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) }
|
|
|
|
private struct VT {
|
|
static let volume: VOffset = 4
|
|
static let title: VOffset = 6
|
|
static let archive: VOffset = 8
|
|
static let chapters: VOffset = 10
|
|
}
|
|
|
|
public var volume: MetaValue! { let o = _accessor.offset(VT.volume); return _accessor.readBuffer(of: MetaValue.self, at: o) }
|
|
public var mutableVolume: MetaValue_Mutable! { let o = _accessor.offset(VT.volume); return MetaValue_Mutable(_accessor.bb, o: o + _accessor.position) }
|
|
public var title: String? { let o = _accessor.offset(VT.title); return o == 0 ? nil : _accessor.string(at: o) }
|
|
public var titleSegmentArray: [UInt8]? { return _accessor.getVector(at: VT.title) }
|
|
public var archive: String! { let o = _accessor.offset(VT.archive); return _accessor.string(at: o) }
|
|
public var archiveSegmentArray: [UInt8]! { return _accessor.getVector(at: VT.archive) }
|
|
public var chapters: FlatbufferVector<ChapterMetadata> { return _accessor.vector(at: VT.chapters, byteSize: 4) }
|
|
public static func startVolumeMetadata(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 4) }
|
|
public static func add(volume: MetaValue?, _ fbb: inout FlatBufferBuilder) { guard let volume = volume else { return }; fbb.create(struct: volume, position: VT.volume) }
|
|
public static func add(title: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: title, at: VT.title) }
|
|
public static func add(archive: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: archive, at: VT.archive) }
|
|
public static func addVectorOf(chapters: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: chapters, at: VT.chapters) }
|
|
public static func endVolumeMetadata(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset { let end = Offset(offset: fbb.endTable(at: start)); fbb.require(table: end, fields: [4, 8]); return end }
|
|
public static func createVolumeMetadata(
|
|
_ fbb: inout FlatBufferBuilder,
|
|
volume: MetaValue,
|
|
titleOffset title: Offset = Offset(),
|
|
archiveOffset archive: Offset,
|
|
chaptersVectorOffset chapters: Offset = Offset()
|
|
) -> Offset {
|
|
let __start = VolumeMetadata.startVolumeMetadata(&fbb)
|
|
VolumeMetadata.add(volume: volume, &fbb)
|
|
VolumeMetadata.add(title: title, &fbb)
|
|
VolumeMetadata.add(archive: archive, &fbb)
|
|
VolumeMetadata.addVectorOf(chapters: chapters, &fbb)
|
|
return VolumeMetadata.endVolumeMetadata(&fbb, start: __start)
|
|
}
|
|
|
|
public static func verify<T>(_ verifier: inout Verifier, at position: Int, of type: T.Type) throws where T: Verifiable {
|
|
var _v = try verifier.visitTable(at: position)
|
|
try _v.visit(field: VT.volume, fieldName: "volume", required: true, type: MetaValue.self)
|
|
try _v.visit(field: VT.title, fieldName: "title", required: false, type: ForwardOffset<String>.self)
|
|
try _v.visit(field: VT.archive, fieldName: "archive", required: true, type: ForwardOffset<String>.self)
|
|
try _v.visit(field: VT.chapters, fieldName: "chapters", required: false, type: ForwardOffset<Vector<ForwardOffset<ChapterMetadata>, ChapterMetadata>>.self)
|
|
_v.finish()
|
|
}
|
|
}
|
|
|
|
public struct Metadata: FlatBufferTable, FlatbuffersVectorInitializable, Verifiable {
|
|
|
|
static func validateVersion() { FlatBuffersVersion_25_12_19() }
|
|
public var __buffer: ByteBuffer! { return _accessor.bb }
|
|
private var _accessor: Table
|
|
|
|
private init(_ t: Table) { _accessor = t }
|
|
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) }
|
|
|
|
private struct VT {
|
|
static let title: VOffset = 4
|
|
static let format: VOffset = 6
|
|
static let originalLanguage: VOffset = 8
|
|
static let countryOfOrigin: VOffset = 10
|
|
static let publicationDemographic: VOffset = 12
|
|
static let status: VOffset = 14
|
|
static let contentRating: VOffset = 16
|
|
static let source: VOffset = 18
|
|
static let startReleaseDate: VOffset = 20
|
|
static let endReleaseDate: VOffset = 22
|
|
static let tags: VOffset = 24
|
|
static let description: VOffset = 26
|
|
static let volumes: VOffset = 28
|
|
static let imageCount: VOffset = 30
|
|
}
|
|
|
|
public var title: String! { let o = _accessor.offset(VT.title); return _accessor.string(at: o) }
|
|
public var titleSegmentArray: [UInt8]! { return _accessor.getVector(at: VT.title) }
|
|
public var format: Format { let o = _accessor.offset(VT.format); return o == 0 ? .manga : Format(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? .manga }
|
|
public var originalLanguage: String? { let o = _accessor.offset(VT.originalLanguage); return o == 0 ? nil : _accessor.string(at: o) }
|
|
public var originalLanguageSegmentArray: [UInt8]? { return _accessor.getVector(at: VT.originalLanguage) }
|
|
public var countryOfOrigin: String? { let o = _accessor.offset(VT.countryOfOrigin); return o == 0 ? nil : _accessor.string(at: o) }
|
|
public var countryOfOriginSegmentArray: [UInt8]? { return _accessor.getVector(at: VT.countryOfOrigin) }
|
|
public var publicationDemographic: PublicationDemographic { let o = _accessor.offset(VT.publicationDemographic); return o == 0 ? .shounen : PublicationDemographic(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? .shounen }
|
|
public var status: Status { let o = _accessor.offset(VT.status); return o == 0 ? .finished : Status(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? .finished }
|
|
public var contentRating: ContentRating { let o = _accessor.offset(VT.contentRating); return o == 0 ? .safe : ContentRating(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? .safe }
|
|
public var source: Source { let o = _accessor.offset(VT.source); return o == 0 ? .original : Source(rawValue: _accessor.readBuffer(of: Int8.self, at: o)) ?? .original }
|
|
public var startReleaseDate: Date? { let o = _accessor.offset(VT.startReleaseDate); return o == 0 ? nil : _accessor.readBuffer(of: Date.self, at: o) }
|
|
public var mutableStartReleaseDate: Date_Mutable? { let o = _accessor.offset(VT.startReleaseDate); return o == 0 ? nil : Date_Mutable(_accessor.bb, o: o + _accessor.position) }
|
|
public var endReleaseDate: Date? { let o = _accessor.offset(VT.endReleaseDate); return o == 0 ? nil : _accessor.readBuffer(of: Date.self, at: o) }
|
|
public var mutableEndReleaseDate: Date_Mutable? { let o = _accessor.offset(VT.endReleaseDate); return o == 0 ? nil : Date_Mutable(_accessor.bb, o: o + _accessor.position) }
|
|
public var tags: FlatbufferVector<Tag> { return _accessor.vector(at: VT.tags, byteSize: 4) }
|
|
public var description: String? { let o = _accessor.offset(VT.description); return o == 0 ? nil : _accessor.string(at: o) }
|
|
public var descriptionSegmentArray: [UInt8]? { return _accessor.getVector(at: VT.description) }
|
|
public var volumes: FlatbufferVector<VolumeMetadata> { return _accessor.vector(at: VT.volumes, byteSize: 4) }
|
|
public var imageCount: UInt32 { let o = _accessor.offset(VT.imageCount); return o == 0 ? 0 : _accessor.readBuffer(of: UInt32.self, at: o) }
|
|
public static func startMetadata(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 14) }
|
|
public static func add(title: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: title, at: VT.title) }
|
|
public static func add(format: Format, _ fbb: inout FlatBufferBuilder) { fbb.add(element: format.rawValue, def: 0, at: VT.format) }
|
|
public static func add(originalLanguage: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: originalLanguage, at: VT.originalLanguage) }
|
|
public static func add(countryOfOrigin: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: countryOfOrigin, at: VT.countryOfOrigin) }
|
|
public static func add(publicationDemographic: PublicationDemographic, _ fbb: inout FlatBufferBuilder) { fbb.add(element: publicationDemographic.rawValue, def: 0, at: VT.publicationDemographic) }
|
|
public static func add(status: Status, _ fbb: inout FlatBufferBuilder) { fbb.add(element: status.rawValue, def: 0, at: VT.status) }
|
|
public static func add(contentRating: ContentRating, _ fbb: inout FlatBufferBuilder) { fbb.add(element: contentRating.rawValue, def: 0, at: VT.contentRating) }
|
|
public static func add(source: Source, _ fbb: inout FlatBufferBuilder) { fbb.add(element: source.rawValue, def: 0, at: VT.source) }
|
|
public static func add(startReleaseDate: Date?, _ fbb: inout FlatBufferBuilder) { guard let startReleaseDate = startReleaseDate else { return }; fbb.create(struct: startReleaseDate, position: VT.startReleaseDate) }
|
|
public static func add(endReleaseDate: Date?, _ fbb: inout FlatBufferBuilder) { guard let endReleaseDate = endReleaseDate else { return }; fbb.create(struct: endReleaseDate, position: VT.endReleaseDate) }
|
|
public static func addVectorOf(tags: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: tags, at: VT.tags) }
|
|
public static func add(description: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: description, at: VT.description) }
|
|
public static func addVectorOf(volumes: Offset, _ fbb: inout FlatBufferBuilder) { fbb.add(offset: volumes, at: VT.volumes) }
|
|
public static func add(imageCount: UInt32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: imageCount, def: 0, at: VT.imageCount) }
|
|
public static func endMetadata(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset { let end = Offset(offset: fbb.endTable(at: start)); fbb.require(table: end, fields: [4]); return end }
|
|
public static func createMetadata(
|
|
_ fbb: inout FlatBufferBuilder,
|
|
titleOffset title: Offset,
|
|
format: Format = .manga,
|
|
originalLanguageOffset originalLanguage: Offset = Offset(),
|
|
countryOfOriginOffset countryOfOrigin: Offset = Offset(),
|
|
publicationDemographic: PublicationDemographic = .shounen,
|
|
status: Status = .finished,
|
|
contentRating: ContentRating = .safe,
|
|
source: Source = .original,
|
|
startReleaseDate: Date? = nil,
|
|
endReleaseDate: Date? = nil,
|
|
tagsVectorOffset tags: Offset = Offset(),
|
|
descriptionOffset description: Offset = Offset(),
|
|
volumesVectorOffset volumes: Offset = Offset(),
|
|
imageCount: UInt32 = 0
|
|
) -> Offset {
|
|
let __start = Metadata.startMetadata(&fbb)
|
|
Metadata.add(title: title, &fbb)
|
|
Metadata.add(format: format, &fbb)
|
|
Metadata.add(originalLanguage: originalLanguage, &fbb)
|
|
Metadata.add(countryOfOrigin: countryOfOrigin, &fbb)
|
|
Metadata.add(publicationDemographic: publicationDemographic, &fbb)
|
|
Metadata.add(status: status, &fbb)
|
|
Metadata.add(contentRating: contentRating, &fbb)
|
|
Metadata.add(source: source, &fbb)
|
|
Metadata.add(startReleaseDate: startReleaseDate, &fbb)
|
|
Metadata.add(endReleaseDate: endReleaseDate, &fbb)
|
|
Metadata.addVectorOf(tags: tags, &fbb)
|
|
Metadata.add(description: description, &fbb)
|
|
Metadata.addVectorOf(volumes: volumes, &fbb)
|
|
Metadata.add(imageCount: imageCount, &fbb)
|
|
return Metadata.endMetadata(&fbb, start: __start)
|
|
}
|
|
|
|
public static func verify<T>(_ verifier: inout Verifier, at position: Int, of type: T.Type) throws where T: Verifiable {
|
|
var _v = try verifier.visitTable(at: position)
|
|
try _v.visit(field: VT.title, fieldName: "title", required: true, type: ForwardOffset<String>.self)
|
|
try _v.visit(field: VT.format, fieldName: "format", required: false, type: Format.self)
|
|
try _v.visit(field: VT.originalLanguage, fieldName: "originalLanguage", required: false, type: ForwardOffset<String>.self)
|
|
try _v.visit(field: VT.countryOfOrigin, fieldName: "countryOfOrigin", required: false, type: ForwardOffset<String>.self)
|
|
try _v.visit(field: VT.publicationDemographic, fieldName: "publicationDemographic", required: false, type: PublicationDemographic.self)
|
|
try _v.visit(field: VT.status, fieldName: "status", required: false, type: Status.self)
|
|
try _v.visit(field: VT.contentRating, fieldName: "contentRating", required: false, type: ContentRating.self)
|
|
try _v.visit(field: VT.source, fieldName: "source", required: false, type: Source.self)
|
|
try _v.visit(field: VT.startReleaseDate, fieldName: "startReleaseDate", required: false, type: Date.self)
|
|
try _v.visit(field: VT.endReleaseDate, fieldName: "endReleaseDate", required: false, type: Date.self)
|
|
try _v.visit(field: VT.tags, fieldName: "tags", required: false, type: ForwardOffset<Vector<ForwardOffset<Tag>, Tag>>.self)
|
|
try _v.visit(field: VT.description, fieldName: "description", required: false, type: ForwardOffset<String>.self)
|
|
try _v.visit(field: VT.volumes, fieldName: "volumes", required: false, type: ForwardOffset<Vector<ForwardOffset<VolumeMetadata>, VolumeMetadata>>.self)
|
|
try _v.visit(field: VT.imageCount, fieldName: "imageCount", required: false, type: UInt32.self)
|
|
_v.finish()
|
|
}
|
|
}
|
|
|
|
// swiftlint:enable all
|