|
constexpr | Uri () noexcept |
| デフォルトコンストラクタです。オブジェクトを初期化します。
|
|
bool | Parse (const char *first, const char *last) noexcept |
| URI文字列をパースします。 [詳解]
|
|
bool | Parse (const char *str) noexcept |
| Parse(str, str + strlen(str)) を返します。
|
|
bool | SetUri (const char *scheme, const char *userinfo, const char *host, const char *port, const char *path, const char *query, const char *fragment) noexcept |
| URIの各部分を設定します。 [詳解]
|
|
bool | IsAbsolute () const noexcept |
| URIが絶対URIであればtrue を返します。この関数ではschemeが指定されていれば絶対URIであると判断しています。
|
|
bool | ComposeString (char *buf, size_t size) const noexcept |
| URI文字列を書き出します。 [詳解]
|
|
template<size_t N> |
bool | ComposeString (char(&buf)[N]) const noexcept |
| URI文字列を書き出します。 [詳解]
|
|
bool | AddBaseUri (const Uri &relative, const Uri &base) noexcept |
| 相対パスを解決します。 [詳解]
|
|
const char * | GetScheme () const noexcept |
| URIのスキーム(http, file等)の文字列を返します。 [詳解]
|
|
const char * | GetUserInfo () const noexcept |
| 指定した URI に関連付けられているユーザー名、パスワードなどのユーザー固有の情報を取得します。 [詳解]
|
|
const char * | GetHost () const noexcept |
| ホスト名を取得します。 [詳解]
|
|
const char * | GetPort () const noexcept |
| ポート番号の文字列を取得します。 [詳解]
|
|
int | GetPortNumber () const noexcept |
| ポート番号を取得します。ポート番号の文字列が設定されていてint型へ変換可能な場合は非負の整数を返し、それ以外の場合は-1を返します。
|
|
const char * | GetPath () const noexcept |
| パスを取得します。 [詳解]
|
|
const char * | GetQuery () const noexcept |
| クエリ文字列を取得します [詳解]
|
|
const char * | GetFragment () const noexcept |
| フラグメント文字列を取得します [詳解]
|
|
bool | SetScheme (const char *first, const char *last) noexcept |
| スキームの文字列(末尾の:は含まない)を設定します。
|
|
bool | SetUserInfo (const char *first, const char *last) noexcept |
| 指定した URI に関連付けられているユーザー名、パスワードなどのユーザー固有の情報を設定します。
|
|
bool | SetHost (const char *first, const char *last) noexcept |
| ホスト名を設定します。
|
|
bool | SetPort (const char *first, const char *last) noexcept |
| ポート番号の文字列(:は含まない)を設定します。
|
|
bool | SetPath (const char *first, const char *last) noexcept |
| パスを設定します。
|
|
bool | SetQuery (const char *first, const char *last) noexcept |
| クエリ文字列(先頭の?は含まない)を設定します。
|
|
bool | SetFragment (const char *first, const char *last) noexcept |
| フラグメント文字列(先頭の::は含まない)を設定します。
|
|
bool | SetScheme (const char *scheme) noexcept |
| スキームの文字列(末尾の:は含まない)を設定します。
|
|
bool | SetUserInfo (const char *userinfo) noexcept |
| 指定した URI に関連付けられているユーザー名、パスワードなどのユーザー固有の情報を設定します。
|
|
bool | SetHost (const char *host) noexcept |
| ホスト名を設定します。
|
|
bool | SetPort (const char *port) noexcept |
| ポート番号の文字列(:は含まない)を設定します。
|
|
bool | SetPortNumber (int port) noexcept |
| ポート番号を設定します。
|
|
bool | SetPath (const char *path) noexcept |
| パスを設定します。
|
|
bool | SetQuery (const char *query) noexcept |
| クエリ文字列(先頭の?は含まない)を設定します。
|
|
bool | SetFragment (const char *fragment) noexcept |
| フラグメント文字列(先頭の::は含まない)を設定します。
|
|
template<size_t N> |
bool | SetQuery (const UriQueryEncoder< N > &encoder) noexcept |
| クエリ文字列(先頭の?は含まない)を設定します。
|
|
void | Reset () noexcept |
| オブジェクトを初期化(リセット)します。
|
|
Error | GetError () const noexcept |
| エラーが発生した場合に詳細な理由を取得することができます。
|
|
|
static bool | IsHostName (const nlib_utf8_t *first, const nlib_utf8_t *last) noexcept |
| 文字列がホスト名の要件(RFC1034 3.1)を満たすかどうかを判定します。 [詳解]
|
|
static bool | IsHostName (const nlib_utf8_t *str) noexcept |
| IsHostName(str, str + strlen(str)) を返します。
|
|
static bool | IsIpv4 (const nlib_utf8_t *first, const nlib_utf8_t *last) noexcept |
| 文字列がIPv4の要件を満たすかどうかを判定します。 [詳解]
|
|
static bool | IsIpv4 (const nlib_utf8_t *str) noexcept |
| IsIpv4(str, str + strlen(str)) を返します。
|
|
static bool | IsIpv6 (const nlib_utf8_t *first, const nlib_utf8_t *last) noexcept |
| 文字列がIPv6の要件を満たすかどうかを判定します。 [詳解]
|
|
static bool | IsIpv6 (const nlib_utf8_t *str) noexcept |
| IsIpv6(str, str + strlen(str)) を返します。
|
|
static bool | IsEmailAddress (const nlib_utf8_t *first, const nlib_utf8_t *last) noexcept |
| 文字列がemailアドレスの要件(RFC5322 3.4)を満たすかどうかを判定します [詳解]
|
|
static bool | IsEmailAddress (const nlib_utf8_t *str) noexcept |
| IsEmailAddress(str, str + strlen(str)) を返します。
|
|
static bool | IsUri (const nlib_utf8_t *first, const nlib_utf8_t *last) noexcept |
| 文字列がURIであるかどうかを判定します。相対パスの場合、URIではなくURI参照となることに注意してください。 [詳解]
|
|
static bool | IsUri (const nlib_utf8_t *str) noexcept |
| IsUri(str, str + strlen(str)) を返します。
|
|
static bool | IsUriReference (const nlib_utf8_t *first, const nlib_utf8_t *last) noexcept |
| 文字列がURI参照であるかどうかを判定します。 [詳解]
|
|
static bool | IsUriReference (const nlib_utf8_t *str) noexcept |
| IsUriReference(str, str + strlen(str)) を返します。
|
|
static bool | IsReserved (int c) noexcept |
| c がRFC3986のReserved Characters であればtrue を返します。
|
|
static bool | IsUnreserved (int c) noexcept |
| c がRFC3986のUnreserved Characters であればtrue を返します。
|
|
static bool | IsHexDigit (int c) noexcept |
| 16進数の数値であればtrue を返します。
|
|
static errno_t | DecodeUriComponent (size_t *written, char *buf, size_t n, const char *first, const char *last) noexcept |
| % エンコードされた文字列をデコードします。 [詳解]
|
|
template<size_t N> |
static errno_t | DecodeUriComponent (size_t *written, char(&buf)[N], const char *s) noexcept |
| DecodeUriComponent(written, buf, N, s) を呼び出します。
|
|
static errno_t | DecodeUriComponent (size_t *written, char *buf, size_t n, const char *s) noexcept |
| % エンコードされた文字列をデコードします。 [詳解]
|
|
template<size_t N> |
static errno_t | DecodeUriComponent (size_t *written, char(&buf)[N], const char *first, const char *last) noexcept |
| DecodeUriComponent(written, buf, N, first, last) を呼び出します。
|
|
static errno_t | EncodeUriComponent (size_t *written, char *buf, size_t n, const char *first, const char *last, bool fragment_mode) noexcept |
| 文字列を% エンコードします。 [詳解]
|
|
template<size_t N> |
static errno_t | EncodeUriComponent (size_t *written, char(&buf)[N], const char *first, const char *last, bool fragment_mode) noexcept |
| EncodeUriComponent(written, buf, N, first, last, fragment_mode) を呼び出します。
|
|
static errno_t | EncodeUriComponent (size_t *written, char *buf, size_t n, const char *s, bool fragment_mode) noexcept |
| 文字列を% エンコードします。 [詳解]
|
|
template<size_t N> |
static errno_t | EncodeUriComponent (size_t *written, char(&buf)[N], const char *s, bool fragment_mode) noexcept |
| EncodeUriComponent(written, buf, N, s, fragment_mode) を呼び出します。
|
|
static errno_t | DecodePath (size_t *written, char *buf, size_t n, const char *s) noexcept |
| % エンコードされた文字列をデコードします。 デコードされた文字が'/'の場合にEILSEQ を返すこと以外は、DecodeUriComponent() と同じです。
|
|
template<size_t N> |
static errno_t | DecodePath (size_t *written, char(&buf)[N], const char *s) noexcept |
| DecodePath(written, buf, N, s) を呼び出します。
|
|
static errno_t | EncodePath (size_t *written, char *buf, size_t n, const char *s) noexcept |
| 文字列を% エンコードします。'/'を% エンコードしないこと以外は、EncodeUriComponent() と同じです。
|
|
template<size_t N> |
static errno_t | EncodePath (size_t *written, char(&buf)[N], const char *s) noexcept |
| EncodePath(written, buf, N, s) を呼び出します。
|
|
一般的なURIをパースしたり構築したりするためのクラスです。
- 説明
HttpStyleUri
, FileStyleUri
はこのクラスを利用してURIをパースしています。
- 相対URI(相対パス)を利用する場合にもこのクラスを用います。 パースする際には、
%
エンコードされた文字の一部をデコードします。 デコードされる文字は、RFC3986のunreserved(ALPHA / DIGIT / "-" / "." / "_" / "~")
に属する文字です。 それ以外の文字は%
エンコードされたままです。 uri.Parse("http://www.example.com/dir/index.html?query=test#part1");
uri.GetScheme();
uri.GetHost();
uri.GetPath();
uri.GetQuery();
uri.GetFragment();
- 参照
- https://www.ietf.org/rfc/rfc3986.txt (RFC 3986)
-
http://www.eonet.ne.jp/~h-hash/rfc_ja/rfc3986.ja.html (RFC 3986, in Japanese)
- 各種例:
- misc/uri/uri.cpp.
Uri.h の 51 行目に定義があります。