Adds min and max, comments, and all of swift's keywords + fix docs (#5737)

This commit is contained in:
mustiikhalil
2020-01-27 21:05:41 +03:00
committed by Wouter van Oortmerssen
parent f2a1272303
commit c580fa284c
6 changed files with 190 additions and 49 deletions

View File

@@ -77,11 +77,8 @@ public final class FlatBufferBuilder {
public func clearOffsets() {
_vtable = []
}
}
// MARK: - Create Tables
extension FlatBufferBuilder {
// MARK: - Create Tables
/// Checks if the required fields were serialized into the buffer
/// - Parameters:
@@ -476,11 +473,16 @@ extension FlatBufferBuilder {
_bb.push(value: element, len: MemoryLayout<T>.size)
return _bb.size
}
#if DEBUG
/// Used to debug the buffer and the implementation
public func debug(str: String = "normal memory: ") {
_bb.debugMemory(str: str)
}
#endif
}
extension FlatBufferBuilder: CustomDebugStringConvertible {
public var debugDescription: String {
"""
buffer debug:
\(_bb)
builder debug:
{ finished: \(finished), serializeDefaults: \(serializeDefaults), isNested: \(isNested) }
"""
}
}