github.com/urso/go-structform@v0.0.2/gotype/unfold_primitive.generated.go (about) 1 // This file has been generated from 'unfold_primitive.yml', do not edit 2 package gotype 3 4 import ( 5 "unsafe" 6 7 structform "github.com/urso/go-structform" 8 ) 9 10 var ( 11 unfolderReflIfc = liftGoUnfolder(newUnfolderIfc()) 12 13 unfolderReflBool = liftGoUnfolder(newUnfolderBool()) 14 15 unfolderReflString = liftGoUnfolder(newUnfolderString()) 16 17 unfolderReflUint = liftGoUnfolder(newUnfolderUint()) 18 19 unfolderReflUint8 = liftGoUnfolder(newUnfolderUint8()) 20 21 unfolderReflUint16 = liftGoUnfolder(newUnfolderUint16()) 22 23 unfolderReflUint32 = liftGoUnfolder(newUnfolderUint32()) 24 25 unfolderReflUint64 = liftGoUnfolder(newUnfolderUint64()) 26 27 unfolderReflInt = liftGoUnfolder(newUnfolderInt()) 28 29 unfolderReflInt8 = liftGoUnfolder(newUnfolderInt8()) 30 31 unfolderReflInt16 = liftGoUnfolder(newUnfolderInt16()) 32 33 unfolderReflInt32 = liftGoUnfolder(newUnfolderInt32()) 34 35 unfolderReflInt64 = liftGoUnfolder(newUnfolderInt64()) 36 37 unfolderReflFloat32 = liftGoUnfolder(newUnfolderFloat32()) 38 39 unfolderReflFloat64 = liftGoUnfolder(newUnfolderFloat64()) 40 ) 41 42 type unfolderIfc struct { 43 unfolderErrUnknown 44 } 45 46 var _singletonUnfolderIfc = &unfolderIfc{} 47 48 func newUnfolderIfc() *unfolderIfc { 49 return _singletonUnfolderIfc 50 } 51 52 func (u *unfolderIfc) initState(ctx *unfoldCtx, ptr unsafe.Pointer) { 53 ctx.unfolder.push(u) 54 ctx.ptr.push(ptr) 55 } 56 57 func (u *unfolderIfc) cleanup(ctx *unfoldCtx) { 58 ctx.unfolder.pop() 59 ctx.ptr.pop() 60 } 61 62 func (u *unfolderIfc) ptr(ctx *unfoldCtx) *interface{} { 63 return (*interface{})(ctx.ptr.current) 64 } 65 66 func (u *unfolderIfc) assign(ctx *unfoldCtx, v interface{}) error { 67 *u.ptr(ctx) = v 68 u.cleanup(ctx) 69 return nil 70 } 71 72 type unfolderBool struct { 73 unfolderErrUnknown 74 } 75 76 var _singletonUnfolderBool = &unfolderBool{} 77 78 func newUnfolderBool() *unfolderBool { 79 return _singletonUnfolderBool 80 } 81 82 func (u *unfolderBool) initState(ctx *unfoldCtx, ptr unsafe.Pointer) { 83 ctx.unfolder.push(u) 84 ctx.ptr.push(ptr) 85 } 86 87 func (u *unfolderBool) cleanup(ctx *unfoldCtx) { 88 ctx.unfolder.pop() 89 ctx.ptr.pop() 90 } 91 92 func (u *unfolderBool) ptr(ctx *unfoldCtx) *bool { 93 return (*bool)(ctx.ptr.current) 94 } 95 96 func (u *unfolderBool) assign(ctx *unfoldCtx, v bool) error { 97 *u.ptr(ctx) = v 98 u.cleanup(ctx) 99 return nil 100 } 101 102 type unfolderString struct { 103 unfolderErrUnknown 104 } 105 106 var _singletonUnfolderString = &unfolderString{} 107 108 func newUnfolderString() *unfolderString { 109 return _singletonUnfolderString 110 } 111 112 func (u *unfolderString) initState(ctx *unfoldCtx, ptr unsafe.Pointer) { 113 ctx.unfolder.push(u) 114 ctx.ptr.push(ptr) 115 } 116 117 func (u *unfolderString) cleanup(ctx *unfoldCtx) { 118 ctx.unfolder.pop() 119 ctx.ptr.pop() 120 } 121 122 func (u *unfolderString) ptr(ctx *unfoldCtx) *string { 123 return (*string)(ctx.ptr.current) 124 } 125 126 func (u *unfolderString) assign(ctx *unfoldCtx, v string) error { 127 *u.ptr(ctx) = v 128 u.cleanup(ctx) 129 return nil 130 } 131 132 type unfolderUint struct { 133 unfolderErrUnknown 134 } 135 136 var _singletonUnfolderUint = &unfolderUint{} 137 138 func newUnfolderUint() *unfolderUint { 139 return _singletonUnfolderUint 140 } 141 142 func (u *unfolderUint) initState(ctx *unfoldCtx, ptr unsafe.Pointer) { 143 ctx.unfolder.push(u) 144 ctx.ptr.push(ptr) 145 } 146 147 func (u *unfolderUint) cleanup(ctx *unfoldCtx) { 148 ctx.unfolder.pop() 149 ctx.ptr.pop() 150 } 151 152 func (u *unfolderUint) ptr(ctx *unfoldCtx) *uint { 153 return (*uint)(ctx.ptr.current) 154 } 155 156 func (u *unfolderUint) assign(ctx *unfoldCtx, v uint) error { 157 *u.ptr(ctx) = v 158 u.cleanup(ctx) 159 return nil 160 } 161 162 type unfolderUint8 struct { 163 unfolderErrUnknown 164 } 165 166 var _singletonUnfolderUint8 = &unfolderUint8{} 167 168 func newUnfolderUint8() *unfolderUint8 { 169 return _singletonUnfolderUint8 170 } 171 172 func (u *unfolderUint8) initState(ctx *unfoldCtx, ptr unsafe.Pointer) { 173 ctx.unfolder.push(u) 174 ctx.ptr.push(ptr) 175 } 176 177 func (u *unfolderUint8) cleanup(ctx *unfoldCtx) { 178 ctx.unfolder.pop() 179 ctx.ptr.pop() 180 } 181 182 func (u *unfolderUint8) ptr(ctx *unfoldCtx) *uint8 { 183 return (*uint8)(ctx.ptr.current) 184 } 185 186 func (u *unfolderUint8) assign(ctx *unfoldCtx, v uint8) error { 187 *u.ptr(ctx) = v 188 u.cleanup(ctx) 189 return nil 190 } 191 192 type unfolderUint16 struct { 193 unfolderErrUnknown 194 } 195 196 var _singletonUnfolderUint16 = &unfolderUint16{} 197 198 func newUnfolderUint16() *unfolderUint16 { 199 return _singletonUnfolderUint16 200 } 201 202 func (u *unfolderUint16) initState(ctx *unfoldCtx, ptr unsafe.Pointer) { 203 ctx.unfolder.push(u) 204 ctx.ptr.push(ptr) 205 } 206 207 func (u *unfolderUint16) cleanup(ctx *unfoldCtx) { 208 ctx.unfolder.pop() 209 ctx.ptr.pop() 210 } 211 212 func (u *unfolderUint16) ptr(ctx *unfoldCtx) *uint16 { 213 return (*uint16)(ctx.ptr.current) 214 } 215 216 func (u *unfolderUint16) assign(ctx *unfoldCtx, v uint16) error { 217 *u.ptr(ctx) = v 218 u.cleanup(ctx) 219 return nil 220 } 221 222 type unfolderUint32 struct { 223 unfolderErrUnknown 224 } 225 226 var _singletonUnfolderUint32 = &unfolderUint32{} 227 228 func newUnfolderUint32() *unfolderUint32 { 229 return _singletonUnfolderUint32 230 } 231 232 func (u *unfolderUint32) initState(ctx *unfoldCtx, ptr unsafe.Pointer) { 233 ctx.unfolder.push(u) 234 ctx.ptr.push(ptr) 235 } 236 237 func (u *unfolderUint32) cleanup(ctx *unfoldCtx) { 238 ctx.unfolder.pop() 239 ctx.ptr.pop() 240 } 241 242 func (u *unfolderUint32) ptr(ctx *unfoldCtx) *uint32 { 243 return (*uint32)(ctx.ptr.current) 244 } 245 246 func (u *unfolderUint32) assign(ctx *unfoldCtx, v uint32) error { 247 *u.ptr(ctx) = v 248 u.cleanup(ctx) 249 return nil 250 } 251 252 type unfolderUint64 struct { 253 unfolderErrUnknown 254 } 255 256 var _singletonUnfolderUint64 = &unfolderUint64{} 257 258 func newUnfolderUint64() *unfolderUint64 { 259 return _singletonUnfolderUint64 260 } 261 262 func (u *unfolderUint64) initState(ctx *unfoldCtx, ptr unsafe.Pointer) { 263 ctx.unfolder.push(u) 264 ctx.ptr.push(ptr) 265 } 266 267 func (u *unfolderUint64) cleanup(ctx *unfoldCtx) { 268 ctx.unfolder.pop() 269 ctx.ptr.pop() 270 } 271 272 func (u *unfolderUint64) ptr(ctx *unfoldCtx) *uint64 { 273 return (*uint64)(ctx.ptr.current) 274 } 275 276 func (u *unfolderUint64) assign(ctx *unfoldCtx, v uint64) error { 277 *u.ptr(ctx) = v 278 u.cleanup(ctx) 279 return nil 280 } 281 282 type unfolderInt struct { 283 unfolderErrUnknown 284 } 285 286 var _singletonUnfolderInt = &unfolderInt{} 287 288 func newUnfolderInt() *unfolderInt { 289 return _singletonUnfolderInt 290 } 291 292 func (u *unfolderInt) initState(ctx *unfoldCtx, ptr unsafe.Pointer) { 293 ctx.unfolder.push(u) 294 ctx.ptr.push(ptr) 295 } 296 297 func (u *unfolderInt) cleanup(ctx *unfoldCtx) { 298 ctx.unfolder.pop() 299 ctx.ptr.pop() 300 } 301 302 func (u *unfolderInt) ptr(ctx *unfoldCtx) *int { 303 return (*int)(ctx.ptr.current) 304 } 305 306 func (u *unfolderInt) assign(ctx *unfoldCtx, v int) error { 307 *u.ptr(ctx) = v 308 u.cleanup(ctx) 309 return nil 310 } 311 312 type unfolderInt8 struct { 313 unfolderErrUnknown 314 } 315 316 var _singletonUnfolderInt8 = &unfolderInt8{} 317 318 func newUnfolderInt8() *unfolderInt8 { 319 return _singletonUnfolderInt8 320 } 321 322 func (u *unfolderInt8) initState(ctx *unfoldCtx, ptr unsafe.Pointer) { 323 ctx.unfolder.push(u) 324 ctx.ptr.push(ptr) 325 } 326 327 func (u *unfolderInt8) cleanup(ctx *unfoldCtx) { 328 ctx.unfolder.pop() 329 ctx.ptr.pop() 330 } 331 332 func (u *unfolderInt8) ptr(ctx *unfoldCtx) *int8 { 333 return (*int8)(ctx.ptr.current) 334 } 335 336 func (u *unfolderInt8) assign(ctx *unfoldCtx, v int8) error { 337 *u.ptr(ctx) = v 338 u.cleanup(ctx) 339 return nil 340 } 341 342 type unfolderInt16 struct { 343 unfolderErrUnknown 344 } 345 346 var _singletonUnfolderInt16 = &unfolderInt16{} 347 348 func newUnfolderInt16() *unfolderInt16 { 349 return _singletonUnfolderInt16 350 } 351 352 func (u *unfolderInt16) initState(ctx *unfoldCtx, ptr unsafe.Pointer) { 353 ctx.unfolder.push(u) 354 ctx.ptr.push(ptr) 355 } 356 357 func (u *unfolderInt16) cleanup(ctx *unfoldCtx) { 358 ctx.unfolder.pop() 359 ctx.ptr.pop() 360 } 361 362 func (u *unfolderInt16) ptr(ctx *unfoldCtx) *int16 { 363 return (*int16)(ctx.ptr.current) 364 } 365 366 func (u *unfolderInt16) assign(ctx *unfoldCtx, v int16) error { 367 *u.ptr(ctx) = v 368 u.cleanup(ctx) 369 return nil 370 } 371 372 type unfolderInt32 struct { 373 unfolderErrUnknown 374 } 375 376 var _singletonUnfolderInt32 = &unfolderInt32{} 377 378 func newUnfolderInt32() *unfolderInt32 { 379 return _singletonUnfolderInt32 380 } 381 382 func (u *unfolderInt32) initState(ctx *unfoldCtx, ptr unsafe.Pointer) { 383 ctx.unfolder.push(u) 384 ctx.ptr.push(ptr) 385 } 386 387 func (u *unfolderInt32) cleanup(ctx *unfoldCtx) { 388 ctx.unfolder.pop() 389 ctx.ptr.pop() 390 } 391 392 func (u *unfolderInt32) ptr(ctx *unfoldCtx) *int32 { 393 return (*int32)(ctx.ptr.current) 394 } 395 396 func (u *unfolderInt32) assign(ctx *unfoldCtx, v int32) error { 397 *u.ptr(ctx) = v 398 u.cleanup(ctx) 399 return nil 400 } 401 402 type unfolderInt64 struct { 403 unfolderErrUnknown 404 } 405 406 var _singletonUnfolderInt64 = &unfolderInt64{} 407 408 func newUnfolderInt64() *unfolderInt64 { 409 return _singletonUnfolderInt64 410 } 411 412 func (u *unfolderInt64) initState(ctx *unfoldCtx, ptr unsafe.Pointer) { 413 ctx.unfolder.push(u) 414 ctx.ptr.push(ptr) 415 } 416 417 func (u *unfolderInt64) cleanup(ctx *unfoldCtx) { 418 ctx.unfolder.pop() 419 ctx.ptr.pop() 420 } 421 422 func (u *unfolderInt64) ptr(ctx *unfoldCtx) *int64 { 423 return (*int64)(ctx.ptr.current) 424 } 425 426 func (u *unfolderInt64) assign(ctx *unfoldCtx, v int64) error { 427 *u.ptr(ctx) = v 428 u.cleanup(ctx) 429 return nil 430 } 431 432 type unfolderFloat32 struct { 433 unfolderErrUnknown 434 } 435 436 var _singletonUnfolderFloat32 = &unfolderFloat32{} 437 438 func newUnfolderFloat32() *unfolderFloat32 { 439 return _singletonUnfolderFloat32 440 } 441 442 func (u *unfolderFloat32) initState(ctx *unfoldCtx, ptr unsafe.Pointer) { 443 ctx.unfolder.push(u) 444 ctx.ptr.push(ptr) 445 } 446 447 func (u *unfolderFloat32) cleanup(ctx *unfoldCtx) { 448 ctx.unfolder.pop() 449 ctx.ptr.pop() 450 } 451 452 func (u *unfolderFloat32) ptr(ctx *unfoldCtx) *float32 { 453 return (*float32)(ctx.ptr.current) 454 } 455 456 func (u *unfolderFloat32) assign(ctx *unfoldCtx, v float32) error { 457 *u.ptr(ctx) = v 458 u.cleanup(ctx) 459 return nil 460 } 461 462 type unfolderFloat64 struct { 463 unfolderErrUnknown 464 } 465 466 var _singletonUnfolderFloat64 = &unfolderFloat64{} 467 468 func newUnfolderFloat64() *unfolderFloat64 { 469 return _singletonUnfolderFloat64 470 } 471 472 func (u *unfolderFloat64) initState(ctx *unfoldCtx, ptr unsafe.Pointer) { 473 ctx.unfolder.push(u) 474 ctx.ptr.push(ptr) 475 } 476 477 func (u *unfolderFloat64) cleanup(ctx *unfoldCtx) { 478 ctx.unfolder.pop() 479 ctx.ptr.pop() 480 } 481 482 func (u *unfolderFloat64) ptr(ctx *unfoldCtx) *float64 { 483 return (*float64)(ctx.ptr.current) 484 } 485 486 func (u *unfolderFloat64) assign(ctx *unfoldCtx, v float64) error { 487 *u.ptr(ctx) = v 488 u.cleanup(ctx) 489 return nil 490 } 491 492 func (u *unfolderIfc) OnNil(ctx *unfoldCtx) error { 493 return u.assign(ctx, nil) 494 } 495 496 func (u *unfolderIfc) OnBool(ctx *unfoldCtx, v bool) error { return u.assign(ctx, v) } 497 498 func (u *unfolderIfc) OnString(ctx *unfoldCtx, v string) error { return u.assign(ctx, v) } 499 func (u *unfolderIfc) OnStringRef(ctx *unfoldCtx, v []byte) error { 500 return u.OnString(ctx, string(v)) 501 } 502 503 func (u *unfolderIfc) OnByte(ctx *unfoldCtx, v byte) error { 504 return u.assign(ctx, (interface{})(v)) 505 } 506 507 func (u *unfolderIfc) OnUint(ctx *unfoldCtx, v uint) error { 508 return u.assign(ctx, (interface{})(v)) 509 } 510 511 func (u *unfolderIfc) OnUint8(ctx *unfoldCtx, v uint8) error { 512 return u.assign(ctx, (interface{})(v)) 513 } 514 515 func (u *unfolderIfc) OnUint16(ctx *unfoldCtx, v uint16) error { 516 return u.assign(ctx, (interface{})(v)) 517 } 518 519 func (u *unfolderIfc) OnUint32(ctx *unfoldCtx, v uint32) error { 520 return u.assign(ctx, (interface{})(v)) 521 } 522 523 func (u *unfolderIfc) OnUint64(ctx *unfoldCtx, v uint64) error { 524 return u.assign(ctx, (interface{})(v)) 525 } 526 527 func (u *unfolderIfc) OnInt(ctx *unfoldCtx, v int) error { 528 return u.assign(ctx, (interface{})(v)) 529 } 530 531 func (u *unfolderIfc) OnInt8(ctx *unfoldCtx, v int8) error { 532 return u.assign(ctx, (interface{})(v)) 533 } 534 535 func (u *unfolderIfc) OnInt16(ctx *unfoldCtx, v int16) error { 536 return u.assign(ctx, (interface{})(v)) 537 } 538 539 func (u *unfolderIfc) OnInt32(ctx *unfoldCtx, v int32) error { 540 return u.assign(ctx, (interface{})(v)) 541 } 542 543 func (u *unfolderIfc) OnInt64(ctx *unfoldCtx, v int64) error { 544 return u.assign(ctx, (interface{})(v)) 545 } 546 547 func (u *unfolderIfc) OnFloat32(ctx *unfoldCtx, v float32) error { 548 return u.assign(ctx, (interface{})(v)) 549 } 550 551 func (u *unfolderIfc) OnFloat64(ctx *unfoldCtx, v float64) error { 552 return u.assign(ctx, (interface{})(v)) 553 } 554 555 func (*unfolderIfc) OnArrayStart(ctx *unfoldCtx, l int, bt structform.BaseType) error { 556 return unfoldIfcStartSubArray(ctx, l, bt) 557 } 558 559 func (u *unfolderIfc) OnChildArrayDone(ctx *unfoldCtx) error { 560 v, err := unfoldIfcFinishSubArray(ctx) 561 if err == nil { 562 err = u.assign(ctx, v) 563 } 564 return err 565 } 566 567 func (*unfolderIfc) OnObjectStart(ctx *unfoldCtx, l int, bt structform.BaseType) error { 568 return unfoldIfcStartSubMap(ctx, l, bt) 569 } 570 571 func (u *unfolderIfc) OnChildObjectDone(ctx *unfoldCtx) error { 572 v, err := unfoldIfcFinishSubMap(ctx) 573 if err == nil { 574 err = u.assign(ctx, v) 575 } 576 return err 577 } 578 579 func (u *unfolderBool) OnNil(ctx *unfoldCtx) error { 580 return u.assign(ctx, false) 581 } 582 583 func (u *unfolderBool) OnBool(ctx *unfoldCtx, v bool) error { return u.assign(ctx, v) } 584 585 func (u *unfolderString) OnNil(ctx *unfoldCtx) error { 586 return u.assign(ctx, "") 587 } 588 589 func (u *unfolderString) OnString(ctx *unfoldCtx, v string) error { return u.assign(ctx, v) } 590 func (u *unfolderString) OnStringRef(ctx *unfoldCtx, v []byte) error { 591 return u.OnString(ctx, string(v)) 592 } 593 594 func (u *unfolderUint) OnNil(ctx *unfoldCtx) error { 595 return u.assign(ctx, 0) 596 } 597 598 func (u *unfolderUint) OnByte(ctx *unfoldCtx, v byte) error { 599 return u.assign(ctx, uint(v)) 600 } 601 602 func (u *unfolderUint) OnUint(ctx *unfoldCtx, v uint) error { 603 return u.assign(ctx, uint(v)) 604 } 605 606 func (u *unfolderUint) OnUint8(ctx *unfoldCtx, v uint8) error { 607 return u.assign(ctx, uint(v)) 608 } 609 610 func (u *unfolderUint) OnUint16(ctx *unfoldCtx, v uint16) error { 611 return u.assign(ctx, uint(v)) 612 } 613 614 func (u *unfolderUint) OnUint32(ctx *unfoldCtx, v uint32) error { 615 return u.assign(ctx, uint(v)) 616 } 617 618 func (u *unfolderUint) OnUint64(ctx *unfoldCtx, v uint64) error { 619 return u.assign(ctx, uint(v)) 620 } 621 622 func (u *unfolderUint) OnInt(ctx *unfoldCtx, v int) error { 623 return u.assign(ctx, uint(v)) 624 } 625 626 func (u *unfolderUint) OnInt8(ctx *unfoldCtx, v int8) error { 627 return u.assign(ctx, uint(v)) 628 } 629 630 func (u *unfolderUint) OnInt16(ctx *unfoldCtx, v int16) error { 631 return u.assign(ctx, uint(v)) 632 } 633 634 func (u *unfolderUint) OnInt32(ctx *unfoldCtx, v int32) error { 635 return u.assign(ctx, uint(v)) 636 } 637 638 func (u *unfolderUint) OnInt64(ctx *unfoldCtx, v int64) error { 639 return u.assign(ctx, uint(v)) 640 } 641 642 func (u *unfolderUint) OnFloat32(ctx *unfoldCtx, v float32) error { 643 return u.assign(ctx, uint(v)) 644 } 645 646 func (u *unfolderUint) OnFloat64(ctx *unfoldCtx, v float64) error { 647 return u.assign(ctx, uint(v)) 648 } 649 650 func (u *unfolderUint8) OnNil(ctx *unfoldCtx) error { 651 return u.assign(ctx, 0) 652 } 653 654 func (u *unfolderUint8) OnByte(ctx *unfoldCtx, v byte) error { 655 return u.assign(ctx, uint8(v)) 656 } 657 658 func (u *unfolderUint8) OnUint(ctx *unfoldCtx, v uint) error { 659 return u.assign(ctx, uint8(v)) 660 } 661 662 func (u *unfolderUint8) OnUint8(ctx *unfoldCtx, v uint8) error { 663 return u.assign(ctx, uint8(v)) 664 } 665 666 func (u *unfolderUint8) OnUint16(ctx *unfoldCtx, v uint16) error { 667 return u.assign(ctx, uint8(v)) 668 } 669 670 func (u *unfolderUint8) OnUint32(ctx *unfoldCtx, v uint32) error { 671 return u.assign(ctx, uint8(v)) 672 } 673 674 func (u *unfolderUint8) OnUint64(ctx *unfoldCtx, v uint64) error { 675 return u.assign(ctx, uint8(v)) 676 } 677 678 func (u *unfolderUint8) OnInt(ctx *unfoldCtx, v int) error { 679 return u.assign(ctx, uint8(v)) 680 } 681 682 func (u *unfolderUint8) OnInt8(ctx *unfoldCtx, v int8) error { 683 return u.assign(ctx, uint8(v)) 684 } 685 686 func (u *unfolderUint8) OnInt16(ctx *unfoldCtx, v int16) error { 687 return u.assign(ctx, uint8(v)) 688 } 689 690 func (u *unfolderUint8) OnInt32(ctx *unfoldCtx, v int32) error { 691 return u.assign(ctx, uint8(v)) 692 } 693 694 func (u *unfolderUint8) OnInt64(ctx *unfoldCtx, v int64) error { 695 return u.assign(ctx, uint8(v)) 696 } 697 698 func (u *unfolderUint8) OnFloat32(ctx *unfoldCtx, v float32) error { 699 return u.assign(ctx, uint8(v)) 700 } 701 702 func (u *unfolderUint8) OnFloat64(ctx *unfoldCtx, v float64) error { 703 return u.assign(ctx, uint8(v)) 704 } 705 706 func (u *unfolderUint16) OnNil(ctx *unfoldCtx) error { 707 return u.assign(ctx, 0) 708 } 709 710 func (u *unfolderUint16) OnByte(ctx *unfoldCtx, v byte) error { 711 return u.assign(ctx, uint16(v)) 712 } 713 714 func (u *unfolderUint16) OnUint(ctx *unfoldCtx, v uint) error { 715 return u.assign(ctx, uint16(v)) 716 } 717 718 func (u *unfolderUint16) OnUint8(ctx *unfoldCtx, v uint8) error { 719 return u.assign(ctx, uint16(v)) 720 } 721 722 func (u *unfolderUint16) OnUint16(ctx *unfoldCtx, v uint16) error { 723 return u.assign(ctx, uint16(v)) 724 } 725 726 func (u *unfolderUint16) OnUint32(ctx *unfoldCtx, v uint32) error { 727 return u.assign(ctx, uint16(v)) 728 } 729 730 func (u *unfolderUint16) OnUint64(ctx *unfoldCtx, v uint64) error { 731 return u.assign(ctx, uint16(v)) 732 } 733 734 func (u *unfolderUint16) OnInt(ctx *unfoldCtx, v int) error { 735 return u.assign(ctx, uint16(v)) 736 } 737 738 func (u *unfolderUint16) OnInt8(ctx *unfoldCtx, v int8) error { 739 return u.assign(ctx, uint16(v)) 740 } 741 742 func (u *unfolderUint16) OnInt16(ctx *unfoldCtx, v int16) error { 743 return u.assign(ctx, uint16(v)) 744 } 745 746 func (u *unfolderUint16) OnInt32(ctx *unfoldCtx, v int32) error { 747 return u.assign(ctx, uint16(v)) 748 } 749 750 func (u *unfolderUint16) OnInt64(ctx *unfoldCtx, v int64) error { 751 return u.assign(ctx, uint16(v)) 752 } 753 754 func (u *unfolderUint16) OnFloat32(ctx *unfoldCtx, v float32) error { 755 return u.assign(ctx, uint16(v)) 756 } 757 758 func (u *unfolderUint16) OnFloat64(ctx *unfoldCtx, v float64) error { 759 return u.assign(ctx, uint16(v)) 760 } 761 762 func (u *unfolderUint32) OnNil(ctx *unfoldCtx) error { 763 return u.assign(ctx, 0) 764 } 765 766 func (u *unfolderUint32) OnByte(ctx *unfoldCtx, v byte) error { 767 return u.assign(ctx, uint32(v)) 768 } 769 770 func (u *unfolderUint32) OnUint(ctx *unfoldCtx, v uint) error { 771 return u.assign(ctx, uint32(v)) 772 } 773 774 func (u *unfolderUint32) OnUint8(ctx *unfoldCtx, v uint8) error { 775 return u.assign(ctx, uint32(v)) 776 } 777 778 func (u *unfolderUint32) OnUint16(ctx *unfoldCtx, v uint16) error { 779 return u.assign(ctx, uint32(v)) 780 } 781 782 func (u *unfolderUint32) OnUint32(ctx *unfoldCtx, v uint32) error { 783 return u.assign(ctx, uint32(v)) 784 } 785 786 func (u *unfolderUint32) OnUint64(ctx *unfoldCtx, v uint64) error { 787 return u.assign(ctx, uint32(v)) 788 } 789 790 func (u *unfolderUint32) OnInt(ctx *unfoldCtx, v int) error { 791 return u.assign(ctx, uint32(v)) 792 } 793 794 func (u *unfolderUint32) OnInt8(ctx *unfoldCtx, v int8) error { 795 return u.assign(ctx, uint32(v)) 796 } 797 798 func (u *unfolderUint32) OnInt16(ctx *unfoldCtx, v int16) error { 799 return u.assign(ctx, uint32(v)) 800 } 801 802 func (u *unfolderUint32) OnInt32(ctx *unfoldCtx, v int32) error { 803 return u.assign(ctx, uint32(v)) 804 } 805 806 func (u *unfolderUint32) OnInt64(ctx *unfoldCtx, v int64) error { 807 return u.assign(ctx, uint32(v)) 808 } 809 810 func (u *unfolderUint32) OnFloat32(ctx *unfoldCtx, v float32) error { 811 return u.assign(ctx, uint32(v)) 812 } 813 814 func (u *unfolderUint32) OnFloat64(ctx *unfoldCtx, v float64) error { 815 return u.assign(ctx, uint32(v)) 816 } 817 818 func (u *unfolderUint64) OnNil(ctx *unfoldCtx) error { 819 return u.assign(ctx, 0) 820 } 821 822 func (u *unfolderUint64) OnByte(ctx *unfoldCtx, v byte) error { 823 return u.assign(ctx, uint64(v)) 824 } 825 826 func (u *unfolderUint64) OnUint(ctx *unfoldCtx, v uint) error { 827 return u.assign(ctx, uint64(v)) 828 } 829 830 func (u *unfolderUint64) OnUint8(ctx *unfoldCtx, v uint8) error { 831 return u.assign(ctx, uint64(v)) 832 } 833 834 func (u *unfolderUint64) OnUint16(ctx *unfoldCtx, v uint16) error { 835 return u.assign(ctx, uint64(v)) 836 } 837 838 func (u *unfolderUint64) OnUint32(ctx *unfoldCtx, v uint32) error { 839 return u.assign(ctx, uint64(v)) 840 } 841 842 func (u *unfolderUint64) OnUint64(ctx *unfoldCtx, v uint64) error { 843 return u.assign(ctx, uint64(v)) 844 } 845 846 func (u *unfolderUint64) OnInt(ctx *unfoldCtx, v int) error { 847 return u.assign(ctx, uint64(v)) 848 } 849 850 func (u *unfolderUint64) OnInt8(ctx *unfoldCtx, v int8) error { 851 return u.assign(ctx, uint64(v)) 852 } 853 854 func (u *unfolderUint64) OnInt16(ctx *unfoldCtx, v int16) error { 855 return u.assign(ctx, uint64(v)) 856 } 857 858 func (u *unfolderUint64) OnInt32(ctx *unfoldCtx, v int32) error { 859 return u.assign(ctx, uint64(v)) 860 } 861 862 func (u *unfolderUint64) OnInt64(ctx *unfoldCtx, v int64) error { 863 return u.assign(ctx, uint64(v)) 864 } 865 866 func (u *unfolderUint64) OnFloat32(ctx *unfoldCtx, v float32) error { 867 return u.assign(ctx, uint64(v)) 868 } 869 870 func (u *unfolderUint64) OnFloat64(ctx *unfoldCtx, v float64) error { 871 return u.assign(ctx, uint64(v)) 872 } 873 874 func (u *unfolderInt) OnNil(ctx *unfoldCtx) error { 875 return u.assign(ctx, 0) 876 } 877 878 func (u *unfolderInt) OnByte(ctx *unfoldCtx, v byte) error { 879 return u.assign(ctx, int(v)) 880 } 881 882 func (u *unfolderInt) OnUint(ctx *unfoldCtx, v uint) error { 883 return u.assign(ctx, int(v)) 884 } 885 886 func (u *unfolderInt) OnUint8(ctx *unfoldCtx, v uint8) error { 887 return u.assign(ctx, int(v)) 888 } 889 890 func (u *unfolderInt) OnUint16(ctx *unfoldCtx, v uint16) error { 891 return u.assign(ctx, int(v)) 892 } 893 894 func (u *unfolderInt) OnUint32(ctx *unfoldCtx, v uint32) error { 895 return u.assign(ctx, int(v)) 896 } 897 898 func (u *unfolderInt) OnUint64(ctx *unfoldCtx, v uint64) error { 899 return u.assign(ctx, int(v)) 900 } 901 902 func (u *unfolderInt) OnInt(ctx *unfoldCtx, v int) error { 903 return u.assign(ctx, int(v)) 904 } 905 906 func (u *unfolderInt) OnInt8(ctx *unfoldCtx, v int8) error { 907 return u.assign(ctx, int(v)) 908 } 909 910 func (u *unfolderInt) OnInt16(ctx *unfoldCtx, v int16) error { 911 return u.assign(ctx, int(v)) 912 } 913 914 func (u *unfolderInt) OnInt32(ctx *unfoldCtx, v int32) error { 915 return u.assign(ctx, int(v)) 916 } 917 918 func (u *unfolderInt) OnInt64(ctx *unfoldCtx, v int64) error { 919 return u.assign(ctx, int(v)) 920 } 921 922 func (u *unfolderInt) OnFloat32(ctx *unfoldCtx, v float32) error { 923 return u.assign(ctx, int(v)) 924 } 925 926 func (u *unfolderInt) OnFloat64(ctx *unfoldCtx, v float64) error { 927 return u.assign(ctx, int(v)) 928 } 929 930 func (u *unfolderInt8) OnNil(ctx *unfoldCtx) error { 931 return u.assign(ctx, 0) 932 } 933 934 func (u *unfolderInt8) OnByte(ctx *unfoldCtx, v byte) error { 935 return u.assign(ctx, int8(v)) 936 } 937 938 func (u *unfolderInt8) OnUint(ctx *unfoldCtx, v uint) error { 939 return u.assign(ctx, int8(v)) 940 } 941 942 func (u *unfolderInt8) OnUint8(ctx *unfoldCtx, v uint8) error { 943 return u.assign(ctx, int8(v)) 944 } 945 946 func (u *unfolderInt8) OnUint16(ctx *unfoldCtx, v uint16) error { 947 return u.assign(ctx, int8(v)) 948 } 949 950 func (u *unfolderInt8) OnUint32(ctx *unfoldCtx, v uint32) error { 951 return u.assign(ctx, int8(v)) 952 } 953 954 func (u *unfolderInt8) OnUint64(ctx *unfoldCtx, v uint64) error { 955 return u.assign(ctx, int8(v)) 956 } 957 958 func (u *unfolderInt8) OnInt(ctx *unfoldCtx, v int) error { 959 return u.assign(ctx, int8(v)) 960 } 961 962 func (u *unfolderInt8) OnInt8(ctx *unfoldCtx, v int8) error { 963 return u.assign(ctx, int8(v)) 964 } 965 966 func (u *unfolderInt8) OnInt16(ctx *unfoldCtx, v int16) error { 967 return u.assign(ctx, int8(v)) 968 } 969 970 func (u *unfolderInt8) OnInt32(ctx *unfoldCtx, v int32) error { 971 return u.assign(ctx, int8(v)) 972 } 973 974 func (u *unfolderInt8) OnInt64(ctx *unfoldCtx, v int64) error { 975 return u.assign(ctx, int8(v)) 976 } 977 978 func (u *unfolderInt8) OnFloat32(ctx *unfoldCtx, v float32) error { 979 return u.assign(ctx, int8(v)) 980 } 981 982 func (u *unfolderInt8) OnFloat64(ctx *unfoldCtx, v float64) error { 983 return u.assign(ctx, int8(v)) 984 } 985 986 func (u *unfolderInt16) OnNil(ctx *unfoldCtx) error { 987 return u.assign(ctx, 0) 988 } 989 990 func (u *unfolderInt16) OnByte(ctx *unfoldCtx, v byte) error { 991 return u.assign(ctx, int16(v)) 992 } 993 994 func (u *unfolderInt16) OnUint(ctx *unfoldCtx, v uint) error { 995 return u.assign(ctx, int16(v)) 996 } 997 998 func (u *unfolderInt16) OnUint8(ctx *unfoldCtx, v uint8) error { 999 return u.assign(ctx, int16(v)) 1000 } 1001 1002 func (u *unfolderInt16) OnUint16(ctx *unfoldCtx, v uint16) error { 1003 return u.assign(ctx, int16(v)) 1004 } 1005 1006 func (u *unfolderInt16) OnUint32(ctx *unfoldCtx, v uint32) error { 1007 return u.assign(ctx, int16(v)) 1008 } 1009 1010 func (u *unfolderInt16) OnUint64(ctx *unfoldCtx, v uint64) error { 1011 return u.assign(ctx, int16(v)) 1012 } 1013 1014 func (u *unfolderInt16) OnInt(ctx *unfoldCtx, v int) error { 1015 return u.assign(ctx, int16(v)) 1016 } 1017 1018 func (u *unfolderInt16) OnInt8(ctx *unfoldCtx, v int8) error { 1019 return u.assign(ctx, int16(v)) 1020 } 1021 1022 func (u *unfolderInt16) OnInt16(ctx *unfoldCtx, v int16) error { 1023 return u.assign(ctx, int16(v)) 1024 } 1025 1026 func (u *unfolderInt16) OnInt32(ctx *unfoldCtx, v int32) error { 1027 return u.assign(ctx, int16(v)) 1028 } 1029 1030 func (u *unfolderInt16) OnInt64(ctx *unfoldCtx, v int64) error { 1031 return u.assign(ctx, int16(v)) 1032 } 1033 1034 func (u *unfolderInt16) OnFloat32(ctx *unfoldCtx, v float32) error { 1035 return u.assign(ctx, int16(v)) 1036 } 1037 1038 func (u *unfolderInt16) OnFloat64(ctx *unfoldCtx, v float64) error { 1039 return u.assign(ctx, int16(v)) 1040 } 1041 1042 func (u *unfolderInt32) OnNil(ctx *unfoldCtx) error { 1043 return u.assign(ctx, 0) 1044 } 1045 1046 func (u *unfolderInt32) OnByte(ctx *unfoldCtx, v byte) error { 1047 return u.assign(ctx, int32(v)) 1048 } 1049 1050 func (u *unfolderInt32) OnUint(ctx *unfoldCtx, v uint) error { 1051 return u.assign(ctx, int32(v)) 1052 } 1053 1054 func (u *unfolderInt32) OnUint8(ctx *unfoldCtx, v uint8) error { 1055 return u.assign(ctx, int32(v)) 1056 } 1057 1058 func (u *unfolderInt32) OnUint16(ctx *unfoldCtx, v uint16) error { 1059 return u.assign(ctx, int32(v)) 1060 } 1061 1062 func (u *unfolderInt32) OnUint32(ctx *unfoldCtx, v uint32) error { 1063 return u.assign(ctx, int32(v)) 1064 } 1065 1066 func (u *unfolderInt32) OnUint64(ctx *unfoldCtx, v uint64) error { 1067 return u.assign(ctx, int32(v)) 1068 } 1069 1070 func (u *unfolderInt32) OnInt(ctx *unfoldCtx, v int) error { 1071 return u.assign(ctx, int32(v)) 1072 } 1073 1074 func (u *unfolderInt32) OnInt8(ctx *unfoldCtx, v int8) error { 1075 return u.assign(ctx, int32(v)) 1076 } 1077 1078 func (u *unfolderInt32) OnInt16(ctx *unfoldCtx, v int16) error { 1079 return u.assign(ctx, int32(v)) 1080 } 1081 1082 func (u *unfolderInt32) OnInt32(ctx *unfoldCtx, v int32) error { 1083 return u.assign(ctx, int32(v)) 1084 } 1085 1086 func (u *unfolderInt32) OnInt64(ctx *unfoldCtx, v int64) error { 1087 return u.assign(ctx, int32(v)) 1088 } 1089 1090 func (u *unfolderInt32) OnFloat32(ctx *unfoldCtx, v float32) error { 1091 return u.assign(ctx, int32(v)) 1092 } 1093 1094 func (u *unfolderInt32) OnFloat64(ctx *unfoldCtx, v float64) error { 1095 return u.assign(ctx, int32(v)) 1096 } 1097 1098 func (u *unfolderInt64) OnNil(ctx *unfoldCtx) error { 1099 return u.assign(ctx, 0) 1100 } 1101 1102 func (u *unfolderInt64) OnByte(ctx *unfoldCtx, v byte) error { 1103 return u.assign(ctx, int64(v)) 1104 } 1105 1106 func (u *unfolderInt64) OnUint(ctx *unfoldCtx, v uint) error { 1107 return u.assign(ctx, int64(v)) 1108 } 1109 1110 func (u *unfolderInt64) OnUint8(ctx *unfoldCtx, v uint8) error { 1111 return u.assign(ctx, int64(v)) 1112 } 1113 1114 func (u *unfolderInt64) OnUint16(ctx *unfoldCtx, v uint16) error { 1115 return u.assign(ctx, int64(v)) 1116 } 1117 1118 func (u *unfolderInt64) OnUint32(ctx *unfoldCtx, v uint32) error { 1119 return u.assign(ctx, int64(v)) 1120 } 1121 1122 func (u *unfolderInt64) OnUint64(ctx *unfoldCtx, v uint64) error { 1123 return u.assign(ctx, int64(v)) 1124 } 1125 1126 func (u *unfolderInt64) OnInt(ctx *unfoldCtx, v int) error { 1127 return u.assign(ctx, int64(v)) 1128 } 1129 1130 func (u *unfolderInt64) OnInt8(ctx *unfoldCtx, v int8) error { 1131 return u.assign(ctx, int64(v)) 1132 } 1133 1134 func (u *unfolderInt64) OnInt16(ctx *unfoldCtx, v int16) error { 1135 return u.assign(ctx, int64(v)) 1136 } 1137 1138 func (u *unfolderInt64) OnInt32(ctx *unfoldCtx, v int32) error { 1139 return u.assign(ctx, int64(v)) 1140 } 1141 1142 func (u *unfolderInt64) OnInt64(ctx *unfoldCtx, v int64) error { 1143 return u.assign(ctx, int64(v)) 1144 } 1145 1146 func (u *unfolderInt64) OnFloat32(ctx *unfoldCtx, v float32) error { 1147 return u.assign(ctx, int64(v)) 1148 } 1149 1150 func (u *unfolderInt64) OnFloat64(ctx *unfoldCtx, v float64) error { 1151 return u.assign(ctx, int64(v)) 1152 } 1153 1154 func (u *unfolderFloat32) OnNil(ctx *unfoldCtx) error { 1155 return u.assign(ctx, 0) 1156 } 1157 1158 func (u *unfolderFloat32) OnByte(ctx *unfoldCtx, v byte) error { 1159 return u.assign(ctx, float32(v)) 1160 } 1161 1162 func (u *unfolderFloat32) OnUint(ctx *unfoldCtx, v uint) error { 1163 return u.assign(ctx, float32(v)) 1164 } 1165 1166 func (u *unfolderFloat32) OnUint8(ctx *unfoldCtx, v uint8) error { 1167 return u.assign(ctx, float32(v)) 1168 } 1169 1170 func (u *unfolderFloat32) OnUint16(ctx *unfoldCtx, v uint16) error { 1171 return u.assign(ctx, float32(v)) 1172 } 1173 1174 func (u *unfolderFloat32) OnUint32(ctx *unfoldCtx, v uint32) error { 1175 return u.assign(ctx, float32(v)) 1176 } 1177 1178 func (u *unfolderFloat32) OnUint64(ctx *unfoldCtx, v uint64) error { 1179 return u.assign(ctx, float32(v)) 1180 } 1181 1182 func (u *unfolderFloat32) OnInt(ctx *unfoldCtx, v int) error { 1183 return u.assign(ctx, float32(v)) 1184 } 1185 1186 func (u *unfolderFloat32) OnInt8(ctx *unfoldCtx, v int8) error { 1187 return u.assign(ctx, float32(v)) 1188 } 1189 1190 func (u *unfolderFloat32) OnInt16(ctx *unfoldCtx, v int16) error { 1191 return u.assign(ctx, float32(v)) 1192 } 1193 1194 func (u *unfolderFloat32) OnInt32(ctx *unfoldCtx, v int32) error { 1195 return u.assign(ctx, float32(v)) 1196 } 1197 1198 func (u *unfolderFloat32) OnInt64(ctx *unfoldCtx, v int64) error { 1199 return u.assign(ctx, float32(v)) 1200 } 1201 1202 func (u *unfolderFloat32) OnFloat32(ctx *unfoldCtx, v float32) error { 1203 return u.assign(ctx, float32(v)) 1204 } 1205 1206 func (u *unfolderFloat32) OnFloat64(ctx *unfoldCtx, v float64) error { 1207 return u.assign(ctx, float32(v)) 1208 } 1209 1210 func (u *unfolderFloat64) OnNil(ctx *unfoldCtx) error { 1211 return u.assign(ctx, 0) 1212 } 1213 1214 func (u *unfolderFloat64) OnByte(ctx *unfoldCtx, v byte) error { 1215 return u.assign(ctx, float64(v)) 1216 } 1217 1218 func (u *unfolderFloat64) OnUint(ctx *unfoldCtx, v uint) error { 1219 return u.assign(ctx, float64(v)) 1220 } 1221 1222 func (u *unfolderFloat64) OnUint8(ctx *unfoldCtx, v uint8) error { 1223 return u.assign(ctx, float64(v)) 1224 } 1225 1226 func (u *unfolderFloat64) OnUint16(ctx *unfoldCtx, v uint16) error { 1227 return u.assign(ctx, float64(v)) 1228 } 1229 1230 func (u *unfolderFloat64) OnUint32(ctx *unfoldCtx, v uint32) error { 1231 return u.assign(ctx, float64(v)) 1232 } 1233 1234 func (u *unfolderFloat64) OnUint64(ctx *unfoldCtx, v uint64) error { 1235 return u.assign(ctx, float64(v)) 1236 } 1237 1238 func (u *unfolderFloat64) OnInt(ctx *unfoldCtx, v int) error { 1239 return u.assign(ctx, float64(v)) 1240 } 1241 1242 func (u *unfolderFloat64) OnInt8(ctx *unfoldCtx, v int8) error { 1243 return u.assign(ctx, float64(v)) 1244 } 1245 1246 func (u *unfolderFloat64) OnInt16(ctx *unfoldCtx, v int16) error { 1247 return u.assign(ctx, float64(v)) 1248 } 1249 1250 func (u *unfolderFloat64) OnInt32(ctx *unfoldCtx, v int32) error { 1251 return u.assign(ctx, float64(v)) 1252 } 1253 1254 func (u *unfolderFloat64) OnInt64(ctx *unfoldCtx, v int64) error { 1255 return u.assign(ctx, float64(v)) 1256 } 1257 1258 func (u *unfolderFloat64) OnFloat32(ctx *unfoldCtx, v float32) error { 1259 return u.assign(ctx, float64(v)) 1260 } 1261 1262 func (u *unfolderFloat64) OnFloat64(ctx *unfoldCtx, v float64) error { 1263 return u.assign(ctx, float64(v)) 1264 } 1265 1266 /* 1267 func (*unfolderIfc) OnArrayStart(ctx *unfoldCtx, l int, bt structform.BaseType) error { 1268 return unfoldIfcStartSubArray(ctx, l, bt) 1269 } 1270 1271 func (u *unfolderIfc) OnChildArrayDone(ctx *unfoldCtx) error { 1272 v, err := unfoldIfcFinishSubArray(ctx) 1273 if err == nil { 1274 err = u.assign(ctx, v) 1275 } 1276 return err 1277 } 1278 */