1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
|
// automatically generated by the FlatBuffers compiler, do not modify
// ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable
library keyword_test;
import 'dart:typed_data' show Uint8List;
import 'package:flat_buffers/flat_buffers.dart' as fb;
class Abc {
final int value;
const Abc._(this.value);
factory Abc.fromValue(int value) {
final result = values[value];
if (result == null) {
throw StateError('Invalid value $value for bit flag enum Abc');
}
return result;
}
static Abc? _createOrNull(int? value) =>
value == null ? null : Abc.fromValue(value);
static const int minValue = 0;
static const int maxValue = 2;
static bool containsValue(int value) => values.containsKey(value);
static const Abc $void = Abc._(0);
static const Abc where = Abc._(1);
static const Abc stackalloc = Abc._(2);
static const Map<int, Abc> values = {
0: $void,
1: where,
2: stackalloc};
static const fb.Reader<Abc> reader = _AbcReader();
@override
String toString() {
return 'Abc{value: $value}';
}
}
class _AbcReader extends fb.Reader<Abc> {
const _AbcReader();
@override
int get size => 4;
@override
Abc read(fb.BufferContext bc, int offset) =>
Abc.fromValue(const fb.Int32Reader().read(bc, offset));
}
class Public {
final int value;
const Public._(this.value);
factory Public.fromValue(int value) {
final result = values[value];
if (result == null) {
throw StateError('Invalid value $value for bit flag enum Public');
}
return result;
}
static Public? _createOrNull(int? value) =>
value == null ? null : Public.fromValue(value);
static const int minValue = 0;
static const int maxValue = 0;
static bool containsValue(int value) => values.containsKey(value);
static const Public NONE = Public._(0);
static const Map<int, Public> values = {
0: NONE};
static const fb.Reader<Public> reader = _PublicReader();
@override
String toString() {
return 'Public{value: $value}';
}
}
class _PublicReader extends fb.Reader<Public> {
const _PublicReader();
@override
int get size => 4;
@override
Public read(fb.BufferContext bc, int offset) =>
Public.fromValue(const fb.Int32Reader().read(bc, offset));
}
class KeywordsInUnionTypeId {
final int value;
const KeywordsInUnionTypeId._(this.value);
factory KeywordsInUnionTypeId.fromValue(int value) {
final result = values[value];
if (result == null) {
throw StateError('Invalid value $value for bit flag enum KeywordsInUnionTypeId');
}
return result;
}
static KeywordsInUnionTypeId? _createOrNull(int? value) =>
value == null ? null : KeywordsInUnionTypeId.fromValue(value);
static const int minValue = 0;
static const int maxValue = 2;
static bool containsValue(int value) => values.containsKey(value);
static const KeywordsInUnionTypeId NONE = KeywordsInUnionTypeId._(0);
static const KeywordsInUnionTypeId $static = KeywordsInUnionTypeId._(1);
static const KeywordsInUnionTypeId internal = KeywordsInUnionTypeId._(2);
static const Map<int, KeywordsInUnionTypeId> values = {
0: NONE,
1: $static,
2: internal};
static const fb.Reader<KeywordsInUnionTypeId> reader = _KeywordsInUnionTypeIdReader();
@override
String toString() {
return 'KeywordsInUnionTypeId{value: $value}';
}
}
class _KeywordsInUnionTypeIdReader extends fb.Reader<KeywordsInUnionTypeId> {
const _KeywordsInUnionTypeIdReader();
@override
int get size => 1;
@override
KeywordsInUnionTypeId read(fb.BufferContext bc, int offset) =>
KeywordsInUnionTypeId.fromValue(const fb.Uint8Reader().read(bc, offset));
}
class KeywordsInTable {
KeywordsInTable._(this._bc, this._bcOffset);
factory KeywordsInTable(List<int> bytes) {
final rootRef = fb.BufferContext.fromBytes(bytes);
return reader.read(rootRef, 0);
}
static const fb.Reader<KeywordsInTable> reader = _KeywordsInTableReader();
final fb.BufferContext _bc;
final int _bcOffset;
Abc get $is => Abc.fromValue(const fb.Int32Reader().vTableGet(_bc, _bcOffset, 4, 0));
Public get private => Public.fromValue(const fb.Int32Reader().vTableGet(_bc, _bcOffset, 6, 0));
int get type => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 8, 0);
bool get $default => const fb.BoolReader().vTableGet(_bc, _bcOffset, 10, false);
@override
String toString() {
return 'KeywordsInTable{\$is: ${$is}, private: ${private}, type: ${type}, \$default: ${$default}}';
}
KeywordsInTableT unpack() => KeywordsInTableT(
$is: $is,
private: private,
type: type,
$default: $default);
static int pack(fb.Builder fbBuilder, KeywordsInTableT? object) {
if (object == null) return 0;
return object.pack(fbBuilder);
}
}
class KeywordsInTableT implements fb.Packable {
Abc $is;
Public private;
int type;
bool $default;
KeywordsInTableT({
this.$is = Abc.$void,
this.private = Public.NONE,
this.type = 0,
this.$default = false});
@override
int pack(fb.Builder fbBuilder) {
fbBuilder.startTable(4);
fbBuilder.addInt32(0, $is.value);
fbBuilder.addInt32(1, private.value);
fbBuilder.addInt32(2, type);
fbBuilder.addBool(3, $default);
return fbBuilder.endTable();
}
@override
String toString() {
return 'KeywordsInTableT{\$is: ${$is}, private: ${private}, type: ${type}, \$default: ${$default}}';
}
}
class _KeywordsInTableReader extends fb.TableReader<KeywordsInTable> {
const _KeywordsInTableReader();
@override
KeywordsInTable createObject(fb.BufferContext bc, int offset) =>
KeywordsInTable._(bc, offset);
}
class KeywordsInTableBuilder {
KeywordsInTableBuilder(this.fbBuilder);
final fb.Builder fbBuilder;
void begin() {
fbBuilder.startTable(4);
}
int addIs(Abc? $is) {
fbBuilder.addInt32(0, $is?.value);
return fbBuilder.offset;
}
int addPrivate(Public? private) {
fbBuilder.addInt32(1, private?.value);
return fbBuilder.offset;
}
int addType(int? type) {
fbBuilder.addInt32(2, type);
return fbBuilder.offset;
}
int addDefault(bool? $default) {
fbBuilder.addBool(3, $default);
return fbBuilder.offset;
}
int finish() {
return fbBuilder.endTable();
}
}
class KeywordsInTableObjectBuilder extends fb.ObjectBuilder {
final Abc? _$is;
final Public? _private;
final int? _type;
final bool? _$default;
KeywordsInTableObjectBuilder({
Abc? $is,
Public? private,
int? type,
bool? $default,
})
: _$is = $is,
_private = private,
_type = type,
_$default = $default;
/// Finish building, and store into the [fbBuilder].
@override
int finish(fb.Builder fbBuilder) {
fbBuilder.startTable(4);
fbBuilder.addInt32(0, _$is?.value);
fbBuilder.addInt32(1, _private?.value);
fbBuilder.addInt32(2, _type);
fbBuilder.addBool(3, _$default);
return fbBuilder.endTable();
}
/// Convenience method to serialize to byte list.
@override
Uint8List toBytes([String? fileIdentifier]) {
final fbBuilder = fb.Builder(deduplicateTables: false);
fbBuilder.finish(finish(fbBuilder), fileIdentifier);
return fbBuilder.buffer;
}
}
|