github.com/shranet/mobile@v0.0.0-20200814083559-5702cdcd481b/internal/binres/binres_string.go (about)

     1  // Code generated by "stringer -output binres_string.go -type ResType,DataType"; DO NOT EDIT.
     2  
     3  package binres
     4  
     5  import "strconv"
     6  
     7  const (
     8  	_ResType_name_0 = "ResNullResStringPoolResTableResXML"
     9  	_ResType_name_1 = "ResXMLStartNamespaceResXMLEndNamespaceResXMLStartElementResXMLEndElementResXMLCharData"
    10  	_ResType_name_2 = "ResXMLResourceMap"
    11  	_ResType_name_3 = "ResTablePackageResTableTypeResTableTypeSpecResTableLibrary"
    12  )
    13  
    14  var (
    15  	_ResType_index_0 = [...]uint8{0, 7, 20, 28, 34}
    16  	_ResType_index_1 = [...]uint8{0, 20, 38, 56, 72, 86}
    17  	_ResType_index_3 = [...]uint8{0, 15, 27, 43, 58}
    18  )
    19  
    20  func (i ResType) String() string {
    21  	switch {
    22  	case 0 <= i && i <= 3:
    23  		return _ResType_name_0[_ResType_index_0[i]:_ResType_index_0[i+1]]
    24  	case 256 <= i && i <= 260:
    25  		i -= 256
    26  		return _ResType_name_1[_ResType_index_1[i]:_ResType_index_1[i+1]]
    27  	case i == 384:
    28  		return _ResType_name_2
    29  	case 512 <= i && i <= 515:
    30  		i -= 512
    31  		return _ResType_name_3[_ResType_index_3[i]:_ResType_index_3[i+1]]
    32  	default:
    33  		return "ResType(" + strconv.FormatInt(int64(i), 10) + ")"
    34  	}
    35  }
    36  
    37  const (
    38  	_DataType_name_0 = "DataNullDataReferenceDataAttributeDataStringDataFloatDataDimensionDataFractionDataDynamicReference"
    39  	_DataType_name_1 = "DataIntDecDataIntHexDataIntBool"
    40  	_DataType_name_2 = "DataIntColorARGB8DataIntColorRGB8DataIntColorARGB4DataIntColorRGB4"
    41  )
    42  
    43  var (
    44  	_DataType_index_0 = [...]uint8{0, 8, 21, 34, 44, 53, 66, 78, 98}
    45  	_DataType_index_1 = [...]uint8{0, 10, 20, 31}
    46  	_DataType_index_2 = [...]uint8{0, 17, 33, 50, 66}
    47  )
    48  
    49  func (i DataType) String() string {
    50  	switch {
    51  	case 0 <= i && i <= 7:
    52  		return _DataType_name_0[_DataType_index_0[i]:_DataType_index_0[i+1]]
    53  	case 16 <= i && i <= 18:
    54  		i -= 16
    55  		return _DataType_name_1[_DataType_index_1[i]:_DataType_index_1[i+1]]
    56  	case 28 <= i && i <= 31:
    57  		i -= 28
    58  		return _DataType_name_2[_DataType_index_2[i]:_DataType_index_2[i+1]]
    59  	default:
    60  		return "DataType(" + strconv.FormatInt(int64(i), 10) + ")"
    61  	}
    62  }