mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-06 04:16:54 +00:00
Adds full supposed for Wasm in the swift lib (#7328)
Adds tests for wasm module & github action
This commit is contained in:
@@ -14,7 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !os(WASI)
|
||||
import Foundation
|
||||
#else
|
||||
import SwiftOverlayShims
|
||||
#endif
|
||||
|
||||
/// ``FlatBufferBuilder`` builds a `FlatBuffer` through manipulating its internal state.
|
||||
///
|
||||
@@ -55,6 +59,7 @@ public struct FlatBufferBuilder {
|
||||
/// Gives a read access to the buffer's size
|
||||
public var size: UOffset { _bb.size }
|
||||
|
||||
#if !os(WASI)
|
||||
/// Data representation of the buffer
|
||||
///
|
||||
/// Should only be used after ``finish(offset:addPrefix:)`` is called
|
||||
@@ -64,6 +69,7 @@ public struct FlatBufferBuilder {
|
||||
bytes: _bb.memory.advanced(by: _bb.writerIndex),
|
||||
count: _bb.capacity &- _bb.writerIndex)
|
||||
}
|
||||
#endif
|
||||
|
||||
/// Returns the underlying bytes in the ``ByteBuffer``
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user