cpiElementValue group

用途

取出指定语法元素的值的函数。

语法

CciSize cpiElementBitArrayValue(
    int*                returnCode,
    CciElement*               targetElement,
    const struct CciBitArray* value);
CciBool cpiElementBooleanValue(
    int*                returnCode,
    CciElement*    targetElement);
CciSize cpiElementByteArrayValue(
    int*                returnCode,
    CciElement*               targetElement,
    const struct CciByteArray* value);
CciSize cpiElementCharacterValue(
    int*                returnCode,
    CciElement*               targetElement,
    const CciChar*             value,
    CciSize                    length);
struct CciDate cpiElementDateValue(
    int*                returnCode,
    CciElement*    targetElement);
CciSize cpiElementDecimalValue(
    int*                returnCode,
    CciElement*               targetElement,
    const CciChar*             value,
    CciSize                    length);
struct CciTimestamp cpiElementGmtTimestampValue(
    int*                returnCode,
    CciElement*    targetElement);
struct CciTime cpiElementGmtTimeValue(
    int*                returnCode,
    CciElement*    targetElement);
CciInt cpiElementIntegerValue(
    int*                returnCode,
    CciElement*    targetElement);
CciReal cpiElementRealValue(
    int*                returnCode,
    CciElement*    targetElement);
struct CciTimestamp cpiElementTimestampValue(
    int*                returnCode,
    CciElement*    targetElement);
struct CciTime cpiElementTimeValue(
    int*                returnCode,
    CciElement*    targetElement);

参数

returnCode
接收来自函数(输出)的返回码。
可能的返回码是:
  • CCI_SUCCESS
  • CCI_EXCEPTION
  • CCI_INV_ELEMENT_OBJECT
  • CCI_INV_DATA_POINTER
  • CCI_INV_DATA_BUFLEN
  • CCI_INV_BUFFER_TOO_SMALL
targetElement
指定目标语法元素对象(输入)的地址。
value
存储语法元素的值的输出缓冲区的地址(输入)。仅用于相关函数调用。
length
输出缓冲区的长度(以字符为单位),由 value 参数指定(输入)。仅用于相关函数调用。

返回值

返回元素值。

在某些情况下,例如,cpiElementCharacterValuecpiElementDecimalValue,如果缓冲区不够大以接收数据,则数据不会写入缓冲区。必需缓冲区大小作为返回值传递,且 returnCode 设置为 CCI_BUFFER_TOO_SMALL。

如果发生错误,则 returnCode 表明错误原因。

相关概念
用户定义的解析器
用户定义的扩展
相关任务
使用 C 创建解析器
相关参考
cpiElementName
cpiElementType
cpiElementValueValue
C 解析器实用程序函数
声明 | 商标 | 下载 | 书库 | 支持 | 反馈
Copyright IBM Corporation 1999, 2006 最后一次更新时间:2006/08/14
as08450_