cpiSetElementValue

목적

지정된 요소의 값을 설정하는 선택적 함수. 구문 요소의 값이 설정될 때 브로커가 호출합니다. 이를 통해 사용자 정의 구문 분석기가 요소 값을 설정하는 작동을 대체할 수 있습니다.

정의 대상 유형 구성원
CPI_VFT 선택 사항 iFpSetElementValue

구문

void cpiSetElementValue(
    CciParser*      parser,
    CciElement*       currentElement,
    CciElementValue*  value);

매개변수

parser
구문 분석기 오브젝트의 주소(입력).
currentElement
현재 구문 요소의 주소(입력).
value
값(입력).

리턴 값

없음

샘플

다음 예는 샘플 구문 분석기 파일 BipSampPluginParser.c에서 발췌한 것입니다(675 - 698행).

void cpiSetElementValue(
    CciParser*      parser,
    CciElement*      element,
    CciElementValue* value
){
    CciElement*        newElement;
    int                rc;

    if ((cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_VALUE) ||
            (cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_NAME_VALUE)) {
        cpiSetElementValueValue(&rc, element, value);
  }
    else if (cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_NAME) {
        /* Create a new value element, add as a first child, and set the value */
            newElement = cpiCreateElement(&rc, parser);
        cpiSetElementType(&rc, newElement, CCI_ELEMENT_TYPE_VALUE);
        cpiSetElementValueValue(&rc, newElement, value);
        cpiAddAsFirstChild(&rc, element, newElement);
  }
  else {
  }

    return;
}
관련 개념
사용자 정의 구문 분석기
사용자 정의 확장 구성요소
관련 태스크
C로 구문 분석기 작성
관련 참조
cpiElementValue
C 구문 분석기 구현 함수
주의사항 | 등록상표 | 다운로드 | 라이브러리 | 지원 | 피드백
Copyright IBM Corporation 1999, 2006 마지막 갱신 날짜: 2006/08/21
as08190_