PutOption

指定された名前に基づいてオプション プロパティに値を設定します。指定された名前のエンティティに既存の値がある場合、その値は上書きされます。オプション プロパティはサービス固有の実行時オプションです。

構文

ASCII バージョン
int putOption(Message* message,const char* name,
const char* value) 
Unicode バージョン
int putOption(Message* message,const UChar* name,
const UChar* value) 

パラメータ

  • Message - この関数で操作するメッセージ。
  • Name - 指定された値を関連付ける名前。
  • Value - 指定された名前に関連付ける値。

結果

0 (正常終了) またはエラー コードを返します。

ASCII バージョン
int nRet;
Message* message = createMessage();
nRet = putOption( message, "OutputCasing", "M"); 
Unicode バージョン
int nRet; 
Message* message; 
// construct 16-bit string 
UChar option[32]; 
char* optionString="OutputCasing"; 

UChar optionValue[32]; 
char* optionValueString="M"; 

u_charsToUChars(optionString,	option,	strlen(optionString)); 
option[ strlen(optionString)]=0; 

u_charsToUChars(optionValueString,	optionValue, 
strlen(optionValueString)); 
optionValue [ strlen(optionValueString)]=0;	

message = createMessage(); 
nRet = putOption( message,	option, optionValue);