Sciter  3.3.2.5
Sciter API
Classes | Macros | Typedefs | Enumerations | Functions
value.h File Reference
#include "sciter-x-types.h"

Go to the source code of this file.

Classes

struct   VALUE
 

Macros

#define  FLOAT_VALUE   double
 

Typedefs

typedef VOID  NATIVE_FUNCTOR_INVOKE(VOID *tag, UINT argc, const VALUE *argv, VALUE *retval)
 
typedef VOID  NATIVE_FUNCTOR_RELEASE(VOID *tag)
 
typedef BOOL SC_CALLBACK  KeyValueCallback(LPVOID param, const VALUE *pkey, const VALUE *pval)
 

Enumerations

 
 
enum   VALUE_UNIT_TYPE {
  UT_EM = 1, UT_EX = 2, UT_PR = 3, UT_SP = 4,
  reserved1 = 5, reserved2 = 6, UT_PX = 7, UT_IN = 8,
  UT_CM = 9, UT_MM = 10, UT_PT = 11, UT_PC = 12,
  UT_DIP = 13, reserved3 = 14, UT_COLOR = 15, UT_URL = 16
}
 
enum   VALUE_UNIT_TYPE_DATE { DT_HAS_DATE = 0x01, DT_HAS_TIME = 0x02, DT_HAS_SECONDS = 0x04, DT_UTC = 0x10 }
 
 
 
 

Functions

UINT SCAPI  ValueInit (VALUE *pval)
 
UINT SCAPI  ValueClear (VALUE *pval)
 
UINT SCAPI  ValueCompare (const VALUE *pval1, const VALUE *pval2)
 
UINT SCAPI  ValueCopy (VALUE *pdst, const VALUE *psrc)
 
UINT SCAPI  ValueIsolate (VALUE *pdst)
 
UINT SCAPI  ValueType (const VALUE *pval, UINT *pType, UINT *pUnits)
 
UINT SCAPI  ValueStringData (const VALUE *pval, LPCWSTR *pChars, UINT *pNumChars)
 
UINT SCAPI  ValueStringDataSet (VALUE *pval, LPCWSTR chars, UINT numChars, UINT units)
 
UINT SCAPI  ValueIntData (const VALUE *pval, INT *pData)
 
UINT SCAPI  ValueIntDataSet (VALUE *pval, INT data, UINT type, UINT units)
 
UINT SCAPI  ValueInt64Data (const VALUE *pval, INT64 *pData)
 
UINT SCAPI  ValueInt64DataSet (VALUE *pval, INT64 data, UINT type, UINT units)
 
UINT SCAPI  ValueFloatData (const VALUE *pval, FLOAT_VALUE *pData)
 
UINT SCAPI  ValueFloatDataSet (VALUE *pval, FLOAT_VALUE data, UINT type, UINT units)
 
UINT SCAPI  ValueBinaryData (const VALUE *pval, LPCBYTE *pBytes, UINT *pnBytes)
 
UINT SCAPI  ValueBinaryDataSet (VALUE *pval, LPCBYTE pBytes, UINT nBytes, UINT type, UINT units)
 
UINT SCAPI  ValueElementsCount (const VALUE *pval, INT *pn)
 
UINT SCAPI  ValueNthElementValue (const VALUE *pval, INT n, VALUE *pretval)
 
UINT SCAPI  ValueNthElementValueSet (VALUE *pval, INT n, const VALUE *pval_to_set)
 
UINT SCAPI  ValueNthElementKey (const VALUE *pval, INT n, VALUE *pretval)
 
UINT SCAPI  ValueEnumElements (const VALUE *pval, KeyValueCallback *penum, LPVOID param)
 
UINT SCAPI  ValueSetValueToKey (VALUE *pval, const VALUE *pkey, const VALUE *pval_to_set)
 
UINT SCAPI  ValueGetValueOfKey (const VALUE *pval, const VALUE *pkey, VALUE *pretval)
 
UINT SCAPI  ValueToString (VALUE *pval, UINT how)
 
UINT SCAPI  ValueFromString (VALUE *pval, LPCWSTR str, UINT strLength, UINT how)
 
UINT SCAPI  ValueInvoke (const VALUE *pval, VALUE *pthis, UINT argc, const VALUE *argv, VALUE *pretval, LPCWSTR url)
 
UINT SCAPI  ValueNativeFunctorSet (VALUE *pval, NATIVE_FUNCTOR_INVOKE *pinvoke, NATIVE_FUNCTOR_RELEASE *prelease=NULL, VOID *tag=NULL)
 
BOOL SCAPI  ValueIsNativeFunctor (const VALUE *pval)
 

Macro Definition Documentation

#define FLOAT_VALUE   double

Definition at line 21 of file value.h.

Typedef Documentation

typedef BOOL SC_CALLBACK KeyValueCallback(LPVOID param, const VALUE *pkey, const VALUE *pval)

Callback function used with ValueEnumElements(). return TRUE to continue enumeration

Definition at line 212 of file value.h.

typedef VOID NATIVE_FUNCTOR_INVOKE(VOID *tag, UINT argc, const VALUE *argv, VALUE *retval)

Definition at line 91 of file value.h.

typedef VOID NATIVE_FUNCTOR_RELEASE(VOID *tag)

Definition at line 92 of file value.h.

Enumeration Type Documentation

Enumerator
HV_OK_TRUE 
HV_OK 
HV_BAD_PARAMETER 
HV_INCOMPATIBLE_TYPE 

Definition at line 6 of file value.h.

Enumerator
CVT_SIMPLE 

simple conversion of terminal values

CVT_JSON_LITERAL 

json literal parsing/emission

CVT_JSON_MAP 

json parsing/emission, it parses as if token '{' already recognized

CVT_XJSON_LITERAL 

x-json parsing/emission, date is emitted as ISO8601 date literal, currency is emitted in the form DDDD$CCC

Definition at line 245 of file value.h.

enum VALUE_TYPE
Enumerator
T_UNDEFINED 
T_NULL 
T_BOOL 
T_INT 
T_FLOAT 
T_STRING 
T_DATE 
T_CURRENCY 
T_LENGTH 
T_ARRAY 
T_MAP 
T_FUNCTION 
T_BYTES 
T_OBJECT 
T_DOM_OBJECT 

Definition at line 23 of file value.h.

Enumerator
UT_EM 
UT_EX 
UT_PR 
UT_SP 
reserved1 
reserved2 
UT_PX 
UT_IN 
UT_CM 
UT_MM 
UT_PT 
UT_PC 
UT_DIP 
reserved3 
UT_COLOR 
UT_URL 

Definition at line 42 of file value.h.

Enumerator
DT_HAS_DATE 
DT_HAS_TIME 
DT_HAS_SECONDS 
DT_UTC 

Definition at line 62 of file value.h.

Enumerator
UT_OBJECT_ARRAY 
UT_OBJECT_OBJECT 
UT_OBJECT_CLASS 
UT_OBJECT_NATIVE 
UT_OBJECT_FUNCTION 
UT_OBJECT_ERROR 

Definition at line 71 of file value.h.

Enumerator
UT_STRING_STRING 
UT_STRING_ERROR 
UT_STRING_SECURE 
UT_STRING_SYMBOL 

Definition at line 82 of file value.h.

Function Documentation

UINT SCAPI ValueBinaryData ( const VALUEpval,
LPCBYTEpBytes,
UINT *  pnBytes 
)
inline

ValueBinaryData - retreive integer data of T_BYTES type

Definition at line 587 of file sciter-x-api.h.

UINT SCAPI ValueBinaryDataSet ( VALUEpval,
LPCBYTE  pBytes,
UINT  nBytes,
UINT  type,
UINT  units 
)
inline

ValueBinaryDataSet - sets VALUE to sequence of bytes of type T_BYTES 'type' here must be set to T_BYTES. Optionally sets units field too. The function creates local copy of bytes in its own storage.

Definition at line 588 of file sciter-x-api.h.

UINT SCAPI ValueClear ( VALUEpval )
inline

ValueClear - clears the VALUE and deallocates all assosiated structures that are not used anywhere else.

Definition at line 574 of file sciter-x-api.h.

UINT SCAPI ValueCompare ( const VALUEpval1,
const VALUEpval2 
)
inline

ValueCompare - compares two values, returns HV_OK_TRUE if val1 == val2.

Definition at line 575 of file sciter-x-api.h.

UINT SCAPI ValueCopy ( VALUEpdst,
const VALUEpsrc 
)
inline

ValueCopy - copies src VALUE to dst VALUE. dst VALUE must be in ValueInit state.

Definition at line 576 of file sciter-x-api.h.

UINT SCAPI ValueElementsCount ( const VALUEpval,
INT *  pn 
)
inline

ValueElementsCount - retreive number of sub-elements for:

  • T_ARRAY - number of elements in the array;
  • T_MAP - number of key/value pairs in the map;
  • T_FUNCTION - number of arguments in the function;

Definition at line 589 of file sciter-x-api.h.

UINT SCAPI ValueEnumElements ( const VALUEpval,
KeyValueCallbackpenum,
LPVOID  param 
)
inline

Definition at line 593 of file sciter-x-api.h.

UINT SCAPI ValueFloatData ( const VALUEpval,
FLOAT_VALUEpData 
)
inline

ValueFloatData - retreive FLOAT_VALUE (double) data of T_FLOAT and T_LENGTH values.

Definition at line 585 of file sciter-x-api.h.

UINT SCAPI ValueFloatDataSet ( VALUEpval,
FLOAT_VALUE  data,
UINT  type,
UINT  units 
)
inline

ValueFloatDataSet - sets FLOAT_VALUE data of T_FLOAT and T_LENGTH values.

Definition at line 586 of file sciter-x-api.h.

UINT SCAPI ValueFromString ( VALUEpval,
LPCWSTR  str,
UINT  strLength,
UINT  how 
)
inline

ValueFromString - parses string into value:

  • CVT_SIMPLE - parse/emit terminal values (T_INT, T_FLOAT, T_LENGTH, T_STRING), "guess" non-strict parsing
  • CVT_JSON_LITERAL - parse/emit value using JSON literal rules: {}, [], "string", true, false, null
  • CVT_JSON_MAP - parse/emit MAP value without enclosing '{' and '}' brackets. Returns: Number of non-parsed characters in case of errors. Thus if string was parsed in full it returns 0 (success)

Definition at line 597 of file sciter-x-api.h.

UINT SCAPI ValueGetValueOfKey ( const VALUEpval,
const VALUEpkey,
VALUEpretval 
)
inline

ValueGetValueOfKey - retrieves value of sub-element by key:

  • T_MAP - value of key/value pair with the key;
  • T_FUNCTION - value of argument with the name key;
  • T_OBJECT (tiscript) - value of property of the object Otherwise *pretval will have T_UNDEFINED value.

Definition at line 595 of file sciter-x-api.h.

UINT SCAPI ValueInit ( VALUEpval )
inline

ValueInit - initialize VALUE storage This call has to be made before passing VALUE* to any other functions

Definition at line 573 of file sciter-x-api.h.

UINT SCAPI ValueInt64Data ( const VALUEpval,
INT64 *  pData 
)
inline

ValueInt64Data - retreive 64bit integer data of T_CURRENCY and T_DATE values.

Definition at line 583 of file sciter-x-api.h.

UINT SCAPI ValueInt64DataSet ( VALUEpval,
INT64  data,
UINT  type,
UINT  units 
)
inline

ValueInt64DataSet - sets 64bit integer data of T_CURRENCY and T_DATE values.

Definition at line 584 of file sciter-x-api.h.

UINT SCAPI ValueIntData ( const VALUEpval,
INT *  pData 
)
inline

ValueIntData - retreive integer data of T_INT, T_LENGTH and T_BOOL types

Definition at line 581 of file sciter-x-api.h.

UINT SCAPI ValueIntDataSet ( VALUEpval,
INT  data,
UINT  type,
UINT  units 
)
inline

ValueIntDataSet - sets VALUE integer data of T_INT and T_BOOL types Optionally sets units field too.

Definition at line 582 of file sciter-x-api.h.

UINT SCAPI ValueInvoke ( const VALUEpval,
VALUEpthis,
UINT  argc,
const VALUEargv,
VALUEpretval,
LPCWSTR  url 
)
inline

ValueInvoke - function invocation (Sciter/TIScript).

  • VALUE* pval is a value of type T_OBJECT/UT_OBJECT_FUNCTION
  • VALUE* pthis - object that will be known as 'this' inside that function.
  • UINT argc, const VALUE* argv - vector of arguments to pass to the function.
  • VALUE* pretval - parse/emit MAP value without enclosing '{' and '}' brackets.
  • LPCWSTR url - url or name of the script - used for error reporting in the script. Returns: HV_OK, HV_BAD_PARAMETER or HV_INCOMPATIBLE_TYPE

Definition at line 598 of file sciter-x-api.h.

BOOL SCAPI ValueIsNativeFunctor ( const VALUEpval )
inline

Definition at line 600 of file sciter-x-api.h.

UINT SCAPI ValueIsolate ( VALUEpdst )
inline

ValueIsolate - converts T_OBJECT value types to T_MAP or T_ARRAY. use this method if you need to pass values between different threads. The fanction is applicable for the Sciter

Definition at line 577 of file sciter-x-api.h.

UINT SCAPI ValueNativeFunctorSet ( VALUEpval,
NATIVE_FUNCTOR_INVOKEpinvoke,
NATIVE_FUNCTOR_RELEASEprelease = NULL,
VOID *  tag = NULL 
)
inline

ValueNativeFunctorSet - set reference to native function

  • VALUE* pval - value to be initialized
  • NATIVE_FUNCTOR_INVOKE* pinvoke - reference to native functor implementation.
  • NATIVE_FUNCTOR_RELEASE* prelease - reference to native functor dtor implementation.
  • VOID* tag - optional tag, passed as it is to pinvoke and prelease Returns: HV_OK, HV_BAD_PARAMETER

Definition at line 599 of file sciter-x-api.h.

UINT SCAPI ValueNthElementKey ( const VALUEpval,
INT  n,
VALUEpretval 
)
inline

ValueEnumElements - enumeartes key/value pairs of T_MAP, T_FUNCTION and T_OBJECT values

  • T_MAP - key of nth key/value pair in the map;
  • T_FUNCTION - name of nth argument of the function (if any);

Definition at line 592 of file sciter-x-api.h.

UINT SCAPI ValueNthElementValue ( const VALUEpval,
INT  n,
VALUEpretval 
)
inline

ValueNthElementValue - retreive value of sub-element at index n for:

  • T_ARRAY - nth element of the array;
  • T_MAP - value of nth key/value pair in the map;
  • T_FUNCTION - value of nth argument of the function;

Definition at line 590 of file sciter-x-api.h.

UINT SCAPI ValueNthElementValueSet ( VALUEpval,
INT  n,
const VALUEpval_to_set 
)
inline

ValueNthElementValueSet - sets value of sub-element at index n for:

  • T_ARRAY - nth element of the array;
  • T_MAP - value of nth key/value pair in the map;
  • T_FUNCTION - value of nth argument of the function; If the VALUE is not of one of types above then it makes it of type T_ARRAY with single element - 'val_to_set'.

Definition at line 591 of file sciter-x-api.h.

UINT SCAPI ValueSetValueToKey ( VALUEpval,
const VALUEpkey,
const VALUEpval_to_set 
)
inline

ValueSetValueToKey - sets value of sub-element by key:

  • T_MAP - value of key/value pair with the key;
  • T_FUNCTION - value of argument with the name key;
  • T_OBJECT (tiscript) - value of property of the object If the VALUE is not of one of types above then it makes it of type T_MAP with single pair - 'key'/'val_to_set'.

key usually is a value of type T_STRING

Definition at line 594 of file sciter-x-api.h.

UINT SCAPI ValueStringData ( const VALUEpval,
LPCWSTR *  pChars,
UINT *  pNumChars 
)
inline

ValueStringData - returns string data for T_STRING type For T_FUNCTION returns name of the fuction.

Definition at line 579 of file sciter-x-api.h.

UINT SCAPI ValueStringDataSet ( VALUEpval,
LPCWSTR  chars,
UINT  numChars,
UINT  units 
)
inline

ValueStringDataSet - sets VALUE to T_STRING type and copies chars/numChars to internal refcounted buffer assosiated with the value.

Definition at line 580 of file sciter-x-api.h.

UINT SCAPI ValueToString ( VALUEpval,
UINT  how 
)
inline

ValueToString - converts value to T_STRING inplace:

  • CVT_SIMPLE - parse/emit terminal values (T_INT, T_FLOAT, T_LENGTH, T_STRING)
  • CVT_JSON_LITERAL - parse/emit value using JSON literal rules: {}, [], "string", true, false, null
  • CVT_JSON_MAP - parse/emit MAP value without enclosing '{' and '}' brackets.

Definition at line 596 of file sciter-x-api.h.

UINT SCAPI ValueType ( const VALUEpval,
UINT *  pType,
UINT *  pUnits 
)
inline

ValueType - returns VALUE_TYPE and VALUE_UNIT_TYPE flags of the VALUE

Definition at line 578 of file sciter-x-api.h.

AltStyle によって変換されたページ (->オリジナル) /