mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-06 05:36:56 +00:00
Adds a way to verify/exposes Entities ids (#7221)
This commit is contained in:
@@ -200,4 +200,14 @@ public struct Verifier {
|
||||
internal mutating func finish() {
|
||||
_depth -= 1
|
||||
}
|
||||
|
||||
mutating func verify(id: String) throws {
|
||||
let size = MemoryLayout<Int32>.size
|
||||
let str = _buffer.readString(at: size, count: size)
|
||||
if id == str {
|
||||
return
|
||||
}
|
||||
throw FlatbuffersErrors.bufferIdDidntMatchPassedId
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user