GetContext
メッセージのコンテキスト セッションに指定された名前のコンテキスト エンティティから値を取得します。"コンテキスト" エンティティには、アカウント ID、アカウント パスワード、サービス名、サービス メソッドなどがあります。
構文
const char* getContext(Message* message,const char* name)
const UChar * getContext(Message* message,const UChar* name)
パラメータ
- Message - この関数で操作するメッセージ。
- Name - 関連付けられた値を返す名前。
結果
コンテキスト エンティティにある名前の値を返します。名前が存在しない場合、空白の文字列を返します。
例
const char* value = getContext(message, "account.id");
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);