flag.go (75768B)
1 package bitutil 2 3 import ( 4 "unsafe" 5 ) 6 7 // Flags8 is a type-casted unsigned integer with helper 8 // methods for easily managing up to 8 bit-flags. 9 type Flags8 uint8 10 11 // Get will fetch the flag bit value at index 'bit'. 12 func (f Flags8) Get(bit uint8) bool { 13 mask := Flags8(1) << bit 14 return (f&mask != 0) 15 } 16 17 // Set will set the flag bit value at index 'bit'. 18 func (f Flags8) Set(bit uint8) Flags8 { 19 mask := Flags8(1) << bit 20 return f | mask 21 } 22 23 // Unset will unset the flag bit value at index 'bit'. 24 func (f Flags8) Unset(bit uint8) Flags8 { 25 mask := Flags8(1) << bit 26 return f & ^mask 27 } 28 29 // Get0 will fetch the flag bit value at index 0. 30 func (f Flags8) Get0() bool { 31 const mask = Flags8(1) << 0 32 return (f&mask != 0) 33 } 34 35 // Set0 will set the flag bit value at index 0. 36 func (f Flags8) Set0() Flags8 { 37 const mask = Flags8(1) << 0 38 return f | mask 39 } 40 41 // Unset0 will unset the flag bit value at index 0. 42 func (f Flags8) Unset0() Flags8 { 43 const mask = Flags8(1) << 0 44 return f & ^mask 45 } 46 47 // Get1 will fetch the flag bit value at index 1. 48 func (f Flags8) Get1() bool { 49 const mask = Flags8(1) << 1 50 return (f&mask != 0) 51 } 52 53 // Set1 will set the flag bit value at index 1. 54 func (f Flags8) Set1() Flags8 { 55 const mask = Flags8(1) << 1 56 return f | mask 57 } 58 59 // Unset1 will unset the flag bit value at index 1. 60 func (f Flags8) Unset1() Flags8 { 61 const mask = Flags8(1) << 1 62 return f & ^mask 63 } 64 65 // Get2 will fetch the flag bit value at index 2. 66 func (f Flags8) Get2() bool { 67 const mask = Flags8(1) << 2 68 return (f&mask != 0) 69 } 70 71 // Set2 will set the flag bit value at index 2. 72 func (f Flags8) Set2() Flags8 { 73 const mask = Flags8(1) << 2 74 return f | mask 75 } 76 77 // Unset2 will unset the flag bit value at index 2. 78 func (f Flags8) Unset2() Flags8 { 79 const mask = Flags8(1) << 2 80 return f & ^mask 81 } 82 83 // Get3 will fetch the flag bit value at index 3. 84 func (f Flags8) Get3() bool { 85 const mask = Flags8(1) << 3 86 return (f&mask != 0) 87 } 88 89 // Set3 will set the flag bit value at index 3. 90 func (f Flags8) Set3() Flags8 { 91 const mask = Flags8(1) << 3 92 return f | mask 93 } 94 95 // Unset3 will unset the flag bit value at index 3. 96 func (f Flags8) Unset3() Flags8 { 97 const mask = Flags8(1) << 3 98 return f & ^mask 99 } 100 101 // Get4 will fetch the flag bit value at index 4. 102 func (f Flags8) Get4() bool { 103 const mask = Flags8(1) << 4 104 return (f&mask != 0) 105 } 106 107 // Set4 will set the flag bit value at index 4. 108 func (f Flags8) Set4() Flags8 { 109 const mask = Flags8(1) << 4 110 return f | mask 111 } 112 113 // Unset4 will unset the flag bit value at index 4. 114 func (f Flags8) Unset4() Flags8 { 115 const mask = Flags8(1) << 4 116 return f & ^mask 117 } 118 119 // Get5 will fetch the flag bit value at index 5. 120 func (f Flags8) Get5() bool { 121 const mask = Flags8(1) << 5 122 return (f&mask != 0) 123 } 124 125 // Set5 will set the flag bit value at index 5. 126 func (f Flags8) Set5() Flags8 { 127 const mask = Flags8(1) << 5 128 return f | mask 129 } 130 131 // Unset5 will unset the flag bit value at index 5. 132 func (f Flags8) Unset5() Flags8 { 133 const mask = Flags8(1) << 5 134 return f & ^mask 135 } 136 137 // Get6 will fetch the flag bit value at index 6. 138 func (f Flags8) Get6() bool { 139 const mask = Flags8(1) << 6 140 return (f&mask != 0) 141 } 142 143 // Set6 will set the flag bit value at index 6. 144 func (f Flags8) Set6() Flags8 { 145 const mask = Flags8(1) << 6 146 return f | mask 147 } 148 149 // Unset6 will unset the flag bit value at index 6. 150 func (f Flags8) Unset6() Flags8 { 151 const mask = Flags8(1) << 6 152 return f & ^mask 153 } 154 155 // Get7 will fetch the flag bit value at index 7. 156 func (f Flags8) Get7() bool { 157 const mask = Flags8(1) << 7 158 return (f&mask != 0) 159 } 160 161 // Set7 will set the flag bit value at index 7. 162 func (f Flags8) Set7() Flags8 { 163 const mask = Flags8(1) << 7 164 return f | mask 165 } 166 167 // Unset7 will unset the flag bit value at index 7. 168 func (f Flags8) Unset7() Flags8 { 169 const mask = Flags8(1) << 7 170 return f & ^mask 171 } 172 173 // String returns a human readable representation of Flags8. 174 func (f Flags8) String() string { 175 var ( 176 i int 177 val bool 178 buf []byte 179 ) 180 181 // Make a prealloc est. based on longest-possible value 182 const prealloc = 1 + (len("false ") * 8) - 1 + 1 183 buf = make([]byte, prealloc) 184 185 buf[i] = '{' 186 i++ 187 188 val = f.Get0() 189 i += copy(buf[i:], bool2str(val)) 190 buf[i] = ' ' 191 i++ 192 193 val = f.Get1() 194 i += copy(buf[i:], bool2str(val)) 195 buf[i] = ' ' 196 i++ 197 198 val = f.Get2() 199 i += copy(buf[i:], bool2str(val)) 200 buf[i] = ' ' 201 i++ 202 203 val = f.Get3() 204 i += copy(buf[i:], bool2str(val)) 205 buf[i] = ' ' 206 i++ 207 208 val = f.Get4() 209 i += copy(buf[i:], bool2str(val)) 210 buf[i] = ' ' 211 i++ 212 213 val = f.Get5() 214 i += copy(buf[i:], bool2str(val)) 215 buf[i] = ' ' 216 i++ 217 218 val = f.Get6() 219 i += copy(buf[i:], bool2str(val)) 220 buf[i] = ' ' 221 i++ 222 223 val = f.Get7() 224 i += copy(buf[i:], bool2str(val)) 225 buf[i] = ' ' 226 i++ 227 228 buf[i-1] = '}' 229 buf = buf[:i] 230 231 return *(*string)(unsafe.Pointer(&buf)) 232 } 233 234 // GoString returns a more verbose human readable representation of Flags8. 235 func (f Flags8) GoString() string { 236 var ( 237 i int 238 val bool 239 buf []byte 240 ) 241 242 // Make a prealloc est. based on longest-possible value 243 const prealloc = len("bitutil.Flags8{") + (len("7=false ") * 8) - 1 + 1 244 buf = make([]byte, prealloc) 245 246 i += copy(buf[i:], "bitutil.Flags8{") 247 248 val = f.Get0() 249 i += copy(buf[i:], "0=") 250 i += copy(buf[i:], bool2str(val)) 251 buf[i] = ' ' 252 i++ 253 254 val = f.Get1() 255 i += copy(buf[i:], "1=") 256 i += copy(buf[i:], bool2str(val)) 257 buf[i] = ' ' 258 i++ 259 260 val = f.Get2() 261 i += copy(buf[i:], "2=") 262 i += copy(buf[i:], bool2str(val)) 263 buf[i] = ' ' 264 i++ 265 266 val = f.Get3() 267 i += copy(buf[i:], "3=") 268 i += copy(buf[i:], bool2str(val)) 269 buf[i] = ' ' 270 i++ 271 272 val = f.Get4() 273 i += copy(buf[i:], "4=") 274 i += copy(buf[i:], bool2str(val)) 275 buf[i] = ' ' 276 i++ 277 278 val = f.Get5() 279 i += copy(buf[i:], "5=") 280 i += copy(buf[i:], bool2str(val)) 281 buf[i] = ' ' 282 i++ 283 284 val = f.Get6() 285 i += copy(buf[i:], "6=") 286 i += copy(buf[i:], bool2str(val)) 287 buf[i] = ' ' 288 i++ 289 290 val = f.Get7() 291 i += copy(buf[i:], "7=") 292 i += copy(buf[i:], bool2str(val)) 293 buf[i] = ' ' 294 i++ 295 296 buf[i-1] = '}' 297 buf = buf[:i] 298 299 return *(*string)(unsafe.Pointer(&buf)) 300 } 301 302 // Flags16 is a type-casted unsigned integer with helper 303 // methods for easily managing up to 16 bit-flags. 304 type Flags16 uint16 305 306 // Get will fetch the flag bit value at index 'bit'. 307 func (f Flags16) Get(bit uint8) bool { 308 mask := Flags16(1) << bit 309 return (f&mask != 0) 310 } 311 312 // Set will set the flag bit value at index 'bit'. 313 func (f Flags16) Set(bit uint8) Flags16 { 314 mask := Flags16(1) << bit 315 return f | mask 316 } 317 318 // Unset will unset the flag bit value at index 'bit'. 319 func (f Flags16) Unset(bit uint8) Flags16 { 320 mask := Flags16(1) << bit 321 return f & ^mask 322 } 323 324 // Get0 will fetch the flag bit value at index 0. 325 func (f Flags16) Get0() bool { 326 const mask = Flags16(1) << 0 327 return (f&mask != 0) 328 } 329 330 // Set0 will set the flag bit value at index 0. 331 func (f Flags16) Set0() Flags16 { 332 const mask = Flags16(1) << 0 333 return f | mask 334 } 335 336 // Unset0 will unset the flag bit value at index 0. 337 func (f Flags16) Unset0() Flags16 { 338 const mask = Flags16(1) << 0 339 return f & ^mask 340 } 341 342 // Get1 will fetch the flag bit value at index 1. 343 func (f Flags16) Get1() bool { 344 const mask = Flags16(1) << 1 345 return (f&mask != 0) 346 } 347 348 // Set1 will set the flag bit value at index 1. 349 func (f Flags16) Set1() Flags16 { 350 const mask = Flags16(1) << 1 351 return f | mask 352 } 353 354 // Unset1 will unset the flag bit value at index 1. 355 func (f Flags16) Unset1() Flags16 { 356 const mask = Flags16(1) << 1 357 return f & ^mask 358 } 359 360 // Get2 will fetch the flag bit value at index 2. 361 func (f Flags16) Get2() bool { 362 const mask = Flags16(1) << 2 363 return (f&mask != 0) 364 } 365 366 // Set2 will set the flag bit value at index 2. 367 func (f Flags16) Set2() Flags16 { 368 const mask = Flags16(1) << 2 369 return f | mask 370 } 371 372 // Unset2 will unset the flag bit value at index 2. 373 func (f Flags16) Unset2() Flags16 { 374 const mask = Flags16(1) << 2 375 return f & ^mask 376 } 377 378 // Get3 will fetch the flag bit value at index 3. 379 func (f Flags16) Get3() bool { 380 const mask = Flags16(1) << 3 381 return (f&mask != 0) 382 } 383 384 // Set3 will set the flag bit value at index 3. 385 func (f Flags16) Set3() Flags16 { 386 const mask = Flags16(1) << 3 387 return f | mask 388 } 389 390 // Unset3 will unset the flag bit value at index 3. 391 func (f Flags16) Unset3() Flags16 { 392 const mask = Flags16(1) << 3 393 return f & ^mask 394 } 395 396 // Get4 will fetch the flag bit value at index 4. 397 func (f Flags16) Get4() bool { 398 const mask = Flags16(1) << 4 399 return (f&mask != 0) 400 } 401 402 // Set4 will set the flag bit value at index 4. 403 func (f Flags16) Set4() Flags16 { 404 const mask = Flags16(1) << 4 405 return f | mask 406 } 407 408 // Unset4 will unset the flag bit value at index 4. 409 func (f Flags16) Unset4() Flags16 { 410 const mask = Flags16(1) << 4 411 return f & ^mask 412 } 413 414 // Get5 will fetch the flag bit value at index 5. 415 func (f Flags16) Get5() bool { 416 const mask = Flags16(1) << 5 417 return (f&mask != 0) 418 } 419 420 // Set5 will set the flag bit value at index 5. 421 func (f Flags16) Set5() Flags16 { 422 const mask = Flags16(1) << 5 423 return f | mask 424 } 425 426 // Unset5 will unset the flag bit value at index 5. 427 func (f Flags16) Unset5() Flags16 { 428 const mask = Flags16(1) << 5 429 return f & ^mask 430 } 431 432 // Get6 will fetch the flag bit value at index 6. 433 func (f Flags16) Get6() bool { 434 const mask = Flags16(1) << 6 435 return (f&mask != 0) 436 } 437 438 // Set6 will set the flag bit value at index 6. 439 func (f Flags16) Set6() Flags16 { 440 const mask = Flags16(1) << 6 441 return f | mask 442 } 443 444 // Unset6 will unset the flag bit value at index 6. 445 func (f Flags16) Unset6() Flags16 { 446 const mask = Flags16(1) << 6 447 return f & ^mask 448 } 449 450 // Get7 will fetch the flag bit value at index 7. 451 func (f Flags16) Get7() bool { 452 const mask = Flags16(1) << 7 453 return (f&mask != 0) 454 } 455 456 // Set7 will set the flag bit value at index 7. 457 func (f Flags16) Set7() Flags16 { 458 const mask = Flags16(1) << 7 459 return f | mask 460 } 461 462 // Unset7 will unset the flag bit value at index 7. 463 func (f Flags16) Unset7() Flags16 { 464 const mask = Flags16(1) << 7 465 return f & ^mask 466 } 467 468 // Get8 will fetch the flag bit value at index 8. 469 func (f Flags16) Get8() bool { 470 const mask = Flags16(1) << 8 471 return (f&mask != 0) 472 } 473 474 // Set8 will set the flag bit value at index 8. 475 func (f Flags16) Set8() Flags16 { 476 const mask = Flags16(1) << 8 477 return f | mask 478 } 479 480 // Unset8 will unset the flag bit value at index 8. 481 func (f Flags16) Unset8() Flags16 { 482 const mask = Flags16(1) << 8 483 return f & ^mask 484 } 485 486 // Get9 will fetch the flag bit value at index 9. 487 func (f Flags16) Get9() bool { 488 const mask = Flags16(1) << 9 489 return (f&mask != 0) 490 } 491 492 // Set9 will set the flag bit value at index 9. 493 func (f Flags16) Set9() Flags16 { 494 const mask = Flags16(1) << 9 495 return f | mask 496 } 497 498 // Unset9 will unset the flag bit value at index 9. 499 func (f Flags16) Unset9() Flags16 { 500 const mask = Flags16(1) << 9 501 return f & ^mask 502 } 503 504 // Get10 will fetch the flag bit value at index 10. 505 func (f Flags16) Get10() bool { 506 const mask = Flags16(1) << 10 507 return (f&mask != 0) 508 } 509 510 // Set10 will set the flag bit value at index 10. 511 func (f Flags16) Set10() Flags16 { 512 const mask = Flags16(1) << 10 513 return f | mask 514 } 515 516 // Unset10 will unset the flag bit value at index 10. 517 func (f Flags16) Unset10() Flags16 { 518 const mask = Flags16(1) << 10 519 return f & ^mask 520 } 521 522 // Get11 will fetch the flag bit value at index 11. 523 func (f Flags16) Get11() bool { 524 const mask = Flags16(1) << 11 525 return (f&mask != 0) 526 } 527 528 // Set11 will set the flag bit value at index 11. 529 func (f Flags16) Set11() Flags16 { 530 const mask = Flags16(1) << 11 531 return f | mask 532 } 533 534 // Unset11 will unset the flag bit value at index 11. 535 func (f Flags16) Unset11() Flags16 { 536 const mask = Flags16(1) << 11 537 return f & ^mask 538 } 539 540 // Get12 will fetch the flag bit value at index 12. 541 func (f Flags16) Get12() bool { 542 const mask = Flags16(1) << 12 543 return (f&mask != 0) 544 } 545 546 // Set12 will set the flag bit value at index 12. 547 func (f Flags16) Set12() Flags16 { 548 const mask = Flags16(1) << 12 549 return f | mask 550 } 551 552 // Unset12 will unset the flag bit value at index 12. 553 func (f Flags16) Unset12() Flags16 { 554 const mask = Flags16(1) << 12 555 return f & ^mask 556 } 557 558 // Get13 will fetch the flag bit value at index 13. 559 func (f Flags16) Get13() bool { 560 const mask = Flags16(1) << 13 561 return (f&mask != 0) 562 } 563 564 // Set13 will set the flag bit value at index 13. 565 func (f Flags16) Set13() Flags16 { 566 const mask = Flags16(1) << 13 567 return f | mask 568 } 569 570 // Unset13 will unset the flag bit value at index 13. 571 func (f Flags16) Unset13() Flags16 { 572 const mask = Flags16(1) << 13 573 return f & ^mask 574 } 575 576 // Get14 will fetch the flag bit value at index 14. 577 func (f Flags16) Get14() bool { 578 const mask = Flags16(1) << 14 579 return (f&mask != 0) 580 } 581 582 // Set14 will set the flag bit value at index 14. 583 func (f Flags16) Set14() Flags16 { 584 const mask = Flags16(1) << 14 585 return f | mask 586 } 587 588 // Unset14 will unset the flag bit value at index 14. 589 func (f Flags16) Unset14() Flags16 { 590 const mask = Flags16(1) << 14 591 return f & ^mask 592 } 593 594 // Get15 will fetch the flag bit value at index 15. 595 func (f Flags16) Get15() bool { 596 const mask = Flags16(1) << 15 597 return (f&mask != 0) 598 } 599 600 // Set15 will set the flag bit value at index 15. 601 func (f Flags16) Set15() Flags16 { 602 const mask = Flags16(1) << 15 603 return f | mask 604 } 605 606 // Unset15 will unset the flag bit value at index 15. 607 func (f Flags16) Unset15() Flags16 { 608 const mask = Flags16(1) << 15 609 return f & ^mask 610 } 611 612 // String returns a human readable representation of Flags16. 613 func (f Flags16) String() string { 614 var ( 615 i int 616 val bool 617 buf []byte 618 ) 619 620 // Make a prealloc est. based on longest-possible value 621 const prealloc = 1 + (len("false ") * 16) - 1 + 1 622 buf = make([]byte, prealloc) 623 624 buf[i] = '{' 625 i++ 626 627 val = f.Get0() 628 i += copy(buf[i:], bool2str(val)) 629 buf[i] = ' ' 630 i++ 631 632 val = f.Get1() 633 i += copy(buf[i:], bool2str(val)) 634 buf[i] = ' ' 635 i++ 636 637 val = f.Get2() 638 i += copy(buf[i:], bool2str(val)) 639 buf[i] = ' ' 640 i++ 641 642 val = f.Get3() 643 i += copy(buf[i:], bool2str(val)) 644 buf[i] = ' ' 645 i++ 646 647 val = f.Get4() 648 i += copy(buf[i:], bool2str(val)) 649 buf[i] = ' ' 650 i++ 651 652 val = f.Get5() 653 i += copy(buf[i:], bool2str(val)) 654 buf[i] = ' ' 655 i++ 656 657 val = f.Get6() 658 i += copy(buf[i:], bool2str(val)) 659 buf[i] = ' ' 660 i++ 661 662 val = f.Get7() 663 i += copy(buf[i:], bool2str(val)) 664 buf[i] = ' ' 665 i++ 666 667 val = f.Get8() 668 i += copy(buf[i:], bool2str(val)) 669 buf[i] = ' ' 670 i++ 671 672 val = f.Get9() 673 i += copy(buf[i:], bool2str(val)) 674 buf[i] = ' ' 675 i++ 676 677 val = f.Get10() 678 i += copy(buf[i:], bool2str(val)) 679 buf[i] = ' ' 680 i++ 681 682 val = f.Get11() 683 i += copy(buf[i:], bool2str(val)) 684 buf[i] = ' ' 685 i++ 686 687 val = f.Get12() 688 i += copy(buf[i:], bool2str(val)) 689 buf[i] = ' ' 690 i++ 691 692 val = f.Get13() 693 i += copy(buf[i:], bool2str(val)) 694 buf[i] = ' ' 695 i++ 696 697 val = f.Get14() 698 i += copy(buf[i:], bool2str(val)) 699 buf[i] = ' ' 700 i++ 701 702 val = f.Get15() 703 i += copy(buf[i:], bool2str(val)) 704 buf[i] = ' ' 705 i++ 706 707 buf[i-1] = '}' 708 buf = buf[:i] 709 710 return *(*string)(unsafe.Pointer(&buf)) 711 } 712 713 // GoString returns a more verbose human readable representation of Flags16. 714 func (f Flags16) GoString() string { 715 var ( 716 i int 717 val bool 718 buf []byte 719 ) 720 721 // Make a prealloc est. based on longest-possible value 722 const prealloc = len("bitutil.Flags16{") + (len("15=false ") * 16) - 1 + 1 723 buf = make([]byte, prealloc) 724 725 i += copy(buf[i:], "bitutil.Flags16{") 726 727 val = f.Get0() 728 i += copy(buf[i:], "0=") 729 i += copy(buf[i:], bool2str(val)) 730 buf[i] = ' ' 731 i++ 732 733 val = f.Get1() 734 i += copy(buf[i:], "1=") 735 i += copy(buf[i:], bool2str(val)) 736 buf[i] = ' ' 737 i++ 738 739 val = f.Get2() 740 i += copy(buf[i:], "2=") 741 i += copy(buf[i:], bool2str(val)) 742 buf[i] = ' ' 743 i++ 744 745 val = f.Get3() 746 i += copy(buf[i:], "3=") 747 i += copy(buf[i:], bool2str(val)) 748 buf[i] = ' ' 749 i++ 750 751 val = f.Get4() 752 i += copy(buf[i:], "4=") 753 i += copy(buf[i:], bool2str(val)) 754 buf[i] = ' ' 755 i++ 756 757 val = f.Get5() 758 i += copy(buf[i:], "5=") 759 i += copy(buf[i:], bool2str(val)) 760 buf[i] = ' ' 761 i++ 762 763 val = f.Get6() 764 i += copy(buf[i:], "6=") 765 i += copy(buf[i:], bool2str(val)) 766 buf[i] = ' ' 767 i++ 768 769 val = f.Get7() 770 i += copy(buf[i:], "7=") 771 i += copy(buf[i:], bool2str(val)) 772 buf[i] = ' ' 773 i++ 774 775 val = f.Get8() 776 i += copy(buf[i:], "8=") 777 i += copy(buf[i:], bool2str(val)) 778 buf[i] = ' ' 779 i++ 780 781 val = f.Get9() 782 i += copy(buf[i:], "9=") 783 i += copy(buf[i:], bool2str(val)) 784 buf[i] = ' ' 785 i++ 786 787 val = f.Get10() 788 i += copy(buf[i:], "10=") 789 i += copy(buf[i:], bool2str(val)) 790 buf[i] = ' ' 791 i++ 792 793 val = f.Get11() 794 i += copy(buf[i:], "11=") 795 i += copy(buf[i:], bool2str(val)) 796 buf[i] = ' ' 797 i++ 798 799 val = f.Get12() 800 i += copy(buf[i:], "12=") 801 i += copy(buf[i:], bool2str(val)) 802 buf[i] = ' ' 803 i++ 804 805 val = f.Get13() 806 i += copy(buf[i:], "13=") 807 i += copy(buf[i:], bool2str(val)) 808 buf[i] = ' ' 809 i++ 810 811 val = f.Get14() 812 i += copy(buf[i:], "14=") 813 i += copy(buf[i:], bool2str(val)) 814 buf[i] = ' ' 815 i++ 816 817 val = f.Get15() 818 i += copy(buf[i:], "15=") 819 i += copy(buf[i:], bool2str(val)) 820 buf[i] = ' ' 821 i++ 822 823 buf[i-1] = '}' 824 buf = buf[:i] 825 826 return *(*string)(unsafe.Pointer(&buf)) 827 } 828 829 // Flags32 is a type-casted unsigned integer with helper 830 // methods for easily managing up to 32 bit-flags. 831 type Flags32 uint32 832 833 // Get will fetch the flag bit value at index 'bit'. 834 func (f Flags32) Get(bit uint8) bool { 835 mask := Flags32(1) << bit 836 return (f&mask != 0) 837 } 838 839 // Set will set the flag bit value at index 'bit'. 840 func (f Flags32) Set(bit uint8) Flags32 { 841 mask := Flags32(1) << bit 842 return f | mask 843 } 844 845 // Unset will unset the flag bit value at index 'bit'. 846 func (f Flags32) Unset(bit uint8) Flags32 { 847 mask := Flags32(1) << bit 848 return f & ^mask 849 } 850 851 // Get0 will fetch the flag bit value at index 0. 852 func (f Flags32) Get0() bool { 853 const mask = Flags32(1) << 0 854 return (f&mask != 0) 855 } 856 857 // Set0 will set the flag bit value at index 0. 858 func (f Flags32) Set0() Flags32 { 859 const mask = Flags32(1) << 0 860 return f | mask 861 } 862 863 // Unset0 will unset the flag bit value at index 0. 864 func (f Flags32) Unset0() Flags32 { 865 const mask = Flags32(1) << 0 866 return f & ^mask 867 } 868 869 // Get1 will fetch the flag bit value at index 1. 870 func (f Flags32) Get1() bool { 871 const mask = Flags32(1) << 1 872 return (f&mask != 0) 873 } 874 875 // Set1 will set the flag bit value at index 1. 876 func (f Flags32) Set1() Flags32 { 877 const mask = Flags32(1) << 1 878 return f | mask 879 } 880 881 // Unset1 will unset the flag bit value at index 1. 882 func (f Flags32) Unset1() Flags32 { 883 const mask = Flags32(1) << 1 884 return f & ^mask 885 } 886 887 // Get2 will fetch the flag bit value at index 2. 888 func (f Flags32) Get2() bool { 889 const mask = Flags32(1) << 2 890 return (f&mask != 0) 891 } 892 893 // Set2 will set the flag bit value at index 2. 894 func (f Flags32) Set2() Flags32 { 895 const mask = Flags32(1) << 2 896 return f | mask 897 } 898 899 // Unset2 will unset the flag bit value at index 2. 900 func (f Flags32) Unset2() Flags32 { 901 const mask = Flags32(1) << 2 902 return f & ^mask 903 } 904 905 // Get3 will fetch the flag bit value at index 3. 906 func (f Flags32) Get3() bool { 907 const mask = Flags32(1) << 3 908 return (f&mask != 0) 909 } 910 911 // Set3 will set the flag bit value at index 3. 912 func (f Flags32) Set3() Flags32 { 913 const mask = Flags32(1) << 3 914 return f | mask 915 } 916 917 // Unset3 will unset the flag bit value at index 3. 918 func (f Flags32) Unset3() Flags32 { 919 const mask = Flags32(1) << 3 920 return f & ^mask 921 } 922 923 // Get4 will fetch the flag bit value at index 4. 924 func (f Flags32) Get4() bool { 925 const mask = Flags32(1) << 4 926 return (f&mask != 0) 927 } 928 929 // Set4 will set the flag bit value at index 4. 930 func (f Flags32) Set4() Flags32 { 931 const mask = Flags32(1) << 4 932 return f | mask 933 } 934 935 // Unset4 will unset the flag bit value at index 4. 936 func (f Flags32) Unset4() Flags32 { 937 const mask = Flags32(1) << 4 938 return f & ^mask 939 } 940 941 // Get5 will fetch the flag bit value at index 5. 942 func (f Flags32) Get5() bool { 943 const mask = Flags32(1) << 5 944 return (f&mask != 0) 945 } 946 947 // Set5 will set the flag bit value at index 5. 948 func (f Flags32) Set5() Flags32 { 949 const mask = Flags32(1) << 5 950 return f | mask 951 } 952 953 // Unset5 will unset the flag bit value at index 5. 954 func (f Flags32) Unset5() Flags32 { 955 const mask = Flags32(1) << 5 956 return f & ^mask 957 } 958 959 // Get6 will fetch the flag bit value at index 6. 960 func (f Flags32) Get6() bool { 961 const mask = Flags32(1) << 6 962 return (f&mask != 0) 963 } 964 965 // Set6 will set the flag bit value at index 6. 966 func (f Flags32) Set6() Flags32 { 967 const mask = Flags32(1) << 6 968 return f | mask 969 } 970 971 // Unset6 will unset the flag bit value at index 6. 972 func (f Flags32) Unset6() Flags32 { 973 const mask = Flags32(1) << 6 974 return f & ^mask 975 } 976 977 // Get7 will fetch the flag bit value at index 7. 978 func (f Flags32) Get7() bool { 979 const mask = Flags32(1) << 7 980 return (f&mask != 0) 981 } 982 983 // Set7 will set the flag bit value at index 7. 984 func (f Flags32) Set7() Flags32 { 985 const mask = Flags32(1) << 7 986 return f | mask 987 } 988 989 // Unset7 will unset the flag bit value at index 7. 990 func (f Flags32) Unset7() Flags32 { 991 const mask = Flags32(1) << 7 992 return f & ^mask 993 } 994 995 // Get8 will fetch the flag bit value at index 8. 996 func (f Flags32) Get8() bool { 997 const mask = Flags32(1) << 8 998 return (f&mask != 0) 999 } 1000 1001 // Set8 will set the flag bit value at index 8. 1002 func (f Flags32) Set8() Flags32 { 1003 const mask = Flags32(1) << 8 1004 return f | mask 1005 } 1006 1007 // Unset8 will unset the flag bit value at index 8. 1008 func (f Flags32) Unset8() Flags32 { 1009 const mask = Flags32(1) << 8 1010 return f & ^mask 1011 } 1012 1013 // Get9 will fetch the flag bit value at index 9. 1014 func (f Flags32) Get9() bool { 1015 const mask = Flags32(1) << 9 1016 return (f&mask != 0) 1017 } 1018 1019 // Set9 will set the flag bit value at index 9. 1020 func (f Flags32) Set9() Flags32 { 1021 const mask = Flags32(1) << 9 1022 return f | mask 1023 } 1024 1025 // Unset9 will unset the flag bit value at index 9. 1026 func (f Flags32) Unset9() Flags32 { 1027 const mask = Flags32(1) << 9 1028 return f & ^mask 1029 } 1030 1031 // Get10 will fetch the flag bit value at index 10. 1032 func (f Flags32) Get10() bool { 1033 const mask = Flags32(1) << 10 1034 return (f&mask != 0) 1035 } 1036 1037 // Set10 will set the flag bit value at index 10. 1038 func (f Flags32) Set10() Flags32 { 1039 const mask = Flags32(1) << 10 1040 return f | mask 1041 } 1042 1043 // Unset10 will unset the flag bit value at index 10. 1044 func (f Flags32) Unset10() Flags32 { 1045 const mask = Flags32(1) << 10 1046 return f & ^mask 1047 } 1048 1049 // Get11 will fetch the flag bit value at index 11. 1050 func (f Flags32) Get11() bool { 1051 const mask = Flags32(1) << 11 1052 return (f&mask != 0) 1053 } 1054 1055 // Set11 will set the flag bit value at index 11. 1056 func (f Flags32) Set11() Flags32 { 1057 const mask = Flags32(1) << 11 1058 return f | mask 1059 } 1060 1061 // Unset11 will unset the flag bit value at index 11. 1062 func (f Flags32) Unset11() Flags32 { 1063 const mask = Flags32(1) << 11 1064 return f & ^mask 1065 } 1066 1067 // Get12 will fetch the flag bit value at index 12. 1068 func (f Flags32) Get12() bool { 1069 const mask = Flags32(1) << 12 1070 return (f&mask != 0) 1071 } 1072 1073 // Set12 will set the flag bit value at index 12. 1074 func (f Flags32) Set12() Flags32 { 1075 const mask = Flags32(1) << 12 1076 return f | mask 1077 } 1078 1079 // Unset12 will unset the flag bit value at index 12. 1080 func (f Flags32) Unset12() Flags32 { 1081 const mask = Flags32(1) << 12 1082 return f & ^mask 1083 } 1084 1085 // Get13 will fetch the flag bit value at index 13. 1086 func (f Flags32) Get13() bool { 1087 const mask = Flags32(1) << 13 1088 return (f&mask != 0) 1089 } 1090 1091 // Set13 will set the flag bit value at index 13. 1092 func (f Flags32) Set13() Flags32 { 1093 const mask = Flags32(1) << 13 1094 return f | mask 1095 } 1096 1097 // Unset13 will unset the flag bit value at index 13. 1098 func (f Flags32) Unset13() Flags32 { 1099 const mask = Flags32(1) << 13 1100 return f & ^mask 1101 } 1102 1103 // Get14 will fetch the flag bit value at index 14. 1104 func (f Flags32) Get14() bool { 1105 const mask = Flags32(1) << 14 1106 return (f&mask != 0) 1107 } 1108 1109 // Set14 will set the flag bit value at index 14. 1110 func (f Flags32) Set14() Flags32 { 1111 const mask = Flags32(1) << 14 1112 return f | mask 1113 } 1114 1115 // Unset14 will unset the flag bit value at index 14. 1116 func (f Flags32) Unset14() Flags32 { 1117 const mask = Flags32(1) << 14 1118 return f & ^mask 1119 } 1120 1121 // Get15 will fetch the flag bit value at index 15. 1122 func (f Flags32) Get15() bool { 1123 const mask = Flags32(1) << 15 1124 return (f&mask != 0) 1125 } 1126 1127 // Set15 will set the flag bit value at index 15. 1128 func (f Flags32) Set15() Flags32 { 1129 const mask = Flags32(1) << 15 1130 return f | mask 1131 } 1132 1133 // Unset15 will unset the flag bit value at index 15. 1134 func (f Flags32) Unset15() Flags32 { 1135 const mask = Flags32(1) << 15 1136 return f & ^mask 1137 } 1138 1139 // Get16 will fetch the flag bit value at index 16. 1140 func (f Flags32) Get16() bool { 1141 const mask = Flags32(1) << 16 1142 return (f&mask != 0) 1143 } 1144 1145 // Set16 will set the flag bit value at index 16. 1146 func (f Flags32) Set16() Flags32 { 1147 const mask = Flags32(1) << 16 1148 return f | mask 1149 } 1150 1151 // Unset16 will unset the flag bit value at index 16. 1152 func (f Flags32) Unset16() Flags32 { 1153 const mask = Flags32(1) << 16 1154 return f & ^mask 1155 } 1156 1157 // Get17 will fetch the flag bit value at index 17. 1158 func (f Flags32) Get17() bool { 1159 const mask = Flags32(1) << 17 1160 return (f&mask != 0) 1161 } 1162 1163 // Set17 will set the flag bit value at index 17. 1164 func (f Flags32) Set17() Flags32 { 1165 const mask = Flags32(1) << 17 1166 return f | mask 1167 } 1168 1169 // Unset17 will unset the flag bit value at index 17. 1170 func (f Flags32) Unset17() Flags32 { 1171 const mask = Flags32(1) << 17 1172 return f & ^mask 1173 } 1174 1175 // Get18 will fetch the flag bit value at index 18. 1176 func (f Flags32) Get18() bool { 1177 const mask = Flags32(1) << 18 1178 return (f&mask != 0) 1179 } 1180 1181 // Set18 will set the flag bit value at index 18. 1182 func (f Flags32) Set18() Flags32 { 1183 const mask = Flags32(1) << 18 1184 return f | mask 1185 } 1186 1187 // Unset18 will unset the flag bit value at index 18. 1188 func (f Flags32) Unset18() Flags32 { 1189 const mask = Flags32(1) << 18 1190 return f & ^mask 1191 } 1192 1193 // Get19 will fetch the flag bit value at index 19. 1194 func (f Flags32) Get19() bool { 1195 const mask = Flags32(1) << 19 1196 return (f&mask != 0) 1197 } 1198 1199 // Set19 will set the flag bit value at index 19. 1200 func (f Flags32) Set19() Flags32 { 1201 const mask = Flags32(1) << 19 1202 return f | mask 1203 } 1204 1205 // Unset19 will unset the flag bit value at index 19. 1206 func (f Flags32) Unset19() Flags32 { 1207 const mask = Flags32(1) << 19 1208 return f & ^mask 1209 } 1210 1211 // Get20 will fetch the flag bit value at index 20. 1212 func (f Flags32) Get20() bool { 1213 const mask = Flags32(1) << 20 1214 return (f&mask != 0) 1215 } 1216 1217 // Set20 will set the flag bit value at index 20. 1218 func (f Flags32) Set20() Flags32 { 1219 const mask = Flags32(1) << 20 1220 return f | mask 1221 } 1222 1223 // Unset20 will unset the flag bit value at index 20. 1224 func (f Flags32) Unset20() Flags32 { 1225 const mask = Flags32(1) << 20 1226 return f & ^mask 1227 } 1228 1229 // Get21 will fetch the flag bit value at index 21. 1230 func (f Flags32) Get21() bool { 1231 const mask = Flags32(1) << 21 1232 return (f&mask != 0) 1233 } 1234 1235 // Set21 will set the flag bit value at index 21. 1236 func (f Flags32) Set21() Flags32 { 1237 const mask = Flags32(1) << 21 1238 return f | mask 1239 } 1240 1241 // Unset21 will unset the flag bit value at index 21. 1242 func (f Flags32) Unset21() Flags32 { 1243 const mask = Flags32(1) << 21 1244 return f & ^mask 1245 } 1246 1247 // Get22 will fetch the flag bit value at index 22. 1248 func (f Flags32) Get22() bool { 1249 const mask = Flags32(1) << 22 1250 return (f&mask != 0) 1251 } 1252 1253 // Set22 will set the flag bit value at index 22. 1254 func (f Flags32) Set22() Flags32 { 1255 const mask = Flags32(1) << 22 1256 return f | mask 1257 } 1258 1259 // Unset22 will unset the flag bit value at index 22. 1260 func (f Flags32) Unset22() Flags32 { 1261 const mask = Flags32(1) << 22 1262 return f & ^mask 1263 } 1264 1265 // Get23 will fetch the flag bit value at index 23. 1266 func (f Flags32) Get23() bool { 1267 const mask = Flags32(1) << 23 1268 return (f&mask != 0) 1269 } 1270 1271 // Set23 will set the flag bit value at index 23. 1272 func (f Flags32) Set23() Flags32 { 1273 const mask = Flags32(1) << 23 1274 return f | mask 1275 } 1276 1277 // Unset23 will unset the flag bit value at index 23. 1278 func (f Flags32) Unset23() Flags32 { 1279 const mask = Flags32(1) << 23 1280 return f & ^mask 1281 } 1282 1283 // Get24 will fetch the flag bit value at index 24. 1284 func (f Flags32) Get24() bool { 1285 const mask = Flags32(1) << 24 1286 return (f&mask != 0) 1287 } 1288 1289 // Set24 will set the flag bit value at index 24. 1290 func (f Flags32) Set24() Flags32 { 1291 const mask = Flags32(1) << 24 1292 return f | mask 1293 } 1294 1295 // Unset24 will unset the flag bit value at index 24. 1296 func (f Flags32) Unset24() Flags32 { 1297 const mask = Flags32(1) << 24 1298 return f & ^mask 1299 } 1300 1301 // Get25 will fetch the flag bit value at index 25. 1302 func (f Flags32) Get25() bool { 1303 const mask = Flags32(1) << 25 1304 return (f&mask != 0) 1305 } 1306 1307 // Set25 will set the flag bit value at index 25. 1308 func (f Flags32) Set25() Flags32 { 1309 const mask = Flags32(1) << 25 1310 return f | mask 1311 } 1312 1313 // Unset25 will unset the flag bit value at index 25. 1314 func (f Flags32) Unset25() Flags32 { 1315 const mask = Flags32(1) << 25 1316 return f & ^mask 1317 } 1318 1319 // Get26 will fetch the flag bit value at index 26. 1320 func (f Flags32) Get26() bool { 1321 const mask = Flags32(1) << 26 1322 return (f&mask != 0) 1323 } 1324 1325 // Set26 will set the flag bit value at index 26. 1326 func (f Flags32) Set26() Flags32 { 1327 const mask = Flags32(1) << 26 1328 return f | mask 1329 } 1330 1331 // Unset26 will unset the flag bit value at index 26. 1332 func (f Flags32) Unset26() Flags32 { 1333 const mask = Flags32(1) << 26 1334 return f & ^mask 1335 } 1336 1337 // Get27 will fetch the flag bit value at index 27. 1338 func (f Flags32) Get27() bool { 1339 const mask = Flags32(1) << 27 1340 return (f&mask != 0) 1341 } 1342 1343 // Set27 will set the flag bit value at index 27. 1344 func (f Flags32) Set27() Flags32 { 1345 const mask = Flags32(1) << 27 1346 return f | mask 1347 } 1348 1349 // Unset27 will unset the flag bit value at index 27. 1350 func (f Flags32) Unset27() Flags32 { 1351 const mask = Flags32(1) << 27 1352 return f & ^mask 1353 } 1354 1355 // Get28 will fetch the flag bit value at index 28. 1356 func (f Flags32) Get28() bool { 1357 const mask = Flags32(1) << 28 1358 return (f&mask != 0) 1359 } 1360 1361 // Set28 will set the flag bit value at index 28. 1362 func (f Flags32) Set28() Flags32 { 1363 const mask = Flags32(1) << 28 1364 return f | mask 1365 } 1366 1367 // Unset28 will unset the flag bit value at index 28. 1368 func (f Flags32) Unset28() Flags32 { 1369 const mask = Flags32(1) << 28 1370 return f & ^mask 1371 } 1372 1373 // Get29 will fetch the flag bit value at index 29. 1374 func (f Flags32) Get29() bool { 1375 const mask = Flags32(1) << 29 1376 return (f&mask != 0) 1377 } 1378 1379 // Set29 will set the flag bit value at index 29. 1380 func (f Flags32) Set29() Flags32 { 1381 const mask = Flags32(1) << 29 1382 return f | mask 1383 } 1384 1385 // Unset29 will unset the flag bit value at index 29. 1386 func (f Flags32) Unset29() Flags32 { 1387 const mask = Flags32(1) << 29 1388 return f & ^mask 1389 } 1390 1391 // Get30 will fetch the flag bit value at index 30. 1392 func (f Flags32) Get30() bool { 1393 const mask = Flags32(1) << 30 1394 return (f&mask != 0) 1395 } 1396 1397 // Set30 will set the flag bit value at index 30. 1398 func (f Flags32) Set30() Flags32 { 1399 const mask = Flags32(1) << 30 1400 return f | mask 1401 } 1402 1403 // Unset30 will unset the flag bit value at index 30. 1404 func (f Flags32) Unset30() Flags32 { 1405 const mask = Flags32(1) << 30 1406 return f & ^mask 1407 } 1408 1409 // Get31 will fetch the flag bit value at index 31. 1410 func (f Flags32) Get31() bool { 1411 const mask = Flags32(1) << 31 1412 return (f&mask != 0) 1413 } 1414 1415 // Set31 will set the flag bit value at index 31. 1416 func (f Flags32) Set31() Flags32 { 1417 const mask = Flags32(1) << 31 1418 return f | mask 1419 } 1420 1421 // Unset31 will unset the flag bit value at index 31. 1422 func (f Flags32) Unset31() Flags32 { 1423 const mask = Flags32(1) << 31 1424 return f & ^mask 1425 } 1426 1427 // String returns a human readable representation of Flags32. 1428 func (f Flags32) String() string { 1429 var ( 1430 i int 1431 val bool 1432 buf []byte 1433 ) 1434 1435 // Make a prealloc est. based on longest-possible value 1436 const prealloc = 1 + (len("false ") * 32) - 1 + 1 1437 buf = make([]byte, prealloc) 1438 1439 buf[i] = '{' 1440 i++ 1441 1442 val = f.Get0() 1443 i += copy(buf[i:], bool2str(val)) 1444 buf[i] = ' ' 1445 i++ 1446 1447 val = f.Get1() 1448 i += copy(buf[i:], bool2str(val)) 1449 buf[i] = ' ' 1450 i++ 1451 1452 val = f.Get2() 1453 i += copy(buf[i:], bool2str(val)) 1454 buf[i] = ' ' 1455 i++ 1456 1457 val = f.Get3() 1458 i += copy(buf[i:], bool2str(val)) 1459 buf[i] = ' ' 1460 i++ 1461 1462 val = f.Get4() 1463 i += copy(buf[i:], bool2str(val)) 1464 buf[i] = ' ' 1465 i++ 1466 1467 val = f.Get5() 1468 i += copy(buf[i:], bool2str(val)) 1469 buf[i] = ' ' 1470 i++ 1471 1472 val = f.Get6() 1473 i += copy(buf[i:], bool2str(val)) 1474 buf[i] = ' ' 1475 i++ 1476 1477 val = f.Get7() 1478 i += copy(buf[i:], bool2str(val)) 1479 buf[i] = ' ' 1480 i++ 1481 1482 val = f.Get8() 1483 i += copy(buf[i:], bool2str(val)) 1484 buf[i] = ' ' 1485 i++ 1486 1487 val = f.Get9() 1488 i += copy(buf[i:], bool2str(val)) 1489 buf[i] = ' ' 1490 i++ 1491 1492 val = f.Get10() 1493 i += copy(buf[i:], bool2str(val)) 1494 buf[i] = ' ' 1495 i++ 1496 1497 val = f.Get11() 1498 i += copy(buf[i:], bool2str(val)) 1499 buf[i] = ' ' 1500 i++ 1501 1502 val = f.Get12() 1503 i += copy(buf[i:], bool2str(val)) 1504 buf[i] = ' ' 1505 i++ 1506 1507 val = f.Get13() 1508 i += copy(buf[i:], bool2str(val)) 1509 buf[i] = ' ' 1510 i++ 1511 1512 val = f.Get14() 1513 i += copy(buf[i:], bool2str(val)) 1514 buf[i] = ' ' 1515 i++ 1516 1517 val = f.Get15() 1518 i += copy(buf[i:], bool2str(val)) 1519 buf[i] = ' ' 1520 i++ 1521 1522 val = f.Get16() 1523 i += copy(buf[i:], bool2str(val)) 1524 buf[i] = ' ' 1525 i++ 1526 1527 val = f.Get17() 1528 i += copy(buf[i:], bool2str(val)) 1529 buf[i] = ' ' 1530 i++ 1531 1532 val = f.Get18() 1533 i += copy(buf[i:], bool2str(val)) 1534 buf[i] = ' ' 1535 i++ 1536 1537 val = f.Get19() 1538 i += copy(buf[i:], bool2str(val)) 1539 buf[i] = ' ' 1540 i++ 1541 1542 val = f.Get20() 1543 i += copy(buf[i:], bool2str(val)) 1544 buf[i] = ' ' 1545 i++ 1546 1547 val = f.Get21() 1548 i += copy(buf[i:], bool2str(val)) 1549 buf[i] = ' ' 1550 i++ 1551 1552 val = f.Get22() 1553 i += copy(buf[i:], bool2str(val)) 1554 buf[i] = ' ' 1555 i++ 1556 1557 val = f.Get23() 1558 i += copy(buf[i:], bool2str(val)) 1559 buf[i] = ' ' 1560 i++ 1561 1562 val = f.Get24() 1563 i += copy(buf[i:], bool2str(val)) 1564 buf[i] = ' ' 1565 i++ 1566 1567 val = f.Get25() 1568 i += copy(buf[i:], bool2str(val)) 1569 buf[i] = ' ' 1570 i++ 1571 1572 val = f.Get26() 1573 i += copy(buf[i:], bool2str(val)) 1574 buf[i] = ' ' 1575 i++ 1576 1577 val = f.Get27() 1578 i += copy(buf[i:], bool2str(val)) 1579 buf[i] = ' ' 1580 i++ 1581 1582 val = f.Get28() 1583 i += copy(buf[i:], bool2str(val)) 1584 buf[i] = ' ' 1585 i++ 1586 1587 val = f.Get29() 1588 i += copy(buf[i:], bool2str(val)) 1589 buf[i] = ' ' 1590 i++ 1591 1592 val = f.Get30() 1593 i += copy(buf[i:], bool2str(val)) 1594 buf[i] = ' ' 1595 i++ 1596 1597 val = f.Get31() 1598 i += copy(buf[i:], bool2str(val)) 1599 buf[i] = ' ' 1600 i++ 1601 1602 buf[i-1] = '}' 1603 buf = buf[:i] 1604 1605 return *(*string)(unsafe.Pointer(&buf)) 1606 } 1607 1608 // GoString returns a more verbose human readable representation of Flags32. 1609 func (f Flags32) GoString() string { 1610 var ( 1611 i int 1612 val bool 1613 buf []byte 1614 ) 1615 1616 // Make a prealloc est. based on longest-possible value 1617 const prealloc = len("bitutil.Flags32{") + (len("31=false ") * 32) - 1 + 1 1618 buf = make([]byte, prealloc) 1619 1620 i += copy(buf[i:], "bitutil.Flags32{") 1621 1622 val = f.Get0() 1623 i += copy(buf[i:], "0=") 1624 i += copy(buf[i:], bool2str(val)) 1625 buf[i] = ' ' 1626 i++ 1627 1628 val = f.Get1() 1629 i += copy(buf[i:], "1=") 1630 i += copy(buf[i:], bool2str(val)) 1631 buf[i] = ' ' 1632 i++ 1633 1634 val = f.Get2() 1635 i += copy(buf[i:], "2=") 1636 i += copy(buf[i:], bool2str(val)) 1637 buf[i] = ' ' 1638 i++ 1639 1640 val = f.Get3() 1641 i += copy(buf[i:], "3=") 1642 i += copy(buf[i:], bool2str(val)) 1643 buf[i] = ' ' 1644 i++ 1645 1646 val = f.Get4() 1647 i += copy(buf[i:], "4=") 1648 i += copy(buf[i:], bool2str(val)) 1649 buf[i] = ' ' 1650 i++ 1651 1652 val = f.Get5() 1653 i += copy(buf[i:], "5=") 1654 i += copy(buf[i:], bool2str(val)) 1655 buf[i] = ' ' 1656 i++ 1657 1658 val = f.Get6() 1659 i += copy(buf[i:], "6=") 1660 i += copy(buf[i:], bool2str(val)) 1661 buf[i] = ' ' 1662 i++ 1663 1664 val = f.Get7() 1665 i += copy(buf[i:], "7=") 1666 i += copy(buf[i:], bool2str(val)) 1667 buf[i] = ' ' 1668 i++ 1669 1670 val = f.Get8() 1671 i += copy(buf[i:], "8=") 1672 i += copy(buf[i:], bool2str(val)) 1673 buf[i] = ' ' 1674 i++ 1675 1676 val = f.Get9() 1677 i += copy(buf[i:], "9=") 1678 i += copy(buf[i:], bool2str(val)) 1679 buf[i] = ' ' 1680 i++ 1681 1682 val = f.Get10() 1683 i += copy(buf[i:], "10=") 1684 i += copy(buf[i:], bool2str(val)) 1685 buf[i] = ' ' 1686 i++ 1687 1688 val = f.Get11() 1689 i += copy(buf[i:], "11=") 1690 i += copy(buf[i:], bool2str(val)) 1691 buf[i] = ' ' 1692 i++ 1693 1694 val = f.Get12() 1695 i += copy(buf[i:], "12=") 1696 i += copy(buf[i:], bool2str(val)) 1697 buf[i] = ' ' 1698 i++ 1699 1700 val = f.Get13() 1701 i += copy(buf[i:], "13=") 1702 i += copy(buf[i:], bool2str(val)) 1703 buf[i] = ' ' 1704 i++ 1705 1706 val = f.Get14() 1707 i += copy(buf[i:], "14=") 1708 i += copy(buf[i:], bool2str(val)) 1709 buf[i] = ' ' 1710 i++ 1711 1712 val = f.Get15() 1713 i += copy(buf[i:], "15=") 1714 i += copy(buf[i:], bool2str(val)) 1715 buf[i] = ' ' 1716 i++ 1717 1718 val = f.Get16() 1719 i += copy(buf[i:], "16=") 1720 i += copy(buf[i:], bool2str(val)) 1721 buf[i] = ' ' 1722 i++ 1723 1724 val = f.Get17() 1725 i += copy(buf[i:], "17=") 1726 i += copy(buf[i:], bool2str(val)) 1727 buf[i] = ' ' 1728 i++ 1729 1730 val = f.Get18() 1731 i += copy(buf[i:], "18=") 1732 i += copy(buf[i:], bool2str(val)) 1733 buf[i] = ' ' 1734 i++ 1735 1736 val = f.Get19() 1737 i += copy(buf[i:], "19=") 1738 i += copy(buf[i:], bool2str(val)) 1739 buf[i] = ' ' 1740 i++ 1741 1742 val = f.Get20() 1743 i += copy(buf[i:], "20=") 1744 i += copy(buf[i:], bool2str(val)) 1745 buf[i] = ' ' 1746 i++ 1747 1748 val = f.Get21() 1749 i += copy(buf[i:], "21=") 1750 i += copy(buf[i:], bool2str(val)) 1751 buf[i] = ' ' 1752 i++ 1753 1754 val = f.Get22() 1755 i += copy(buf[i:], "22=") 1756 i += copy(buf[i:], bool2str(val)) 1757 buf[i] = ' ' 1758 i++ 1759 1760 val = f.Get23() 1761 i += copy(buf[i:], "23=") 1762 i += copy(buf[i:], bool2str(val)) 1763 buf[i] = ' ' 1764 i++ 1765 1766 val = f.Get24() 1767 i += copy(buf[i:], "24=") 1768 i += copy(buf[i:], bool2str(val)) 1769 buf[i] = ' ' 1770 i++ 1771 1772 val = f.Get25() 1773 i += copy(buf[i:], "25=") 1774 i += copy(buf[i:], bool2str(val)) 1775 buf[i] = ' ' 1776 i++ 1777 1778 val = f.Get26() 1779 i += copy(buf[i:], "26=") 1780 i += copy(buf[i:], bool2str(val)) 1781 buf[i] = ' ' 1782 i++ 1783 1784 val = f.Get27() 1785 i += copy(buf[i:], "27=") 1786 i += copy(buf[i:], bool2str(val)) 1787 buf[i] = ' ' 1788 i++ 1789 1790 val = f.Get28() 1791 i += copy(buf[i:], "28=") 1792 i += copy(buf[i:], bool2str(val)) 1793 buf[i] = ' ' 1794 i++ 1795 1796 val = f.Get29() 1797 i += copy(buf[i:], "29=") 1798 i += copy(buf[i:], bool2str(val)) 1799 buf[i] = ' ' 1800 i++ 1801 1802 val = f.Get30() 1803 i += copy(buf[i:], "30=") 1804 i += copy(buf[i:], bool2str(val)) 1805 buf[i] = ' ' 1806 i++ 1807 1808 val = f.Get31() 1809 i += copy(buf[i:], "31=") 1810 i += copy(buf[i:], bool2str(val)) 1811 buf[i] = ' ' 1812 i++ 1813 1814 buf[i-1] = '}' 1815 buf = buf[:i] 1816 1817 return *(*string)(unsafe.Pointer(&buf)) 1818 } 1819 1820 // Flags64 is a type-casted unsigned integer with helper 1821 // methods for easily managing up to 64 bit-flags. 1822 type Flags64 uint64 1823 1824 // Get will fetch the flag bit value at index 'bit'. 1825 func (f Flags64) Get(bit uint8) bool { 1826 mask := Flags64(1) << bit 1827 return (f&mask != 0) 1828 } 1829 1830 // Set will set the flag bit value at index 'bit'. 1831 func (f Flags64) Set(bit uint8) Flags64 { 1832 mask := Flags64(1) << bit 1833 return f | mask 1834 } 1835 1836 // Unset will unset the flag bit value at index 'bit'. 1837 func (f Flags64) Unset(bit uint8) Flags64 { 1838 mask := Flags64(1) << bit 1839 return f & ^mask 1840 } 1841 1842 // Get0 will fetch the flag bit value at index 0. 1843 func (f Flags64) Get0() bool { 1844 const mask = Flags64(1) << 0 1845 return (f&mask != 0) 1846 } 1847 1848 // Set0 will set the flag bit value at index 0. 1849 func (f Flags64) Set0() Flags64 { 1850 const mask = Flags64(1) << 0 1851 return f | mask 1852 } 1853 1854 // Unset0 will unset the flag bit value at index 0. 1855 func (f Flags64) Unset0() Flags64 { 1856 const mask = Flags64(1) << 0 1857 return f & ^mask 1858 } 1859 1860 // Get1 will fetch the flag bit value at index 1. 1861 func (f Flags64) Get1() bool { 1862 const mask = Flags64(1) << 1 1863 return (f&mask != 0) 1864 } 1865 1866 // Set1 will set the flag bit value at index 1. 1867 func (f Flags64) Set1() Flags64 { 1868 const mask = Flags64(1) << 1 1869 return f | mask 1870 } 1871 1872 // Unset1 will unset the flag bit value at index 1. 1873 func (f Flags64) Unset1() Flags64 { 1874 const mask = Flags64(1) << 1 1875 return f & ^mask 1876 } 1877 1878 // Get2 will fetch the flag bit value at index 2. 1879 func (f Flags64) Get2() bool { 1880 const mask = Flags64(1) << 2 1881 return (f&mask != 0) 1882 } 1883 1884 // Set2 will set the flag bit value at index 2. 1885 func (f Flags64) Set2() Flags64 { 1886 const mask = Flags64(1) << 2 1887 return f | mask 1888 } 1889 1890 // Unset2 will unset the flag bit value at index 2. 1891 func (f Flags64) Unset2() Flags64 { 1892 const mask = Flags64(1) << 2 1893 return f & ^mask 1894 } 1895 1896 // Get3 will fetch the flag bit value at index 3. 1897 func (f Flags64) Get3() bool { 1898 const mask = Flags64(1) << 3 1899 return (f&mask != 0) 1900 } 1901 1902 // Set3 will set the flag bit value at index 3. 1903 func (f Flags64) Set3() Flags64 { 1904 const mask = Flags64(1) << 3 1905 return f | mask 1906 } 1907 1908 // Unset3 will unset the flag bit value at index 3. 1909 func (f Flags64) Unset3() Flags64 { 1910 const mask = Flags64(1) << 3 1911 return f & ^mask 1912 } 1913 1914 // Get4 will fetch the flag bit value at index 4. 1915 func (f Flags64) Get4() bool { 1916 const mask = Flags64(1) << 4 1917 return (f&mask != 0) 1918 } 1919 1920 // Set4 will set the flag bit value at index 4. 1921 func (f Flags64) Set4() Flags64 { 1922 const mask = Flags64(1) << 4 1923 return f | mask 1924 } 1925 1926 // Unset4 will unset the flag bit value at index 4. 1927 func (f Flags64) Unset4() Flags64 { 1928 const mask = Flags64(1) << 4 1929 return f & ^mask 1930 } 1931 1932 // Get5 will fetch the flag bit value at index 5. 1933 func (f Flags64) Get5() bool { 1934 const mask = Flags64(1) << 5 1935 return (f&mask != 0) 1936 } 1937 1938 // Set5 will set the flag bit value at index 5. 1939 func (f Flags64) Set5() Flags64 { 1940 const mask = Flags64(1) << 5 1941 return f | mask 1942 } 1943 1944 // Unset5 will unset the flag bit value at index 5. 1945 func (f Flags64) Unset5() Flags64 { 1946 const mask = Flags64(1) << 5 1947 return f & ^mask 1948 } 1949 1950 // Get6 will fetch the flag bit value at index 6. 1951 func (f Flags64) Get6() bool { 1952 const mask = Flags64(1) << 6 1953 return (f&mask != 0) 1954 } 1955 1956 // Set6 will set the flag bit value at index 6. 1957 func (f Flags64) Set6() Flags64 { 1958 const mask = Flags64(1) << 6 1959 return f | mask 1960 } 1961 1962 // Unset6 will unset the flag bit value at index 6. 1963 func (f Flags64) Unset6() Flags64 { 1964 const mask = Flags64(1) << 6 1965 return f & ^mask 1966 } 1967 1968 // Get7 will fetch the flag bit value at index 7. 1969 func (f Flags64) Get7() bool { 1970 const mask = Flags64(1) << 7 1971 return (f&mask != 0) 1972 } 1973 1974 // Set7 will set the flag bit value at index 7. 1975 func (f Flags64) Set7() Flags64 { 1976 const mask = Flags64(1) << 7 1977 return f | mask 1978 } 1979 1980 // Unset7 will unset the flag bit value at index 7. 1981 func (f Flags64) Unset7() Flags64 { 1982 const mask = Flags64(1) << 7 1983 return f & ^mask 1984 } 1985 1986 // Get8 will fetch the flag bit value at index 8. 1987 func (f Flags64) Get8() bool { 1988 const mask = Flags64(1) << 8 1989 return (f&mask != 0) 1990 } 1991 1992 // Set8 will set the flag bit value at index 8. 1993 func (f Flags64) Set8() Flags64 { 1994 const mask = Flags64(1) << 8 1995 return f | mask 1996 } 1997 1998 // Unset8 will unset the flag bit value at index 8. 1999 func (f Flags64) Unset8() Flags64 { 2000 const mask = Flags64(1) << 8 2001 return f & ^mask 2002 } 2003 2004 // Get9 will fetch the flag bit value at index 9. 2005 func (f Flags64) Get9() bool { 2006 const mask = Flags64(1) << 9 2007 return (f&mask != 0) 2008 } 2009 2010 // Set9 will set the flag bit value at index 9. 2011 func (f Flags64) Set9() Flags64 { 2012 const mask = Flags64(1) << 9 2013 return f | mask 2014 } 2015 2016 // Unset9 will unset the flag bit value at index 9. 2017 func (f Flags64) Unset9() Flags64 { 2018 const mask = Flags64(1) << 9 2019 return f & ^mask 2020 } 2021 2022 // Get10 will fetch the flag bit value at index 10. 2023 func (f Flags64) Get10() bool { 2024 const mask = Flags64(1) << 10 2025 return (f&mask != 0) 2026 } 2027 2028 // Set10 will set the flag bit value at index 10. 2029 func (f Flags64) Set10() Flags64 { 2030 const mask = Flags64(1) << 10 2031 return f | mask 2032 } 2033 2034 // Unset10 will unset the flag bit value at index 10. 2035 func (f Flags64) Unset10() Flags64 { 2036 const mask = Flags64(1) << 10 2037 return f & ^mask 2038 } 2039 2040 // Get11 will fetch the flag bit value at index 11. 2041 func (f Flags64) Get11() bool { 2042 const mask = Flags64(1) << 11 2043 return (f&mask != 0) 2044 } 2045 2046 // Set11 will set the flag bit value at index 11. 2047 func (f Flags64) Set11() Flags64 { 2048 const mask = Flags64(1) << 11 2049 return f | mask 2050 } 2051 2052 // Unset11 will unset the flag bit value at index 11. 2053 func (f Flags64) Unset11() Flags64 { 2054 const mask = Flags64(1) << 11 2055 return f & ^mask 2056 } 2057 2058 // Get12 will fetch the flag bit value at index 12. 2059 func (f Flags64) Get12() bool { 2060 const mask = Flags64(1) << 12 2061 return (f&mask != 0) 2062 } 2063 2064 // Set12 will set the flag bit value at index 12. 2065 func (f Flags64) Set12() Flags64 { 2066 const mask = Flags64(1) << 12 2067 return f | mask 2068 } 2069 2070 // Unset12 will unset the flag bit value at index 12. 2071 func (f Flags64) Unset12() Flags64 { 2072 const mask = Flags64(1) << 12 2073 return f & ^mask 2074 } 2075 2076 // Get13 will fetch the flag bit value at index 13. 2077 func (f Flags64) Get13() bool { 2078 const mask = Flags64(1) << 13 2079 return (f&mask != 0) 2080 } 2081 2082 // Set13 will set the flag bit value at index 13. 2083 func (f Flags64) Set13() Flags64 { 2084 const mask = Flags64(1) << 13 2085 return f | mask 2086 } 2087 2088 // Unset13 will unset the flag bit value at index 13. 2089 func (f Flags64) Unset13() Flags64 { 2090 const mask = Flags64(1) << 13 2091 return f & ^mask 2092 } 2093 2094 // Get14 will fetch the flag bit value at index 14. 2095 func (f Flags64) Get14() bool { 2096 const mask = Flags64(1) << 14 2097 return (f&mask != 0) 2098 } 2099 2100 // Set14 will set the flag bit value at index 14. 2101 func (f Flags64) Set14() Flags64 { 2102 const mask = Flags64(1) << 14 2103 return f | mask 2104 } 2105 2106 // Unset14 will unset the flag bit value at index 14. 2107 func (f Flags64) Unset14() Flags64 { 2108 const mask = Flags64(1) << 14 2109 return f & ^mask 2110 } 2111 2112 // Get15 will fetch the flag bit value at index 15. 2113 func (f Flags64) Get15() bool { 2114 const mask = Flags64(1) << 15 2115 return (f&mask != 0) 2116 } 2117 2118 // Set15 will set the flag bit value at index 15. 2119 func (f Flags64) Set15() Flags64 { 2120 const mask = Flags64(1) << 15 2121 return f | mask 2122 } 2123 2124 // Unset15 will unset the flag bit value at index 15. 2125 func (f Flags64) Unset15() Flags64 { 2126 const mask = Flags64(1) << 15 2127 return f & ^mask 2128 } 2129 2130 // Get16 will fetch the flag bit value at index 16. 2131 func (f Flags64) Get16() bool { 2132 const mask = Flags64(1) << 16 2133 return (f&mask != 0) 2134 } 2135 2136 // Set16 will set the flag bit value at index 16. 2137 func (f Flags64) Set16() Flags64 { 2138 const mask = Flags64(1) << 16 2139 return f | mask 2140 } 2141 2142 // Unset16 will unset the flag bit value at index 16. 2143 func (f Flags64) Unset16() Flags64 { 2144 const mask = Flags64(1) << 16 2145 return f & ^mask 2146 } 2147 2148 // Get17 will fetch the flag bit value at index 17. 2149 func (f Flags64) Get17() bool { 2150 const mask = Flags64(1) << 17 2151 return (f&mask != 0) 2152 } 2153 2154 // Set17 will set the flag bit value at index 17. 2155 func (f Flags64) Set17() Flags64 { 2156 const mask = Flags64(1) << 17 2157 return f | mask 2158 } 2159 2160 // Unset17 will unset the flag bit value at index 17. 2161 func (f Flags64) Unset17() Flags64 { 2162 const mask = Flags64(1) << 17 2163 return f & ^mask 2164 } 2165 2166 // Get18 will fetch the flag bit value at index 18. 2167 func (f Flags64) Get18() bool { 2168 const mask = Flags64(1) << 18 2169 return (f&mask != 0) 2170 } 2171 2172 // Set18 will set the flag bit value at index 18. 2173 func (f Flags64) Set18() Flags64 { 2174 const mask = Flags64(1) << 18 2175 return f | mask 2176 } 2177 2178 // Unset18 will unset the flag bit value at index 18. 2179 func (f Flags64) Unset18() Flags64 { 2180 const mask = Flags64(1) << 18 2181 return f & ^mask 2182 } 2183 2184 // Get19 will fetch the flag bit value at index 19. 2185 func (f Flags64) Get19() bool { 2186 const mask = Flags64(1) << 19 2187 return (f&mask != 0) 2188 } 2189 2190 // Set19 will set the flag bit value at index 19. 2191 func (f Flags64) Set19() Flags64 { 2192 const mask = Flags64(1) << 19 2193 return f | mask 2194 } 2195 2196 // Unset19 will unset the flag bit value at index 19. 2197 func (f Flags64) Unset19() Flags64 { 2198 const mask = Flags64(1) << 19 2199 return f & ^mask 2200 } 2201 2202 // Get20 will fetch the flag bit value at index 20. 2203 func (f Flags64) Get20() bool { 2204 const mask = Flags64(1) << 20 2205 return (f&mask != 0) 2206 } 2207 2208 // Set20 will set the flag bit value at index 20. 2209 func (f Flags64) Set20() Flags64 { 2210 const mask = Flags64(1) << 20 2211 return f | mask 2212 } 2213 2214 // Unset20 will unset the flag bit value at index 20. 2215 func (f Flags64) Unset20() Flags64 { 2216 const mask = Flags64(1) << 20 2217 return f & ^mask 2218 } 2219 2220 // Get21 will fetch the flag bit value at index 21. 2221 func (f Flags64) Get21() bool { 2222 const mask = Flags64(1) << 21 2223 return (f&mask != 0) 2224 } 2225 2226 // Set21 will set the flag bit value at index 21. 2227 func (f Flags64) Set21() Flags64 { 2228 const mask = Flags64(1) << 21 2229 return f | mask 2230 } 2231 2232 // Unset21 will unset the flag bit value at index 21. 2233 func (f Flags64) Unset21() Flags64 { 2234 const mask = Flags64(1) << 21 2235 return f & ^mask 2236 } 2237 2238 // Get22 will fetch the flag bit value at index 22. 2239 func (f Flags64) Get22() bool { 2240 const mask = Flags64(1) << 22 2241 return (f&mask != 0) 2242 } 2243 2244 // Set22 will set the flag bit value at index 22. 2245 func (f Flags64) Set22() Flags64 { 2246 const mask = Flags64(1) << 22 2247 return f | mask 2248 } 2249 2250 // Unset22 will unset the flag bit value at index 22. 2251 func (f Flags64) Unset22() Flags64 { 2252 const mask = Flags64(1) << 22 2253 return f & ^mask 2254 } 2255 2256 // Get23 will fetch the flag bit value at index 23. 2257 func (f Flags64) Get23() bool { 2258 const mask = Flags64(1) << 23 2259 return (f&mask != 0) 2260 } 2261 2262 // Set23 will set the flag bit value at index 23. 2263 func (f Flags64) Set23() Flags64 { 2264 const mask = Flags64(1) << 23 2265 return f | mask 2266 } 2267 2268 // Unset23 will unset the flag bit value at index 23. 2269 func (f Flags64) Unset23() Flags64 { 2270 const mask = Flags64(1) << 23 2271 return f & ^mask 2272 } 2273 2274 // Get24 will fetch the flag bit value at index 24. 2275 func (f Flags64) Get24() bool { 2276 const mask = Flags64(1) << 24 2277 return (f&mask != 0) 2278 } 2279 2280 // Set24 will set the flag bit value at index 24. 2281 func (f Flags64) Set24() Flags64 { 2282 const mask = Flags64(1) << 24 2283 return f | mask 2284 } 2285 2286 // Unset24 will unset the flag bit value at index 24. 2287 func (f Flags64) Unset24() Flags64 { 2288 const mask = Flags64(1) << 24 2289 return f & ^mask 2290 } 2291 2292 // Get25 will fetch the flag bit value at index 25. 2293 func (f Flags64) Get25() bool { 2294 const mask = Flags64(1) << 25 2295 return (f&mask != 0) 2296 } 2297 2298 // Set25 will set the flag bit value at index 25. 2299 func (f Flags64) Set25() Flags64 { 2300 const mask = Flags64(1) << 25 2301 return f | mask 2302 } 2303 2304 // Unset25 will unset the flag bit value at index 25. 2305 func (f Flags64) Unset25() Flags64 { 2306 const mask = Flags64(1) << 25 2307 return f & ^mask 2308 } 2309 2310 // Get26 will fetch the flag bit value at index 26. 2311 func (f Flags64) Get26() bool { 2312 const mask = Flags64(1) << 26 2313 return (f&mask != 0) 2314 } 2315 2316 // Set26 will set the flag bit value at index 26. 2317 func (f Flags64) Set26() Flags64 { 2318 const mask = Flags64(1) << 26 2319 return f | mask 2320 } 2321 2322 // Unset26 will unset the flag bit value at index 26. 2323 func (f Flags64) Unset26() Flags64 { 2324 const mask = Flags64(1) << 26 2325 return f & ^mask 2326 } 2327 2328 // Get27 will fetch the flag bit value at index 27. 2329 func (f Flags64) Get27() bool { 2330 const mask = Flags64(1) << 27 2331 return (f&mask != 0) 2332 } 2333 2334 // Set27 will set the flag bit value at index 27. 2335 func (f Flags64) Set27() Flags64 { 2336 const mask = Flags64(1) << 27 2337 return f | mask 2338 } 2339 2340 // Unset27 will unset the flag bit value at index 27. 2341 func (f Flags64) Unset27() Flags64 { 2342 const mask = Flags64(1) << 27 2343 return f & ^mask 2344 } 2345 2346 // Get28 will fetch the flag bit value at index 28. 2347 func (f Flags64) Get28() bool { 2348 const mask = Flags64(1) << 28 2349 return (f&mask != 0) 2350 } 2351 2352 // Set28 will set the flag bit value at index 28. 2353 func (f Flags64) Set28() Flags64 { 2354 const mask = Flags64(1) << 28 2355 return f | mask 2356 } 2357 2358 // Unset28 will unset the flag bit value at index 28. 2359 func (f Flags64) Unset28() Flags64 { 2360 const mask = Flags64(1) << 28 2361 return f & ^mask 2362 } 2363 2364 // Get29 will fetch the flag bit value at index 29. 2365 func (f Flags64) Get29() bool { 2366 const mask = Flags64(1) << 29 2367 return (f&mask != 0) 2368 } 2369 2370 // Set29 will set the flag bit value at index 29. 2371 func (f Flags64) Set29() Flags64 { 2372 const mask = Flags64(1) << 29 2373 return f | mask 2374 } 2375 2376 // Unset29 will unset the flag bit value at index 29. 2377 func (f Flags64) Unset29() Flags64 { 2378 const mask = Flags64(1) << 29 2379 return f & ^mask 2380 } 2381 2382 // Get30 will fetch the flag bit value at index 30. 2383 func (f Flags64) Get30() bool { 2384 const mask = Flags64(1) << 30 2385 return (f&mask != 0) 2386 } 2387 2388 // Set30 will set the flag bit value at index 30. 2389 func (f Flags64) Set30() Flags64 { 2390 const mask = Flags64(1) << 30 2391 return f | mask 2392 } 2393 2394 // Unset30 will unset the flag bit value at index 30. 2395 func (f Flags64) Unset30() Flags64 { 2396 const mask = Flags64(1) << 30 2397 return f & ^mask 2398 } 2399 2400 // Get31 will fetch the flag bit value at index 31. 2401 func (f Flags64) Get31() bool { 2402 const mask = Flags64(1) << 31 2403 return (f&mask != 0) 2404 } 2405 2406 // Set31 will set the flag bit value at index 31. 2407 func (f Flags64) Set31() Flags64 { 2408 const mask = Flags64(1) << 31 2409 return f | mask 2410 } 2411 2412 // Unset31 will unset the flag bit value at index 31. 2413 func (f Flags64) Unset31() Flags64 { 2414 const mask = Flags64(1) << 31 2415 return f & ^mask 2416 } 2417 2418 // Get32 will fetch the flag bit value at index 32. 2419 func (f Flags64) Get32() bool { 2420 const mask = Flags64(1) << 32 2421 return (f&mask != 0) 2422 } 2423 2424 // Set32 will set the flag bit value at index 32. 2425 func (f Flags64) Set32() Flags64 { 2426 const mask = Flags64(1) << 32 2427 return f | mask 2428 } 2429 2430 // Unset32 will unset the flag bit value at index 32. 2431 func (f Flags64) Unset32() Flags64 { 2432 const mask = Flags64(1) << 32 2433 return f & ^mask 2434 } 2435 2436 // Get33 will fetch the flag bit value at index 33. 2437 func (f Flags64) Get33() bool { 2438 const mask = Flags64(1) << 33 2439 return (f&mask != 0) 2440 } 2441 2442 // Set33 will set the flag bit value at index 33. 2443 func (f Flags64) Set33() Flags64 { 2444 const mask = Flags64(1) << 33 2445 return f | mask 2446 } 2447 2448 // Unset33 will unset the flag bit value at index 33. 2449 func (f Flags64) Unset33() Flags64 { 2450 const mask = Flags64(1) << 33 2451 return f & ^mask 2452 } 2453 2454 // Get34 will fetch the flag bit value at index 34. 2455 func (f Flags64) Get34() bool { 2456 const mask = Flags64(1) << 34 2457 return (f&mask != 0) 2458 } 2459 2460 // Set34 will set the flag bit value at index 34. 2461 func (f Flags64) Set34() Flags64 { 2462 const mask = Flags64(1) << 34 2463 return f | mask 2464 } 2465 2466 // Unset34 will unset the flag bit value at index 34. 2467 func (f Flags64) Unset34() Flags64 { 2468 const mask = Flags64(1) << 34 2469 return f & ^mask 2470 } 2471 2472 // Get35 will fetch the flag bit value at index 35. 2473 func (f Flags64) Get35() bool { 2474 const mask = Flags64(1) << 35 2475 return (f&mask != 0) 2476 } 2477 2478 // Set35 will set the flag bit value at index 35. 2479 func (f Flags64) Set35() Flags64 { 2480 const mask = Flags64(1) << 35 2481 return f | mask 2482 } 2483 2484 // Unset35 will unset the flag bit value at index 35. 2485 func (f Flags64) Unset35() Flags64 { 2486 const mask = Flags64(1) << 35 2487 return f & ^mask 2488 } 2489 2490 // Get36 will fetch the flag bit value at index 36. 2491 func (f Flags64) Get36() bool { 2492 const mask = Flags64(1) << 36 2493 return (f&mask != 0) 2494 } 2495 2496 // Set36 will set the flag bit value at index 36. 2497 func (f Flags64) Set36() Flags64 { 2498 const mask = Flags64(1) << 36 2499 return f | mask 2500 } 2501 2502 // Unset36 will unset the flag bit value at index 36. 2503 func (f Flags64) Unset36() Flags64 { 2504 const mask = Flags64(1) << 36 2505 return f & ^mask 2506 } 2507 2508 // Get37 will fetch the flag bit value at index 37. 2509 func (f Flags64) Get37() bool { 2510 const mask = Flags64(1) << 37 2511 return (f&mask != 0) 2512 } 2513 2514 // Set37 will set the flag bit value at index 37. 2515 func (f Flags64) Set37() Flags64 { 2516 const mask = Flags64(1) << 37 2517 return f | mask 2518 } 2519 2520 // Unset37 will unset the flag bit value at index 37. 2521 func (f Flags64) Unset37() Flags64 { 2522 const mask = Flags64(1) << 37 2523 return f & ^mask 2524 } 2525 2526 // Get38 will fetch the flag bit value at index 38. 2527 func (f Flags64) Get38() bool { 2528 const mask = Flags64(1) << 38 2529 return (f&mask != 0) 2530 } 2531 2532 // Set38 will set the flag bit value at index 38. 2533 func (f Flags64) Set38() Flags64 { 2534 const mask = Flags64(1) << 38 2535 return f | mask 2536 } 2537 2538 // Unset38 will unset the flag bit value at index 38. 2539 func (f Flags64) Unset38() Flags64 { 2540 const mask = Flags64(1) << 38 2541 return f & ^mask 2542 } 2543 2544 // Get39 will fetch the flag bit value at index 39. 2545 func (f Flags64) Get39() bool { 2546 const mask = Flags64(1) << 39 2547 return (f&mask != 0) 2548 } 2549 2550 // Set39 will set the flag bit value at index 39. 2551 func (f Flags64) Set39() Flags64 { 2552 const mask = Flags64(1) << 39 2553 return f | mask 2554 } 2555 2556 // Unset39 will unset the flag bit value at index 39. 2557 func (f Flags64) Unset39() Flags64 { 2558 const mask = Flags64(1) << 39 2559 return f & ^mask 2560 } 2561 2562 // Get40 will fetch the flag bit value at index 40. 2563 func (f Flags64) Get40() bool { 2564 const mask = Flags64(1) << 40 2565 return (f&mask != 0) 2566 } 2567 2568 // Set40 will set the flag bit value at index 40. 2569 func (f Flags64) Set40() Flags64 { 2570 const mask = Flags64(1) << 40 2571 return f | mask 2572 } 2573 2574 // Unset40 will unset the flag bit value at index 40. 2575 func (f Flags64) Unset40() Flags64 { 2576 const mask = Flags64(1) << 40 2577 return f & ^mask 2578 } 2579 2580 // Get41 will fetch the flag bit value at index 41. 2581 func (f Flags64) Get41() bool { 2582 const mask = Flags64(1) << 41 2583 return (f&mask != 0) 2584 } 2585 2586 // Set41 will set the flag bit value at index 41. 2587 func (f Flags64) Set41() Flags64 { 2588 const mask = Flags64(1) << 41 2589 return f | mask 2590 } 2591 2592 // Unset41 will unset the flag bit value at index 41. 2593 func (f Flags64) Unset41() Flags64 { 2594 const mask = Flags64(1) << 41 2595 return f & ^mask 2596 } 2597 2598 // Get42 will fetch the flag bit value at index 42. 2599 func (f Flags64) Get42() bool { 2600 const mask = Flags64(1) << 42 2601 return (f&mask != 0) 2602 } 2603 2604 // Set42 will set the flag bit value at index 42. 2605 func (f Flags64) Set42() Flags64 { 2606 const mask = Flags64(1) << 42 2607 return f | mask 2608 } 2609 2610 // Unset42 will unset the flag bit value at index 42. 2611 func (f Flags64) Unset42() Flags64 { 2612 const mask = Flags64(1) << 42 2613 return f & ^mask 2614 } 2615 2616 // Get43 will fetch the flag bit value at index 43. 2617 func (f Flags64) Get43() bool { 2618 const mask = Flags64(1) << 43 2619 return (f&mask != 0) 2620 } 2621 2622 // Set43 will set the flag bit value at index 43. 2623 func (f Flags64) Set43() Flags64 { 2624 const mask = Flags64(1) << 43 2625 return f | mask 2626 } 2627 2628 // Unset43 will unset the flag bit value at index 43. 2629 func (f Flags64) Unset43() Flags64 { 2630 const mask = Flags64(1) << 43 2631 return f & ^mask 2632 } 2633 2634 // Get44 will fetch the flag bit value at index 44. 2635 func (f Flags64) Get44() bool { 2636 const mask = Flags64(1) << 44 2637 return (f&mask != 0) 2638 } 2639 2640 // Set44 will set the flag bit value at index 44. 2641 func (f Flags64) Set44() Flags64 { 2642 const mask = Flags64(1) << 44 2643 return f | mask 2644 } 2645 2646 // Unset44 will unset the flag bit value at index 44. 2647 func (f Flags64) Unset44() Flags64 { 2648 const mask = Flags64(1) << 44 2649 return f & ^mask 2650 } 2651 2652 // Get45 will fetch the flag bit value at index 45. 2653 func (f Flags64) Get45() bool { 2654 const mask = Flags64(1) << 45 2655 return (f&mask != 0) 2656 } 2657 2658 // Set45 will set the flag bit value at index 45. 2659 func (f Flags64) Set45() Flags64 { 2660 const mask = Flags64(1) << 45 2661 return f | mask 2662 } 2663 2664 // Unset45 will unset the flag bit value at index 45. 2665 func (f Flags64) Unset45() Flags64 { 2666 const mask = Flags64(1) << 45 2667 return f & ^mask 2668 } 2669 2670 // Get46 will fetch the flag bit value at index 46. 2671 func (f Flags64) Get46() bool { 2672 const mask = Flags64(1) << 46 2673 return (f&mask != 0) 2674 } 2675 2676 // Set46 will set the flag bit value at index 46. 2677 func (f Flags64) Set46() Flags64 { 2678 const mask = Flags64(1) << 46 2679 return f | mask 2680 } 2681 2682 // Unset46 will unset the flag bit value at index 46. 2683 func (f Flags64) Unset46() Flags64 { 2684 const mask = Flags64(1) << 46 2685 return f & ^mask 2686 } 2687 2688 // Get47 will fetch the flag bit value at index 47. 2689 func (f Flags64) Get47() bool { 2690 const mask = Flags64(1) << 47 2691 return (f&mask != 0) 2692 } 2693 2694 // Set47 will set the flag bit value at index 47. 2695 func (f Flags64) Set47() Flags64 { 2696 const mask = Flags64(1) << 47 2697 return f | mask 2698 } 2699 2700 // Unset47 will unset the flag bit value at index 47. 2701 func (f Flags64) Unset47() Flags64 { 2702 const mask = Flags64(1) << 47 2703 return f & ^mask 2704 } 2705 2706 // Get48 will fetch the flag bit value at index 48. 2707 func (f Flags64) Get48() bool { 2708 const mask = Flags64(1) << 48 2709 return (f&mask != 0) 2710 } 2711 2712 // Set48 will set the flag bit value at index 48. 2713 func (f Flags64) Set48() Flags64 { 2714 const mask = Flags64(1) << 48 2715 return f | mask 2716 } 2717 2718 // Unset48 will unset the flag bit value at index 48. 2719 func (f Flags64) Unset48() Flags64 { 2720 const mask = Flags64(1) << 48 2721 return f & ^mask 2722 } 2723 2724 // Get49 will fetch the flag bit value at index 49. 2725 func (f Flags64) Get49() bool { 2726 const mask = Flags64(1) << 49 2727 return (f&mask != 0) 2728 } 2729 2730 // Set49 will set the flag bit value at index 49. 2731 func (f Flags64) Set49() Flags64 { 2732 const mask = Flags64(1) << 49 2733 return f | mask 2734 } 2735 2736 // Unset49 will unset the flag bit value at index 49. 2737 func (f Flags64) Unset49() Flags64 { 2738 const mask = Flags64(1) << 49 2739 return f & ^mask 2740 } 2741 2742 // Get50 will fetch the flag bit value at index 50. 2743 func (f Flags64) Get50() bool { 2744 const mask = Flags64(1) << 50 2745 return (f&mask != 0) 2746 } 2747 2748 // Set50 will set the flag bit value at index 50. 2749 func (f Flags64) Set50() Flags64 { 2750 const mask = Flags64(1) << 50 2751 return f | mask 2752 } 2753 2754 // Unset50 will unset the flag bit value at index 50. 2755 func (f Flags64) Unset50() Flags64 { 2756 const mask = Flags64(1) << 50 2757 return f & ^mask 2758 } 2759 2760 // Get51 will fetch the flag bit value at index 51. 2761 func (f Flags64) Get51() bool { 2762 const mask = Flags64(1) << 51 2763 return (f&mask != 0) 2764 } 2765 2766 // Set51 will set the flag bit value at index 51. 2767 func (f Flags64) Set51() Flags64 { 2768 const mask = Flags64(1) << 51 2769 return f | mask 2770 } 2771 2772 // Unset51 will unset the flag bit value at index 51. 2773 func (f Flags64) Unset51() Flags64 { 2774 const mask = Flags64(1) << 51 2775 return f & ^mask 2776 } 2777 2778 // Get52 will fetch the flag bit value at index 52. 2779 func (f Flags64) Get52() bool { 2780 const mask = Flags64(1) << 52 2781 return (f&mask != 0) 2782 } 2783 2784 // Set52 will set the flag bit value at index 52. 2785 func (f Flags64) Set52() Flags64 { 2786 const mask = Flags64(1) << 52 2787 return f | mask 2788 } 2789 2790 // Unset52 will unset the flag bit value at index 52. 2791 func (f Flags64) Unset52() Flags64 { 2792 const mask = Flags64(1) << 52 2793 return f & ^mask 2794 } 2795 2796 // Get53 will fetch the flag bit value at index 53. 2797 func (f Flags64) Get53() bool { 2798 const mask = Flags64(1) << 53 2799 return (f&mask != 0) 2800 } 2801 2802 // Set53 will set the flag bit value at index 53. 2803 func (f Flags64) Set53() Flags64 { 2804 const mask = Flags64(1) << 53 2805 return f | mask 2806 } 2807 2808 // Unset53 will unset the flag bit value at index 53. 2809 func (f Flags64) Unset53() Flags64 { 2810 const mask = Flags64(1) << 53 2811 return f & ^mask 2812 } 2813 2814 // Get54 will fetch the flag bit value at index 54. 2815 func (f Flags64) Get54() bool { 2816 const mask = Flags64(1) << 54 2817 return (f&mask != 0) 2818 } 2819 2820 // Set54 will set the flag bit value at index 54. 2821 func (f Flags64) Set54() Flags64 { 2822 const mask = Flags64(1) << 54 2823 return f | mask 2824 } 2825 2826 // Unset54 will unset the flag bit value at index 54. 2827 func (f Flags64) Unset54() Flags64 { 2828 const mask = Flags64(1) << 54 2829 return f & ^mask 2830 } 2831 2832 // Get55 will fetch the flag bit value at index 55. 2833 func (f Flags64) Get55() bool { 2834 const mask = Flags64(1) << 55 2835 return (f&mask != 0) 2836 } 2837 2838 // Set55 will set the flag bit value at index 55. 2839 func (f Flags64) Set55() Flags64 { 2840 const mask = Flags64(1) << 55 2841 return f | mask 2842 } 2843 2844 // Unset55 will unset the flag bit value at index 55. 2845 func (f Flags64) Unset55() Flags64 { 2846 const mask = Flags64(1) << 55 2847 return f & ^mask 2848 } 2849 2850 // Get56 will fetch the flag bit value at index 56. 2851 func (f Flags64) Get56() bool { 2852 const mask = Flags64(1) << 56 2853 return (f&mask != 0) 2854 } 2855 2856 // Set56 will set the flag bit value at index 56. 2857 func (f Flags64) Set56() Flags64 { 2858 const mask = Flags64(1) << 56 2859 return f | mask 2860 } 2861 2862 // Unset56 will unset the flag bit value at index 56. 2863 func (f Flags64) Unset56() Flags64 { 2864 const mask = Flags64(1) << 56 2865 return f & ^mask 2866 } 2867 2868 // Get57 will fetch the flag bit value at index 57. 2869 func (f Flags64) Get57() bool { 2870 const mask = Flags64(1) << 57 2871 return (f&mask != 0) 2872 } 2873 2874 // Set57 will set the flag bit value at index 57. 2875 func (f Flags64) Set57() Flags64 { 2876 const mask = Flags64(1) << 57 2877 return f | mask 2878 } 2879 2880 // Unset57 will unset the flag bit value at index 57. 2881 func (f Flags64) Unset57() Flags64 { 2882 const mask = Flags64(1) << 57 2883 return f & ^mask 2884 } 2885 2886 // Get58 will fetch the flag bit value at index 58. 2887 func (f Flags64) Get58() bool { 2888 const mask = Flags64(1) << 58 2889 return (f&mask != 0) 2890 } 2891 2892 // Set58 will set the flag bit value at index 58. 2893 func (f Flags64) Set58() Flags64 { 2894 const mask = Flags64(1) << 58 2895 return f | mask 2896 } 2897 2898 // Unset58 will unset the flag bit value at index 58. 2899 func (f Flags64) Unset58() Flags64 { 2900 const mask = Flags64(1) << 58 2901 return f & ^mask 2902 } 2903 2904 // Get59 will fetch the flag bit value at index 59. 2905 func (f Flags64) Get59() bool { 2906 const mask = Flags64(1) << 59 2907 return (f&mask != 0) 2908 } 2909 2910 // Set59 will set the flag bit value at index 59. 2911 func (f Flags64) Set59() Flags64 { 2912 const mask = Flags64(1) << 59 2913 return f | mask 2914 } 2915 2916 // Unset59 will unset the flag bit value at index 59. 2917 func (f Flags64) Unset59() Flags64 { 2918 const mask = Flags64(1) << 59 2919 return f & ^mask 2920 } 2921 2922 // Get60 will fetch the flag bit value at index 60. 2923 func (f Flags64) Get60() bool { 2924 const mask = Flags64(1) << 60 2925 return (f&mask != 0) 2926 } 2927 2928 // Set60 will set the flag bit value at index 60. 2929 func (f Flags64) Set60() Flags64 { 2930 const mask = Flags64(1) << 60 2931 return f | mask 2932 } 2933 2934 // Unset60 will unset the flag bit value at index 60. 2935 func (f Flags64) Unset60() Flags64 { 2936 const mask = Flags64(1) << 60 2937 return f & ^mask 2938 } 2939 2940 // Get61 will fetch the flag bit value at index 61. 2941 func (f Flags64) Get61() bool { 2942 const mask = Flags64(1) << 61 2943 return (f&mask != 0) 2944 } 2945 2946 // Set61 will set the flag bit value at index 61. 2947 func (f Flags64) Set61() Flags64 { 2948 const mask = Flags64(1) << 61 2949 return f | mask 2950 } 2951 2952 // Unset61 will unset the flag bit value at index 61. 2953 func (f Flags64) Unset61() Flags64 { 2954 const mask = Flags64(1) << 61 2955 return f & ^mask 2956 } 2957 2958 // Get62 will fetch the flag bit value at index 62. 2959 func (f Flags64) Get62() bool { 2960 const mask = Flags64(1) << 62 2961 return (f&mask != 0) 2962 } 2963 2964 // Set62 will set the flag bit value at index 62. 2965 func (f Flags64) Set62() Flags64 { 2966 const mask = Flags64(1) << 62 2967 return f | mask 2968 } 2969 2970 // Unset62 will unset the flag bit value at index 62. 2971 func (f Flags64) Unset62() Flags64 { 2972 const mask = Flags64(1) << 62 2973 return f & ^mask 2974 } 2975 2976 // Get63 will fetch the flag bit value at index 63. 2977 func (f Flags64) Get63() bool { 2978 const mask = Flags64(1) << 63 2979 return (f&mask != 0) 2980 } 2981 2982 // Set63 will set the flag bit value at index 63. 2983 func (f Flags64) Set63() Flags64 { 2984 const mask = Flags64(1) << 63 2985 return f | mask 2986 } 2987 2988 // Unset63 will unset the flag bit value at index 63. 2989 func (f Flags64) Unset63() Flags64 { 2990 const mask = Flags64(1) << 63 2991 return f & ^mask 2992 } 2993 2994 // String returns a human readable representation of Flags64. 2995 func (f Flags64) String() string { 2996 var ( 2997 i int 2998 val bool 2999 buf []byte 3000 ) 3001 3002 // Make a prealloc est. based on longest-possible value 3003 const prealloc = 1 + (len("false ") * 64) - 1 + 1 3004 buf = make([]byte, prealloc) 3005 3006 buf[i] = '{' 3007 i++ 3008 3009 val = f.Get0() 3010 i += copy(buf[i:], bool2str(val)) 3011 buf[i] = ' ' 3012 i++ 3013 3014 val = f.Get1() 3015 i += copy(buf[i:], bool2str(val)) 3016 buf[i] = ' ' 3017 i++ 3018 3019 val = f.Get2() 3020 i += copy(buf[i:], bool2str(val)) 3021 buf[i] = ' ' 3022 i++ 3023 3024 val = f.Get3() 3025 i += copy(buf[i:], bool2str(val)) 3026 buf[i] = ' ' 3027 i++ 3028 3029 val = f.Get4() 3030 i += copy(buf[i:], bool2str(val)) 3031 buf[i] = ' ' 3032 i++ 3033 3034 val = f.Get5() 3035 i += copy(buf[i:], bool2str(val)) 3036 buf[i] = ' ' 3037 i++ 3038 3039 val = f.Get6() 3040 i += copy(buf[i:], bool2str(val)) 3041 buf[i] = ' ' 3042 i++ 3043 3044 val = f.Get7() 3045 i += copy(buf[i:], bool2str(val)) 3046 buf[i] = ' ' 3047 i++ 3048 3049 val = f.Get8() 3050 i += copy(buf[i:], bool2str(val)) 3051 buf[i] = ' ' 3052 i++ 3053 3054 val = f.Get9() 3055 i += copy(buf[i:], bool2str(val)) 3056 buf[i] = ' ' 3057 i++ 3058 3059 val = f.Get10() 3060 i += copy(buf[i:], bool2str(val)) 3061 buf[i] = ' ' 3062 i++ 3063 3064 val = f.Get11() 3065 i += copy(buf[i:], bool2str(val)) 3066 buf[i] = ' ' 3067 i++ 3068 3069 val = f.Get12() 3070 i += copy(buf[i:], bool2str(val)) 3071 buf[i] = ' ' 3072 i++ 3073 3074 val = f.Get13() 3075 i += copy(buf[i:], bool2str(val)) 3076 buf[i] = ' ' 3077 i++ 3078 3079 val = f.Get14() 3080 i += copy(buf[i:], bool2str(val)) 3081 buf[i] = ' ' 3082 i++ 3083 3084 val = f.Get15() 3085 i += copy(buf[i:], bool2str(val)) 3086 buf[i] = ' ' 3087 i++ 3088 3089 val = f.Get16() 3090 i += copy(buf[i:], bool2str(val)) 3091 buf[i] = ' ' 3092 i++ 3093 3094 val = f.Get17() 3095 i += copy(buf[i:], bool2str(val)) 3096 buf[i] = ' ' 3097 i++ 3098 3099 val = f.Get18() 3100 i += copy(buf[i:], bool2str(val)) 3101 buf[i] = ' ' 3102 i++ 3103 3104 val = f.Get19() 3105 i += copy(buf[i:], bool2str(val)) 3106 buf[i] = ' ' 3107 i++ 3108 3109 val = f.Get20() 3110 i += copy(buf[i:], bool2str(val)) 3111 buf[i] = ' ' 3112 i++ 3113 3114 val = f.Get21() 3115 i += copy(buf[i:], bool2str(val)) 3116 buf[i] = ' ' 3117 i++ 3118 3119 val = f.Get22() 3120 i += copy(buf[i:], bool2str(val)) 3121 buf[i] = ' ' 3122 i++ 3123 3124 val = f.Get23() 3125 i += copy(buf[i:], bool2str(val)) 3126 buf[i] = ' ' 3127 i++ 3128 3129 val = f.Get24() 3130 i += copy(buf[i:], bool2str(val)) 3131 buf[i] = ' ' 3132 i++ 3133 3134 val = f.Get25() 3135 i += copy(buf[i:], bool2str(val)) 3136 buf[i] = ' ' 3137 i++ 3138 3139 val = f.Get26() 3140 i += copy(buf[i:], bool2str(val)) 3141 buf[i] = ' ' 3142 i++ 3143 3144 val = f.Get27() 3145 i += copy(buf[i:], bool2str(val)) 3146 buf[i] = ' ' 3147 i++ 3148 3149 val = f.Get28() 3150 i += copy(buf[i:], bool2str(val)) 3151 buf[i] = ' ' 3152 i++ 3153 3154 val = f.Get29() 3155 i += copy(buf[i:], bool2str(val)) 3156 buf[i] = ' ' 3157 i++ 3158 3159 val = f.Get30() 3160 i += copy(buf[i:], bool2str(val)) 3161 buf[i] = ' ' 3162 i++ 3163 3164 val = f.Get31() 3165 i += copy(buf[i:], bool2str(val)) 3166 buf[i] = ' ' 3167 i++ 3168 3169 val = f.Get32() 3170 i += copy(buf[i:], bool2str(val)) 3171 buf[i] = ' ' 3172 i++ 3173 3174 val = f.Get33() 3175 i += copy(buf[i:], bool2str(val)) 3176 buf[i] = ' ' 3177 i++ 3178 3179 val = f.Get34() 3180 i += copy(buf[i:], bool2str(val)) 3181 buf[i] = ' ' 3182 i++ 3183 3184 val = f.Get35() 3185 i += copy(buf[i:], bool2str(val)) 3186 buf[i] = ' ' 3187 i++ 3188 3189 val = f.Get36() 3190 i += copy(buf[i:], bool2str(val)) 3191 buf[i] = ' ' 3192 i++ 3193 3194 val = f.Get37() 3195 i += copy(buf[i:], bool2str(val)) 3196 buf[i] = ' ' 3197 i++ 3198 3199 val = f.Get38() 3200 i += copy(buf[i:], bool2str(val)) 3201 buf[i] = ' ' 3202 i++ 3203 3204 val = f.Get39() 3205 i += copy(buf[i:], bool2str(val)) 3206 buf[i] = ' ' 3207 i++ 3208 3209 val = f.Get40() 3210 i += copy(buf[i:], bool2str(val)) 3211 buf[i] = ' ' 3212 i++ 3213 3214 val = f.Get41() 3215 i += copy(buf[i:], bool2str(val)) 3216 buf[i] = ' ' 3217 i++ 3218 3219 val = f.Get42() 3220 i += copy(buf[i:], bool2str(val)) 3221 buf[i] = ' ' 3222 i++ 3223 3224 val = f.Get43() 3225 i += copy(buf[i:], bool2str(val)) 3226 buf[i] = ' ' 3227 i++ 3228 3229 val = f.Get44() 3230 i += copy(buf[i:], bool2str(val)) 3231 buf[i] = ' ' 3232 i++ 3233 3234 val = f.Get45() 3235 i += copy(buf[i:], bool2str(val)) 3236 buf[i] = ' ' 3237 i++ 3238 3239 val = f.Get46() 3240 i += copy(buf[i:], bool2str(val)) 3241 buf[i] = ' ' 3242 i++ 3243 3244 val = f.Get47() 3245 i += copy(buf[i:], bool2str(val)) 3246 buf[i] = ' ' 3247 i++ 3248 3249 val = f.Get48() 3250 i += copy(buf[i:], bool2str(val)) 3251 buf[i] = ' ' 3252 i++ 3253 3254 val = f.Get49() 3255 i += copy(buf[i:], bool2str(val)) 3256 buf[i] = ' ' 3257 i++ 3258 3259 val = f.Get50() 3260 i += copy(buf[i:], bool2str(val)) 3261 buf[i] = ' ' 3262 i++ 3263 3264 val = f.Get51() 3265 i += copy(buf[i:], bool2str(val)) 3266 buf[i] = ' ' 3267 i++ 3268 3269 val = f.Get52() 3270 i += copy(buf[i:], bool2str(val)) 3271 buf[i] = ' ' 3272 i++ 3273 3274 val = f.Get53() 3275 i += copy(buf[i:], bool2str(val)) 3276 buf[i] = ' ' 3277 i++ 3278 3279 val = f.Get54() 3280 i += copy(buf[i:], bool2str(val)) 3281 buf[i] = ' ' 3282 i++ 3283 3284 val = f.Get55() 3285 i += copy(buf[i:], bool2str(val)) 3286 buf[i] = ' ' 3287 i++ 3288 3289 val = f.Get56() 3290 i += copy(buf[i:], bool2str(val)) 3291 buf[i] = ' ' 3292 i++ 3293 3294 val = f.Get57() 3295 i += copy(buf[i:], bool2str(val)) 3296 buf[i] = ' ' 3297 i++ 3298 3299 val = f.Get58() 3300 i += copy(buf[i:], bool2str(val)) 3301 buf[i] = ' ' 3302 i++ 3303 3304 val = f.Get59() 3305 i += copy(buf[i:], bool2str(val)) 3306 buf[i] = ' ' 3307 i++ 3308 3309 val = f.Get60() 3310 i += copy(buf[i:], bool2str(val)) 3311 buf[i] = ' ' 3312 i++ 3313 3314 val = f.Get61() 3315 i += copy(buf[i:], bool2str(val)) 3316 buf[i] = ' ' 3317 i++ 3318 3319 val = f.Get62() 3320 i += copy(buf[i:], bool2str(val)) 3321 buf[i] = ' ' 3322 i++ 3323 3324 val = f.Get63() 3325 i += copy(buf[i:], bool2str(val)) 3326 buf[i] = ' ' 3327 i++ 3328 3329 buf[i-1] = '}' 3330 buf = buf[:i] 3331 3332 return *(*string)(unsafe.Pointer(&buf)) 3333 } 3334 3335 // GoString returns a more verbose human readable representation of Flags64. 3336 func (f Flags64) GoString() string { 3337 var ( 3338 i int 3339 val bool 3340 buf []byte 3341 ) 3342 3343 // Make a prealloc est. based on longest-possible value 3344 const prealloc = len("bitutil.Flags64{") + (len("63=false ") * 64) - 1 + 1 3345 buf = make([]byte, prealloc) 3346 3347 i += copy(buf[i:], "bitutil.Flags64{") 3348 3349 val = f.Get0() 3350 i += copy(buf[i:], "0=") 3351 i += copy(buf[i:], bool2str(val)) 3352 buf[i] = ' ' 3353 i++ 3354 3355 val = f.Get1() 3356 i += copy(buf[i:], "1=") 3357 i += copy(buf[i:], bool2str(val)) 3358 buf[i] = ' ' 3359 i++ 3360 3361 val = f.Get2() 3362 i += copy(buf[i:], "2=") 3363 i += copy(buf[i:], bool2str(val)) 3364 buf[i] = ' ' 3365 i++ 3366 3367 val = f.Get3() 3368 i += copy(buf[i:], "3=") 3369 i += copy(buf[i:], bool2str(val)) 3370 buf[i] = ' ' 3371 i++ 3372 3373 val = f.Get4() 3374 i += copy(buf[i:], "4=") 3375 i += copy(buf[i:], bool2str(val)) 3376 buf[i] = ' ' 3377 i++ 3378 3379 val = f.Get5() 3380 i += copy(buf[i:], "5=") 3381 i += copy(buf[i:], bool2str(val)) 3382 buf[i] = ' ' 3383 i++ 3384 3385 val = f.Get6() 3386 i += copy(buf[i:], "6=") 3387 i += copy(buf[i:], bool2str(val)) 3388 buf[i] = ' ' 3389 i++ 3390 3391 val = f.Get7() 3392 i += copy(buf[i:], "7=") 3393 i += copy(buf[i:], bool2str(val)) 3394 buf[i] = ' ' 3395 i++ 3396 3397 val = f.Get8() 3398 i += copy(buf[i:], "8=") 3399 i += copy(buf[i:], bool2str(val)) 3400 buf[i] = ' ' 3401 i++ 3402 3403 val = f.Get9() 3404 i += copy(buf[i:], "9=") 3405 i += copy(buf[i:], bool2str(val)) 3406 buf[i] = ' ' 3407 i++ 3408 3409 val = f.Get10() 3410 i += copy(buf[i:], "10=") 3411 i += copy(buf[i:], bool2str(val)) 3412 buf[i] = ' ' 3413 i++ 3414 3415 val = f.Get11() 3416 i += copy(buf[i:], "11=") 3417 i += copy(buf[i:], bool2str(val)) 3418 buf[i] = ' ' 3419 i++ 3420 3421 val = f.Get12() 3422 i += copy(buf[i:], "12=") 3423 i += copy(buf[i:], bool2str(val)) 3424 buf[i] = ' ' 3425 i++ 3426 3427 val = f.Get13() 3428 i += copy(buf[i:], "13=") 3429 i += copy(buf[i:], bool2str(val)) 3430 buf[i] = ' ' 3431 i++ 3432 3433 val = f.Get14() 3434 i += copy(buf[i:], "14=") 3435 i += copy(buf[i:], bool2str(val)) 3436 buf[i] = ' ' 3437 i++ 3438 3439 val = f.Get15() 3440 i += copy(buf[i:], "15=") 3441 i += copy(buf[i:], bool2str(val)) 3442 buf[i] = ' ' 3443 i++ 3444 3445 val = f.Get16() 3446 i += copy(buf[i:], "16=") 3447 i += copy(buf[i:], bool2str(val)) 3448 buf[i] = ' ' 3449 i++ 3450 3451 val = f.Get17() 3452 i += copy(buf[i:], "17=") 3453 i += copy(buf[i:], bool2str(val)) 3454 buf[i] = ' ' 3455 i++ 3456 3457 val = f.Get18() 3458 i += copy(buf[i:], "18=") 3459 i += copy(buf[i:], bool2str(val)) 3460 buf[i] = ' ' 3461 i++ 3462 3463 val = f.Get19() 3464 i += copy(buf[i:], "19=") 3465 i += copy(buf[i:], bool2str(val)) 3466 buf[i] = ' ' 3467 i++ 3468 3469 val = f.Get20() 3470 i += copy(buf[i:], "20=") 3471 i += copy(buf[i:], bool2str(val)) 3472 buf[i] = ' ' 3473 i++ 3474 3475 val = f.Get21() 3476 i += copy(buf[i:], "21=") 3477 i += copy(buf[i:], bool2str(val)) 3478 buf[i] = ' ' 3479 i++ 3480 3481 val = f.Get22() 3482 i += copy(buf[i:], "22=") 3483 i += copy(buf[i:], bool2str(val)) 3484 buf[i] = ' ' 3485 i++ 3486 3487 val = f.Get23() 3488 i += copy(buf[i:], "23=") 3489 i += copy(buf[i:], bool2str(val)) 3490 buf[i] = ' ' 3491 i++ 3492 3493 val = f.Get24() 3494 i += copy(buf[i:], "24=") 3495 i += copy(buf[i:], bool2str(val)) 3496 buf[i] = ' ' 3497 i++ 3498 3499 val = f.Get25() 3500 i += copy(buf[i:], "25=") 3501 i += copy(buf[i:], bool2str(val)) 3502 buf[i] = ' ' 3503 i++ 3504 3505 val = f.Get26() 3506 i += copy(buf[i:], "26=") 3507 i += copy(buf[i:], bool2str(val)) 3508 buf[i] = ' ' 3509 i++ 3510 3511 val = f.Get27() 3512 i += copy(buf[i:], "27=") 3513 i += copy(buf[i:], bool2str(val)) 3514 buf[i] = ' ' 3515 i++ 3516 3517 val = f.Get28() 3518 i += copy(buf[i:], "28=") 3519 i += copy(buf[i:], bool2str(val)) 3520 buf[i] = ' ' 3521 i++ 3522 3523 val = f.Get29() 3524 i += copy(buf[i:], "29=") 3525 i += copy(buf[i:], bool2str(val)) 3526 buf[i] = ' ' 3527 i++ 3528 3529 val = f.Get30() 3530 i += copy(buf[i:], "30=") 3531 i += copy(buf[i:], bool2str(val)) 3532 buf[i] = ' ' 3533 i++ 3534 3535 val = f.Get31() 3536 i += copy(buf[i:], "31=") 3537 i += copy(buf[i:], bool2str(val)) 3538 buf[i] = ' ' 3539 i++ 3540 3541 val = f.Get32() 3542 i += copy(buf[i:], "32=") 3543 i += copy(buf[i:], bool2str(val)) 3544 buf[i] = ' ' 3545 i++ 3546 3547 val = f.Get33() 3548 i += copy(buf[i:], "33=") 3549 i += copy(buf[i:], bool2str(val)) 3550 buf[i] = ' ' 3551 i++ 3552 3553 val = f.Get34() 3554 i += copy(buf[i:], "34=") 3555 i += copy(buf[i:], bool2str(val)) 3556 buf[i] = ' ' 3557 i++ 3558 3559 val = f.Get35() 3560 i += copy(buf[i:], "35=") 3561 i += copy(buf[i:], bool2str(val)) 3562 buf[i] = ' ' 3563 i++ 3564 3565 val = f.Get36() 3566 i += copy(buf[i:], "36=") 3567 i += copy(buf[i:], bool2str(val)) 3568 buf[i] = ' ' 3569 i++ 3570 3571 val = f.Get37() 3572 i += copy(buf[i:], "37=") 3573 i += copy(buf[i:], bool2str(val)) 3574 buf[i] = ' ' 3575 i++ 3576 3577 val = f.Get38() 3578 i += copy(buf[i:], "38=") 3579 i += copy(buf[i:], bool2str(val)) 3580 buf[i] = ' ' 3581 i++ 3582 3583 val = f.Get39() 3584 i += copy(buf[i:], "39=") 3585 i += copy(buf[i:], bool2str(val)) 3586 buf[i] = ' ' 3587 i++ 3588 3589 val = f.Get40() 3590 i += copy(buf[i:], "40=") 3591 i += copy(buf[i:], bool2str(val)) 3592 buf[i] = ' ' 3593 i++ 3594 3595 val = f.Get41() 3596 i += copy(buf[i:], "41=") 3597 i += copy(buf[i:], bool2str(val)) 3598 buf[i] = ' ' 3599 i++ 3600 3601 val = f.Get42() 3602 i += copy(buf[i:], "42=") 3603 i += copy(buf[i:], bool2str(val)) 3604 buf[i] = ' ' 3605 i++ 3606 3607 val = f.Get43() 3608 i += copy(buf[i:], "43=") 3609 i += copy(buf[i:], bool2str(val)) 3610 buf[i] = ' ' 3611 i++ 3612 3613 val = f.Get44() 3614 i += copy(buf[i:], "44=") 3615 i += copy(buf[i:], bool2str(val)) 3616 buf[i] = ' ' 3617 i++ 3618 3619 val = f.Get45() 3620 i += copy(buf[i:], "45=") 3621 i += copy(buf[i:], bool2str(val)) 3622 buf[i] = ' ' 3623 i++ 3624 3625 val = f.Get46() 3626 i += copy(buf[i:], "46=") 3627 i += copy(buf[i:], bool2str(val)) 3628 buf[i] = ' ' 3629 i++ 3630 3631 val = f.Get47() 3632 i += copy(buf[i:], "47=") 3633 i += copy(buf[i:], bool2str(val)) 3634 buf[i] = ' ' 3635 i++ 3636 3637 val = f.Get48() 3638 i += copy(buf[i:], "48=") 3639 i += copy(buf[i:], bool2str(val)) 3640 buf[i] = ' ' 3641 i++ 3642 3643 val = f.Get49() 3644 i += copy(buf[i:], "49=") 3645 i += copy(buf[i:], bool2str(val)) 3646 buf[i] = ' ' 3647 i++ 3648 3649 val = f.Get50() 3650 i += copy(buf[i:], "50=") 3651 i += copy(buf[i:], bool2str(val)) 3652 buf[i] = ' ' 3653 i++ 3654 3655 val = f.Get51() 3656 i += copy(buf[i:], "51=") 3657 i += copy(buf[i:], bool2str(val)) 3658 buf[i] = ' ' 3659 i++ 3660 3661 val = f.Get52() 3662 i += copy(buf[i:], "52=") 3663 i += copy(buf[i:], bool2str(val)) 3664 buf[i] = ' ' 3665 i++ 3666 3667 val = f.Get53() 3668 i += copy(buf[i:], "53=") 3669 i += copy(buf[i:], bool2str(val)) 3670 buf[i] = ' ' 3671 i++ 3672 3673 val = f.Get54() 3674 i += copy(buf[i:], "54=") 3675 i += copy(buf[i:], bool2str(val)) 3676 buf[i] = ' ' 3677 i++ 3678 3679 val = f.Get55() 3680 i += copy(buf[i:], "55=") 3681 i += copy(buf[i:], bool2str(val)) 3682 buf[i] = ' ' 3683 i++ 3684 3685 val = f.Get56() 3686 i += copy(buf[i:], "56=") 3687 i += copy(buf[i:], bool2str(val)) 3688 buf[i] = ' ' 3689 i++ 3690 3691 val = f.Get57() 3692 i += copy(buf[i:], "57=") 3693 i += copy(buf[i:], bool2str(val)) 3694 buf[i] = ' ' 3695 i++ 3696 3697 val = f.Get58() 3698 i += copy(buf[i:], "58=") 3699 i += copy(buf[i:], bool2str(val)) 3700 buf[i] = ' ' 3701 i++ 3702 3703 val = f.Get59() 3704 i += copy(buf[i:], "59=") 3705 i += copy(buf[i:], bool2str(val)) 3706 buf[i] = ' ' 3707 i++ 3708 3709 val = f.Get60() 3710 i += copy(buf[i:], "60=") 3711 i += copy(buf[i:], bool2str(val)) 3712 buf[i] = ' ' 3713 i++ 3714 3715 val = f.Get61() 3716 i += copy(buf[i:], "61=") 3717 i += copy(buf[i:], bool2str(val)) 3718 buf[i] = ' ' 3719 i++ 3720 3721 val = f.Get62() 3722 i += copy(buf[i:], "62=") 3723 i += copy(buf[i:], bool2str(val)) 3724 buf[i] = ' ' 3725 i++ 3726 3727 val = f.Get63() 3728 i += copy(buf[i:], "63=") 3729 i += copy(buf[i:], bool2str(val)) 3730 buf[i] = ' ' 3731 i++ 3732 3733 buf[i-1] = '}' 3734 buf = buf[:i] 3735 3736 return *(*string)(unsafe.Pointer(&buf)) 3737 } 3738 3739 func bool2str(b bool) string { 3740 if b { 3741 return "true" 3742 } 3743 return "false" 3744 }