github.com/voedger/voedger@v0.0.0-20240520144910-273e84102129/pkg/exttinygo/impl_value.go (about)

     1  /*
     2    - Copyright (c) 2023-present unTill Software Development Group B.V.
     3      @author Michael Saigachenko
     4  */
     5  
     6  package exttinygo
     7  
     8  import (
     9  	"github.com/voedger/voedger/pkg/exttinygo/internal"
    10  	safe "github.com/voedger/voedger/pkg/state/isafestateapi"
    11  )
    12  
    13  func (v TValue) AsInt32(name string) int32 {
    14  	return internal.SafeStateAPI.ValueAsInt32(safe.TValue(v), name)
    15  }
    16  
    17  func (v TValue) AsInt64(name string) int64 {
    18  	return internal.SafeStateAPI.ValueAsInt64(safe.TValue(v), name)
    19  }
    20  
    21  func (v TValue) AsFloat32(name string) float32 {
    22  	return internal.SafeStateAPI.ValueAsFloat32(safe.TValue(v), name)
    23  }
    24  
    25  func (v TValue) AsFloat64(name string) float64 {
    26  	return internal.SafeStateAPI.ValueAsFloat64(safe.TValue(v), name)
    27  }
    28  
    29  func (v TValue) AsString(name string) string {
    30  	return internal.SafeStateAPI.ValueAsString(safe.TValue(v), name)
    31  }
    32  
    33  func (v TValue) AsBytes(name string) []byte {
    34  	return internal.SafeStateAPI.ValueAsBytes(safe.TValue(v), name)
    35  }
    36  
    37  func (v TValue) AsQName(name string) QName {
    38  	return QName(internal.SafeStateAPI.ValueAsQName(safe.TValue(v), name))
    39  }
    40  
    41  func (v TValue) AsBool(name string) bool {
    42  	return internal.SafeStateAPI.ValueAsBool(safe.TValue(v), name)
    43  }
    44  
    45  func (v TValue) AsValue(name string) TValue {
    46  	return TValue(internal.SafeStateAPI.ValueAsValue(safe.TValue(v), name))
    47  }
    48  
    49  func (v TValue) Len() int {
    50  	return internal.SafeStateAPI.ValueLen(safe.TValue(v))
    51  }
    52  
    53  func (v TValue) GetAsValue(index int) TValue {
    54  	return TValue(internal.SafeStateAPI.ValueGetAsValue(safe.TValue(v), index))
    55  }
    56  
    57  func (v TValue) GetAsInt32(index int) int32 {
    58  	return internal.SafeStateAPI.ValueGetAsInt32(safe.TValue(v), index)
    59  }
    60  
    61  func (v TValue) GetAsInt64(index int) int64 {
    62  	return internal.SafeStateAPI.ValueGetAsInt64(safe.TValue(v), index)
    63  }
    64  
    65  func (v TValue) GetAsFloat32(index int) float32 {
    66  	return internal.SafeStateAPI.ValueGetAsFloat32(safe.TValue(v), index)
    67  }
    68  
    69  func (v TValue) GetAsFloat64(index int) float64 {
    70  	return internal.SafeStateAPI.ValueGetAsFloat64(safe.TValue(v), index)
    71  }
    72  
    73  func (v TValue) GetAsBytes(index int) []byte {
    74  	return internal.SafeStateAPI.ValueGetAsBytes(safe.TValue(v), index)
    75  }
    76  
    77  func (v TValue) GetAsQName(index int) QName {
    78  	return QName(internal.SafeStateAPI.ValueGetAsQName(safe.TValue(v), index))
    79  }
    80  
    81  func (v TValue) GetAsBool(index int) bool {
    82  	return internal.SafeStateAPI.ValueGetAsBool(safe.TValue(v), index)
    83  }
    84  
    85  func (v TValue) GetAsString(index int) string {
    86  	return internal.SafeStateAPI.ValueGetAsString(safe.TValue(v), index)
    87  }