github.com/goki/ki@v1.1.17/ki/flags_string.go (about)

     1  // Code generated by "stringer -type=Flags"; DO NOT EDIT.
     2  
     3  package ki
     4  
     5  import (
     6  	"errors"
     7  	"strconv"
     8  )
     9  
    10  func _() {
    11  	// An "invalid array index" compiler error signifies that the constant values have changed.
    12  	// Re-run the stringer command to generate them again.
    13  	var x [1]struct{}
    14  	_ = x[IsField-0]
    15  	_ = x[HasKiFields-1]
    16  	_ = x[HasNoKiFields-2]
    17  	_ = x[Updating-3]
    18  	_ = x[OnlySelfUpdate-4]
    19  	_ = x[NodeDeleted-5]
    20  	_ = x[NodeDestroyed-6]
    21  	_ = x[ChildAdded-7]
    22  	_ = x[ChildDeleted-8]
    23  	_ = x[ChildrenDeleted-9]
    24  	_ = x[ValUpdated-10]
    25  	_ = x[FlagsN-11]
    26  }
    27  
    28  const _Flags_name = "IsFieldHasKiFieldsHasNoKiFieldsUpdatingOnlySelfUpdateNodeDeletedNodeDestroyedChildAddedChildDeletedChildrenDeletedValUpdatedFlagsN"
    29  
    30  var _Flags_index = [...]uint8{0, 7, 18, 31, 39, 53, 64, 77, 87, 99, 114, 124, 130}
    31  
    32  func (i Flags) String() string {
    33  	if i < 0 || i >= Flags(len(_Flags_index)-1) {
    34  		return "Flags(" + strconv.FormatInt(int64(i), 10) + ")"
    35  	}
    36  	return _Flags_name[_Flags_index[i]:_Flags_index[i+1]]
    37  }
    38  
    39  func (i *Flags) FromString(s string) error {
    40  	for j := 0; j < len(_Flags_index)-1; j++ {
    41  		if s == _Flags_name[_Flags_index[j]:_Flags_index[j+1]] {
    42  			*i = Flags(j)
    43  			return nil
    44  		}
    45  	}
    46  	return errors.New("String: " + s + " is not a valid option for type: Flags")
    47  }
    48  
    49  var _Flags_descMap = map[Flags]string{
    50  	0:  `IsField indicates a node is a field in its parent node, not a child in children.`,
    51  	1:  `HasKiFields indicates a node has Ki Node fields that will be processed in recursive descent. Use the HasFields() method to check as it will establish validity of flags on first call. If neither HasFields nor HasNoFields are set, then it knows to update flags.`,
    52  	2:  `HasNoKiFields indicates a node has NO Ki Node fields that will be processed in recursive descent. Use the HasFields() method to check as it will establish validity of flags on first call. If neither HasFields nor HasNoFields are set, then it knows to update flags.`,
    53  	3:  `Updating flag is set at UpdateStart and cleared if we were the first updater at UpdateEnd.`,
    54  	4:  `OnlySelfUpdate means that the UpdateStart / End logic only applies to this node in isolation, not to its children -- useful for a parent node that has a different functional role than its children.`,
    55  	5:  `NodeDeleted means this node has been deleted.`,
    56  	6:  `NodeDestroyed means this node has been destroyed -- do not trigger any more update signals on it.`,
    57  	7:  `ChildAdded means one or more new children were added to the node.`,
    58  	8:  `ChildDeleted means one or more children were deleted from the node.`,
    59  	9:  `ChildrenDeleted means all children were deleted.`,
    60  	10: `ValUpdated means a value was updated (Field, Prop, any kind of value)`,
    61  	11: `FlagsN is total number of flags used by base Ki Node -- can extend from here up to 64 bits.`,
    62  }
    63  
    64  func (i Flags) Desc() string {
    65  	if str, ok := _Flags_descMap[i]; ok {
    66  		return str
    67  	}
    68  	return "Flags(" + strconv.FormatInt(int64(i), 10) + ")"
    69  }