GetContext

メッセージのコンテキスト セッションに指定された名前のコンテキスト エンティティから値を取得します。"コンテキスト" エンティティには、アカウント ID、アカウント パスワード、サービス名、サービス メソッドなどがあります。

構文

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

パラメータ

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

結果

コンテキスト エンティティにある名前の値を返します。名前が存在しない場合、空白の文字列を返します。

ASCII バージョン
const char* value = getContext(message, "account.id"); 
Unicode バージョン
UChar* value; 
// construct 16-bit string 
UChar accountID[32]; 
char* account="account.id"; 
u_charsToUChars(account,	accountID,	strlen(account)); 
accountID[ strlen(account)]=0;	
value = getContext(message,	accountID);