nlib
|
http/httpsスキームを用いたURIをパースしたりURI文字列を構築したりするためのクラスです。 [詳解]
#include "nn/nlib/HttpStyleUri.h"
公開型 | |
typedef std::pair< const char *, const char * > | KeyValue |
クエリのキーと値を格納する型です。 | |
公開メンバ関数 | |
HttpStyleUri () noexcept | |
デフォルトコンストラクタです。オブジェクトを初期化します。 | |
bool | FromUri (const Uri &uri) noexcept |
Uri オブジェクトから変換します。 [詳解] | |
bool | ToUri (Uri *uri) const noexcept |
Uri オブジェクトに変換します。 [詳解] | |
bool | Parse (const char *str) noexcept |
URIをパースします。 [詳解] | |
bool | ComposeString (char *buf, size_t size) const noexcept |
URI文字列を書き出します。 [詳解] | |
template<size_t N> | |
bool | ComposeString (char(&buf)[N]) const noexcept |
ComposeString(buf, N) を呼び出します。 | |
bool | SetScheme (const char *scheme) noexcept |
スキームを設定します。 [詳解] | |
bool | SetUserInfo (const char *userinfo) noexcept |
ユーザー情報を設定します。 [詳解] | |
bool | SetHost (const char *host) noexcept |
ホスト名を設定します。% エンコードを施しておく必要はありません。 [詳解] | |
bool | SetPort (int port) noexcept |
ポート番号を設定します。 [詳解] | |
bool | SetPath (const char *path) noexcept |
パスを設定します。 [詳解] | |
bool | SetQuery (const char *query) noexcept |
クエリ文字列からクエリを設定します。 [詳解] | |
bool | SetFragment (const char *fragment) noexcept |
フラグメント文字列を設定します。 [詳解] | |
bool | AddQuery (const char *key, const char *value) noexcept |
クエリにキーと値を追加します。 [詳解] | |
const char * | GetScheme () const noexcept |
スキーム名を取得します。"http"か"https"のどちらかです。 [詳解] | |
const char * | GetUserInfo () const noexcept |
ユーザー情報を取得します。 [詳解] | |
const char * | GetHost () const noexcept |
ホスト名を取得します。 [詳解] | |
int | GetPort () const noexcept |
ポート番号を取得します。 [詳解] | |
size_t | GetNumSegment () const noexcept |
格納されているセグメントの数を取得します。 [詳解] | |
const char * | GetSegment (size_t i) const noexcept |
インデックスを指定してセグメントを取得します。 [詳解] | |
bool | IsPathDirectory () const noexcept |
パスがディレクトリ形式かどうかを取得します。 [詳解] | |
const char * | GetQueryValue (const char *key) const noexcept |
キーを指定して値を取得します。見つからなかった場合はNULL を返します。 [詳解] | |
size_t | GetNumQuery () const noexcept |
キーに対応する値を取得します。見つからなかった場合はNULL を返します。 [詳解] | |
const KeyValue * | GetQueryKeyValue (size_t i) const noexcept |
インデックスを指定してキーと値のペアを取得します。見つからなかった場合はNULL を返します。 [詳解] | |
const char * | GetFragment () const noexcept |
フラグメント文字列を取得します。 [詳解] | |
bool | AddBaseUri (const Uri &relative, const HttpStyleUri &base) noexcept |
相対パスを基底URIを用いて解決します。 [詳解] | |
void | Reset () noexcept |
オブジェクトを初期化(リセット)します。 | |
http/httpsスキームを用いたURIをパースしたりURI文字列を構築したりするためのクラスです。
/test/../../../a/b/c
のようなパスは/a/b/c
のように正規化されてから各セグメントに分割されて格納されます(/../は/とみなされる)。 各セグメント内の%
エンコードされた文字はデコードされています。 %
エンコードされた文字はデコードされています。 HttpStyleUri.h の 13 行目に定義があります。
|
noexcept |
相対パスを基底URIを用いて解決します。
[in] | relative | 相対パス |
[in] | base | 基底URI |
true
|
inlinenoexcept |
クエリにキーと値を追加します。
[in] | key | キー |
[in] | value | 値 |
true
%
エンコードされている必要はありません。 HttpStyleUri.h の 34 行目に定義があります。
|
noexcept |
URI文字列を書き出します。
[out] | buf | 文字列が書きだされるバッファへのポインタ |
[in] | size | バッファサイズ |
true
ToUri()
とUri::ComposeString()
を利用しています。
|
noexcept |
|
inlinenoexcept |
フラグメント文字列を取得します。
NULL
ポインタや空文字列を返す可能性があります。若干意味合いが異なります。 NULL
(http://example.com/) HttpStyleUri.h の 59 行目に定義があります。
|
inlinenoexcept |
|
inlinenoexcept |
キーに対応する値を取得します。見つからなかった場合はNULL
を返します。
HttpStyleUri.h の 55 行目に定義があります。
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
インデックスを指定してキーと値のペアを取得します。見つからなかった場合はNULL
を返します。
[in] | i | インデックス |
NULL
や空文字列である可能性があります。 これは以下のようにクエリ文字列の細かい違いを反映しています。 key
= NULL
, value
= NULL
です。 key
="", value
="" です。 HttpStyleUri.h の 56 行目に定義があります。
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
インデックスを指定してセグメントを取得します。
[in] | i | セグメントのインデックス |
NULL
を返します。 セグメント文字列はデコードされています。 HttpStyleUri.h の 46 行目に定義があります。
|
inlinenoexcept |
|
inlinenoexcept |
パスがディレクトリ形式かどうかを取得します。
true
HttpStyleUri.h の 49 行目に定義があります。
|
noexcept |
URIをパースします。
[in] | str | URI文字列 |
true
を返します。
|
noexcept |
フラグメント文字列を設定します。
[in] | fragment | フラグメント文字列 |
true
%
エンコードされている必要はありません。
|
noexcept |
ホスト名を設定します。%
エンコードを施しておく必要はありません。
[in] | host | ホスト名 |
true
|
noexcept |
パスを設定します。
[in] | path | パス文字列 |
true
%
エンコードを施しておく必要はありません('/'を除く)。
|
noexcept |
ポート番号を設定します。
[in] | port | ポート番号 |
true
|
inlinenoexcept |
クエリ文字列からクエリを設定します。
[in] | query | クエリ文字列 |
true
%
エンコードされている必要はありません('&'と'='を除く)。 HttpStyleUri.h の 32 行目に定義があります。
|
noexcept |
スキームを設定します。
[in] | scheme | スキーム("http"又は"https") |
true
|
noexcept |
ユーザー情報を設定します。
[in] | userinfo | ユーザー情報 |
true
|
noexcept |
© 2013, 2014, 2015 Nintendo Co., Ltd. All rights reserved.