aardio 文档

web.layout.valueObject 库模块帮助文档

web.layout 成员列表 #

web.layout.valueObject() #

返回对象:webLayoutValueObject

web.layout.valueObject(初始值,单位,类型) #

创建并返回动态值类型,
所有参数可选

web.layout.valueObjectLite() #

无GC值对象,避免自动释放,

返回对象:webLayoutValueObject

webLayoutValueObject 成员列表 #

webLayoutValueObject.addRef() #

添加引用计数

webLayoutValueObject.clear() #

清空值

webLayoutValueObject.clone() #

复制值

返回对象:webLayoutValueObject

webLayoutValueObject.enum(枚举函数) #

webLayoutValueObject.enum(   
    function(k,v ){  
        io.print( k,v )   
    }  
)

webLayoutValueObject.getBinary() #

返回 buffer 类型字节数组
零长度数组返回 null

webLayoutValueObject.getEle() #

返回节点对象,
注意:节点类型只能读取不能写入

webLayoutValueObject.getInt32() #

返回整型数值
如果值类型不是整型值,取值返回空

webLayoutValueObject.getItem() #

返回对象:webLayoutValueObject

webLayoutValueObject.getItem(索引) #

获取成员

webLayoutValueObject.getLong64() #

返回长整型数值
如果值类型不是长整型数值,取值返回空

webLayoutValueObject.getNumber() #

返回浮点数值
如果值类型不是浮点数,取值返回空
使用 tonumber() 函数可强制返回数值

webLayoutValueObject.getString() #

返回字符串值
如果值类型字符串值,取值返回空
使用 tostring() 函数可强制返回数值

webLayoutValueObject.getTime() #

返回时间值
如果值类型不是时间值,取值返回空

webLayoutValueObject.getType() #

返回值类型 HL_T 前缀常量表示

webLayoutValueObject.getValue() #

返回字符串值、数值、时间值

webLayoutValueObject.isArray() #

是否数组对象

webLayoutValueObject.isDomObject() #

是否节点对象,
使用 getEle()函数转换为节点对象

webLayoutValueObject.isMap() #

是否键值表对象

webLayoutValueObject.jsonParse('{ k:"v" }') #

解析JSON字符串

webLayoutValueObject.jsonStringify() #

转换并返回JSON字符串

webLayoutValueObject.length #

数组长度

webLayoutValueObject.parse("10pt") #

解析字符串

webLayoutValueObject.setBinary(buffer,len) #

设置二进制字节数组,
如果参数@1是buffer、字符串,可选用参数@2指定长度,
如果参数@1是指针,则必须指定长度

webLayoutValueObject.setInt32(数值) #

写入整型数值

webLayoutValueObject.setItem(索引,值) #

设置成员值

webLayoutValueObject.setLong64(数值) #

写入长整型数值

webLayoutValueObject.setNumber(数值) #

写入浮点数值

webLayoutValueObject.setString(字符串值) #

写入字符串值

webLayoutValueObject.setTime(时间值) #

写入时间值

webLayoutValueObject.setValue(值,单位,类型) #

写入字符串值、数值、时间值
参数2,参数3为可选参数

webLayoutValueObject.stringify() #

转换并返回字符串

webLayoutValueObject.value #

读取或写入字符串值、数值、时间值

自动完成常量

_HL_CVT_JSON_LITERAL=1
_HL_CVT_JSON_MAP=2
_HL_CVT_SIMPLE=0

Markdown 格式