バージョンごとのドキュメント一覧

55.6. メッセージのデータ型 #

<title>Message Data Types</title>

This section describes the base data types used in messages. 本節ではメッセージの中で使われる基本的なデータ型を説明します。

Intn(i)

An <replaceable>n</replaceable>-bit integer in network byte order (most significant byte first). If <replaceable>i</replaceable> is specified it is the exact value that will appear, otherwise the value is variable. Eg. Int16, Int32(42). ネットワークバイト順(最上位バイトが先頭)におけるnビットの整数。 もしiが指定されていれば、それがそのまま使われます。 さもなければ変数です。 例えばInt16、Int32(42)などです。

Intn[k]

An array of <replaceable>k</replaceable> <replaceable>n</replaceable>-bit integers, each in network byte order. The array length <replaceable>k</replaceable> is always determined by an earlier field in the message. Eg. Int16[M]. nビット整数の要素数kの配列で、それぞれはネットワークバイト順です。 配列サイズkは常にメッセージの前のフィールドで決定されます。 例えばInt16[M]です。

String(s)

A null-terminated string (C-style string). There is no specific length limitation on strings. If <replaceable>s</replaceable> is specified it is the exact value that will appear, otherwise the value is variable. Eg. String, String("user"). NULL終端文字列(C様式文字列)。文字列には長さ制限の指定はありません。 sが指定されていれば、それがそのまま使われます。 さもなければ値は変数です。 例えばString、String("user")などです。

注記

<emphasis>There is no predefined limit</emphasis> on the length of a string that can be returned by the backend. Good coding strategy for a frontend is to use an expandable buffer so that anything that fits in memory can be accepted. If that's not feasible, read the full string and discard trailing characters that don't fit into your fixed-size buffer. バックエンドから返すことができる文字列の長さには事前に定義された制限はありません。 フロントエンドではメモリに収まるものはすべて受け入れられるように拡張可能なバッファを使用するコーディング戦略を勧めます。 これが実行できないのであれば、文字列全体を読み取り、固定長バッファに合わない後の方の文字を破棄してください。

Byten(c)

Exactly <replaceable>n</replaceable> bytes. If the field width <replaceable>n</replaceable> is not a constant, it is always determinable from an earlier field in the message. If <replaceable>c</replaceable> is specified it is the exact value. Eg. Byte2, Byte1('\n'). 厳密にnバイト。 フィールド幅nが定数でない場合、メッセージの前のフィールドから決定されます。 cが指定されていれば、それがそのまま使われます。 例えば Byte2、Byte1('\n')などです。