Documentation ¶
Index ¶
- Constants
- type AbstractVariantOperations
- func (c *AbstractVariantOperations) Add(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) And(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) Div(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) Equal(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) GetElement(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) In(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) Less(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) LessEqual(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) Lsh(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) Mod(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) More(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) MoreEqual(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) Mul(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) Negative(value *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) Not(value *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) NotEqual(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) Or(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) Pow(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) Rsh(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) Sub(value1 *Variant, value2 *Variant) (*Variant, error)
- func (c *AbstractVariantOperations) Xor(value1 *Variant, value2 *Variant) (*Variant, error)
- type IVariantOperations
- type IVariantOperationsOverrides
- type TypeSafeVariantOperations
- type TypeUnsafeVariantOperations
- type Variant
- func EmptyVariant() *Variant
- func NewVariant(value interface{}) *Variant
- func VariantFromArray(value []*Variant) *Variant
- func VariantFromBoolean(value bool) *Variant
- func VariantFromDateTime(value time.Time) *Variant
- func VariantFromDouble(value float64) *Variant
- func VariantFromFloat(value float32) *Variant
- func VariantFromInteger(value int) *Variant
- func VariantFromLong(value int64) *Variant
- func VariantFromObject(value interface{}) *Variant
- func VariantFromString(value string) *Variant
- func VariantFromTimeSpan(value time.Duration) *Variant
- func (c *Variant) AsArray() []*Variant
- func (c *Variant) AsBoolean() bool
- func (c *Variant) AsDateTime() time.Time
- func (c *Variant) AsDouble() float64
- func (c *Variant) AsFloat() float32
- func (c *Variant) AsInteger() int
- func (c *Variant) AsLong() int64
- func (c *Variant) AsObject() interface{}
- func (c *Variant) AsString() string
- func (c *Variant) AsTimeSpan() time.Duration
- func (c *Variant) Assign(value *Variant)
- func (c *Variant) Clear()
- func (c *Variant) Clone() *Variant
- func (c *Variant) Equals(obj interface{}) bool
- func (c *Variant) GetByIndex(index int) *Variant
- func (c *Variant) IsEmpty() bool
- func (c *Variant) IsNull() bool
- func (c *Variant) Length() int
- func (c *Variant) SetAsArray(value []*Variant)
- func (c *Variant) SetAsBoolean(value bool)
- func (c *Variant) SetAsDateTime(value time.Time)
- func (c *Variant) SetAsDouble(value float64)
- func (c *Variant) SetAsFloat(value float32)
- func (c *Variant) SetAsInteger(value int)
- func (c *Variant) SetAsLong(value int64)
- func (c *Variant) SetAsObject(value interface{})
- func (c *Variant) SetAsString(value string)
- func (c *Variant) SetAsTimeSpan(value time.Duration)
- func (c *Variant) SetByIndex(index int, element *Variant)
- func (c *Variant) SetLength(value int)
- func (c *Variant) String() string
- func (c *Variant) Type() int
Constants ¶
const ( Null = iota Integer Long Float Double String Boolean DateTime TimeSpan Object Array )
Defines supported types of variant values.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbstractVariantOperations ¶
type AbstractVariantOperations struct {
Overrides IVariantOperationsOverrides
}
Implements an abstractd variant operations manager object.
func InheritAbstractVariantOperations ¶
func InheritAbstractVariantOperations(overrides IVariantOperationsOverrides) *AbstractVariantOperations
func (*AbstractVariantOperations) Add ¶
func (c *AbstractVariantOperations) Add( value1 *Variant, value2 *Variant) (*Variant, error)
Performs '+' operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) And ¶
func (c *AbstractVariantOperations) And( value1 *Variant, value2 *Variant) (*Variant, error)
Performs AND operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) Div ¶
func (c *AbstractVariantOperations) Div( value1 *Variant, value2 *Variant) (*Variant, error)
Performs '/' operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) Equal ¶
func (c *AbstractVariantOperations) Equal( value1 *Variant, value2 *Variant) (*Variant, error)
Performs '=' operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) GetElement ¶
func (c *AbstractVariantOperations) GetElement( value1 *Variant, value2 *Variant) (*Variant, error)
Performs [] operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) In ¶
func (c *AbstractVariantOperations) In( value1 *Variant, value2 *Variant) (*Variant, error)
Performs IN operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) Less ¶
func (c *AbstractVariantOperations) Less( value1 *Variant, value2 *Variant) (*Variant, error)
Performs '<' operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) LessEqual ¶
func (c *AbstractVariantOperations) LessEqual( value1 *Variant, value2 *Variant) (*Variant, error)
Performs '<=' operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) Lsh ¶
func (c *AbstractVariantOperations) Lsh( value1 *Variant, value2 *Variant) (*Variant, error)
Performs '<<' operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) Mod ¶
func (c *AbstractVariantOperations) Mod( value1 *Variant, value2 *Variant) (*Variant, error)
Performs '%' operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) More ¶
func (c *AbstractVariantOperations) More( value1 *Variant, value2 *Variant) (*Variant, error)
Performs '>' operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) MoreEqual ¶
func (c *AbstractVariantOperations) MoreEqual( value1 *Variant, value2 *Variant) (*Variant, error)
Performs '>=' operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) Mul ¶
func (c *AbstractVariantOperations) Mul( value1 *Variant, value2 *Variant) (*Variant, error)
Performs '*' operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) Negative ¶
func (c *AbstractVariantOperations) Negative(value *Variant) (*Variant, error)
Performs unary '-' operation for a variant.
Parameters:
- value: The operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) Not ¶
func (c *AbstractVariantOperations) Not(value *Variant) (*Variant, error)
Performs NOT operation for a variant.
Parameters:
- value: The operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) NotEqual ¶
func (c *AbstractVariantOperations) NotEqual( value1 *Variant, value2 *Variant) (*Variant, error)
Performs '<>' operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) Or ¶
func (c *AbstractVariantOperations) Or( value1 *Variant, value2 *Variant) (*Variant, error)
Performs OR operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) Pow ¶
func (c *AbstractVariantOperations) Pow( value1 *Variant, value2 *Variant) (*Variant, error)
Performs '^' operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) Rsh ¶
func (c *AbstractVariantOperations) Rsh( value1 *Variant, value2 *Variant) (*Variant, error)
Performs '>>' operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) Sub ¶
func (c *AbstractVariantOperations) Sub( value1 *Variant, value2 *Variant) (*Variant, error)
Performs '-' operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
func (*AbstractVariantOperations) Xor ¶
func (c *AbstractVariantOperations) Xor( value1 *Variant, value2 *Variant) (*Variant, error)
Performs XOR operation for two variants.
Parameters:
- value1: The first operand for this operation.
- value2: The second operand for this operation.
Returns: A result variant object.
type IVariantOperations ¶
type IVariantOperations interface { // Converts variant to specified type // // Parameters: // - value: A variant value to be converted. // - newType: A type of object to be returned. // Returns: A converted Variant value. Convert(value *Variant, newType int) (*Variant, error) // Performs '+' operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. Add(value1 *Variant, value2 *Variant) (*Variant, error) // Performs '-' operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. Sub(value1 *Variant, value2 *Variant) (*Variant, error) // Performs '*' operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. Mul(value1 *Variant, value2 *Variant) (*Variant, error) // Performs '/' operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. Div(value1 *Variant, value2 *Variant) (*Variant, error) // Performs '%' operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. Mod(value1 *Variant, value2 *Variant) (*Variant, error) // Performs '^' operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. Pow(value1 *Variant, value2 *Variant) (*Variant, error) // Performs AND operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. And(value1 *Variant, value2 *Variant) (*Variant, error) // Performs OR operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. Or(value1 *Variant, value2 *Variant) (*Variant, error) // Performs XOR operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. Xor(value1 *Variant, value2 *Variant) (*Variant, error) // Performs << operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. Lsh(value1 *Variant, value2 *Variant) (*Variant, error) // Performs >> operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. Rsh(value1 *Variant, value2 *Variant) (*Variant, error) // Performs NOT operation for a variant. // // Parameters: // - value: The operand for this operation. // Returns: A result variant object. Not(value *Variant) (*Variant, error) // Performs unary '-' operation for a variant. // // Parameters: // - value: The operand for this operation. // Returns: A result variant object. Negative(value *Variant) (*Variant, error) // Performs '=' operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. Equal(value1 *Variant, value2 *Variant) (*Variant, error) // Performs '<>' operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. NotEqual(value1 *Variant, value2 *Variant) (*Variant, error) // Performs '>' operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. More(value1 *Variant, value2 *Variant) (*Variant, error) // Performs '<' operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. Less(value1 *Variant, value2 *Variant) (*Variant, error) // Performs '>=' operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. MoreEqual(value1 *Variant, value2 *Variant) (*Variant, error) // Performs '<=' operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. LessEqual(value1 *Variant, value2 *Variant) (*Variant, error) // Performs IN operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. In(value1 *Variant, value2 *Variant) (*Variant, error) // Performs [] operation for two variants. // // Parameters: // - value1: The first operand for this operation. // - value2: The second operand for this operation. // Returns: A result variant object. GetElement(value1 *Variant, value2 *Variant) (*Variant, error) }
Defines an interface for variant operations manager.
type TypeSafeVariantOperations ¶
type TypeSafeVariantOperations struct {
AbstractVariantOperations
}
Implements a strongly typed (type safe) variant operations manager object.
func NewTypeSafeVariantOperations ¶
func NewTypeSafeVariantOperations() *TypeSafeVariantOperations
func (*TypeSafeVariantOperations) Convert ¶
func (c *TypeSafeVariantOperations) Convert( value *Variant, newType int) (*Variant, error)
Converts variant to specified type
Parameters:
- value: A variant value to be converted.
- newType: A type of object to be returned.
Returns: A converted Variant value.
type TypeUnsafeVariantOperations ¶
type TypeUnsafeVariantOperations struct {
AbstractVariantOperations
}
Implements a type unsafe variant operations manager object.
func NewTypeUnsafeVariantOperations ¶
func NewTypeUnsafeVariantOperations() *TypeUnsafeVariantOperations
func (*TypeUnsafeVariantOperations) Convert ¶
func (c *TypeUnsafeVariantOperations) Convert( value *Variant, newType int) (*Variant, error)
Converts variant to specified type
Parameters:
- value: A variant value to be converted.
- newType: A type of object to be returned.
Returns: A converted Variant value.
type Variant ¶
type Variant struct {
// contains filtered or unexported fields
}
Defines container for variant values.
var Empty *Variant = EmptyVariant()
Empty variant constant
func NewVariant ¶
func NewVariant(value interface{}) *Variant
Constructs this class and assignes a value.
Params:
- value: another variant value.
func VariantFromArray ¶
Creates a new variant from Array value.
Params:
- value: a variant value.
Rturns: A created variant object
func VariantFromBoolean ¶
Creates a new variant from Boolean value.
Params:
- value: a variant value.
Returns: A created variant object
func VariantFromDateTime ¶
Creates a new variant from DateTime value.
Params:
- value: a variant value.
Returns: A created variant object
func VariantFromDouble ¶
Creates a new variant from Double value.
Params:
- value: a variant value.
Returns: A created variant object
func VariantFromFloat ¶
Creates a new variant from Float value.
Params:
- value: a variant value.
Returns: A created variant object
func VariantFromInteger ¶
Creates a new variant from Integer value.
Params:
- value: a variant value.
Returns: A created variant object
func VariantFromLong ¶
Creates a new variant from Long value.
Params:
- value: a variant value.
Returns: A created variant object
func VariantFromObject ¶
func VariantFromObject(value interface{}) *Variant
Creates a new variant from Object value.
Params:
- value: a variant value.
Rturns: A created variant object
func VariantFromString ¶
Creates a new variant from String value.
Params:
- value: a variant value.
Returns: A created variant object
func VariantFromTimeSpan ¶
Creates a new variant from TimeSpan value.
Params:
- value: a variant value.
Rturns: A created variant object
func (*Variant) AsDateTime ¶
Gets variant value as DateTime
func (*Variant) AsTimeSpan ¶
Gets variant value as TimeSpan
func (*Variant) Assign ¶
Assignes a new value to this object. Parameters:
- value A new value to be assigned.
func (*Variant) Clear ¶
func (c *Variant) Clear()
Clears this object and assignes a VariantType.Null type.
func (*Variant) Equals ¶
Compares this object to the specified one.
Parameters:
- obj An object to be compared.
Returns <code>true</code> if objects are equal.
func (*Variant) GetByIndex ¶
Gets an array element by its index.
Parameters:
- index an element index
Returns a requested array element
func (*Variant) IsEmpty ¶
Checks is this variant value empty. Returns <code>true</code< is this variant value is empty.
func (*Variant) IsNull ¶
Checks is this variant value Null.
Returns <code>true</code> if this variant value is Null.
func (*Variant) SetAsArray ¶
Sets variant value as variant array
Parameters:
- value a value to be set
func (*Variant) SetAsObject ¶
func (c *Variant) SetAsObject(value interface{})
Sets variant value as object
Parameters:
- value a value to be set
func (*Variant) SetByIndex ¶
Sets an array element by its index.
Parameters:
- index an element index
- element an element value