cpiElementValueValue

目的

指定した構文エレメントから値オブジェクトを取得します。 この値オブジェクトは隠されており、参照することはできません。 これを使用して、タイプが分からなくても、 cpiSetElementValueValue 関数を使用することによって、 あるエレメントの値を別のエレメントから設定または導出することができます。 これは、パーサーが使用して、 インプリメンテーション関数 cpiElementValue および cpiSetElementValue を呼び出すことによって、 動作を変更することができます。

構文

const CciElementValue* cpiElementValueValue(
  int*           returnCode,
  CciElement*  targetElement);

パラメーター

returnCode
関数からの戻りコードを受け取ります (出力)。
考えられる戻りコードは以下のとおりです。
  • CCI_SUCCESS
  • CCI_EXCEPTION
  • CCI_INV_ELEMENT_OBJECT
targetElement
ターゲットの構文エレメント・オブジェクトのアドレスを指定します (入力)。

戻り値

指定したターゲット構文エレメントに保管される CciElementValue オブジェクトのアドレスが戻されます。 エラーが発生した場合は、ゼロ (CCI_NULL_ADDR) が戻され、returnCode がエラーの理由を示します。

サンプル

この例は、サンプル・パーサー・ファイル BipSampPluginParser.c から取られています (705 行から 725 行)。

const CciElementValue* cpiElementValue(
  CciParser*     parser,
  CciElement* element
){
  CciElement* firstChild;
  const CciElementValue* value;
  int         rc;

  if ((cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_VALUE) ||
      (cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_NAME_VALUE)) {
    value = cpiElementValueValue(&rc, element);
  }
  else if (cpiElementType(&rc, element) == CCI_ELEMENT_TYPE_NAME) {
    firstChild = cniFirstChild(&rc, element);
    value = cpiElementValueValue(&rc, firstChild);
  }
  else {
  }

  return(value);
}
関連概念
ユーザー定義のパーサー
ユーザー定義拡張機能
関連タスク
C でのパーサーの作成
関連資料
cpiElementName
cpiElementType
cpiElementValue グループ
C パーサー・ユーティリティー関数
特記事項 | 商標 | ダウンロード | ライブラリー | サポート | フィードバック
Copyright IBM Corporation 1999, 2006 最終更新: 08/21/2006
as08460_