![]() |
Btrieve 2
|
Btrieve コレクション クラス。 [詳解]
#include <btrieveCpp.h>
公開メンバ関数 | |
| BtrieveCollection () | |
| ~BtrieveCollection () | |
| Btrieve::StatusCode | Decrypt () |
| コレクションを復号します。 | |
| int | DocumentCreate (const char *json) |
| ドキュメントを作成します。 | |
| int | DocumentCreate (const char *json, const char *blob, int blobLength) |
| ドキュメントを作成します。 | |
| Btrieve::StatusCode | DocumentDelete (int id, int entityTag=-1) |
| ドキュメントを削除します。 | |
| Btrieve::StatusCode | DocumentRetrieve (int id, char *json=NULL, int jsonSize=0, char *blob=NULL, int blobSize=0, int documentBlobOffset=0, int documentBlobLength=0) |
| ドキュメントを取得します。 | |
| Btrieve::StatusCode | DocumentRetrieveBlob (int id, char *blob, int blobSize, int documentBlobOffset=0, int documentBlobLength=0) |
| ドキュメントの blob を取得します。 | |
| int | DocumentRetrieveEntityTag (int id) |
| ドキュメントのエンティティ タグを取得します。 | |
| const char * | DocumentRetrieveJson (int id) |
| ドキュメントの json を取得します。 | |
| const char * | DocumentRetrieveJson (int id, char *blob, int blobSize, int documentBlobOffset=0, int documentBlobLength=0) |
| ドキュメントの json を取得します。 | |
| Btrieve::StatusCode | DocumentUpdate (int id, const char *json) |
| ドキュメントを更新します。 | |
| Btrieve::StatusCode | DocumentUpdate (int id, const char *json, const char *blob, int blobLength) |
| ドキュメントを更新します。 | |
| Btrieve::StatusCode | DocumentUpdate (int id, int entityTag, const char *json) |
| ドキュメントを更新します。 | |
| Btrieve::StatusCode | DocumentUpdate (int id, int entityTag, const char *json, const char *blob, int blobLength) |
| ドキュメントを更新します。 | |
| Btrieve::StatusCode | Encrypt (const char *password, const char *passwordAgain) |
| コレクションを暗号化します。 | |
| Btrieve::StatusCode | GetLastStatusCode () |
| 最新のステータス コードを取得します。 | |
| Btrieve::StatusCode | Query (BtrieveDocumentSet *btrieveDocumentSet, const char *query=NULL) |
| コレクションを照会します。 | |
Btrieve コレクション クラス。
Btrieve コレクションは 0 個以上のドキュメントで構成されています。 各ドキュメントはラベルおよび JSON と、任意の BLOB で構成されます。 ラベルの最大長は、終端のヌルのバイトも含めて Btrieve::MAXIMUM_KEY_LENGTH バイトです。 JSON の最大長は Btrieve::MAXIMUM_RECORD_LENGTH バイトです。 BLOB の最大長は 2147483647 バイト(2 GiB - 1)です。
"_" または "$" で始まる JSON フィールド名は予約されています。 現在のところ、次の予約済み JSON フィールド名が定義されています。
| フィールド名 | ユーザー設定可能 | システム生成 | インデックス作成 | 重複許可 | 型 | 説明 |
|---|---|---|---|---|---|---|
| _blobLength | いいえ | はい | はい | はい | 数値 | ドキュメントの blob の長さ。 |
| _createTime | いいえ | はい | はい | はい | 数値 | ドキュメントの作成時刻(Unix エポックからのマイクロ秒数)。 |
| _id | いいえ | はい | はい | いいえ | 数値 | ドキュメント ID。 |
| _jsonLength | いいえ | はい | はい | はい | 数値 | ドキュメントの json の長さ。 |
| _label | はい | いいえ | はい | はい | 文字列 | ドキュメントのラベル。 |
| _updateTime | いいえ | はい | はい | はい | 数値 | ドキュメントの更新時刻(Unix エポックからのマイクロ秒数)。 |
BtrieveCollection::DocumentCreate および BtrieveCollection::DocumentUpdate では、ユーザー設定可能でない JSON フィールド名があっても通知されません。 上に挙げた以外の予約済み JSON フィールド名を使用すると、エラーが発生します。 予約済み JSON フィールド名は、 BtrieveCollection::DocumentRetrieveJson および BtrieveCollection::DocumentRetrieve によって取得されるドキュメントの JSON に追加されます。
ドキュメント ID は自動インクリメントの正の整数で、最大値は 2147483647(2^31 - 1)です。
| BtrieveCollection::BtrieveCollection | ( | ) |
| BtrieveCollection::~BtrieveCollection | ( | ) |
| Btrieve::StatusCode BtrieveCollection::Decrypt | ( | ) |
コレクションを復号します。
| = Btrieve::STATUS_CODE_NO_ERROR | 成功。 |
| != Btrieve::STATUS_CODE_NO_ERROR | エラーが発生しました。 |
| int BtrieveCollection::DocumentCreate | ( | const char * | json | ) |
ドキュメントを作成します。
| [in] | json | json。 |
| >= 0 | ドキュメント ID。 |
| -1 | エラーが発生しました。 エラーに関連する Btrieve::StatusCode を特定するには BtrieveCollection::GetLastStatusCode を使用します。 |
| int BtrieveCollection::DocumentCreate | ( | const char * | json, |
| const char * | blob, | ||
| int | blobLength ) |
ドキュメントを作成します。
| [in] | json | json。 |
| [in] | blob | blob。 |
| [in] | blobLength | blob の長さ。blob が NULL の場合は、blobLength を 0 にする必要があります。 |
| >= 0 | ドキュメント ID。 |
| -1 | エラーが発生しました。 エラーに関連する Btrieve::StatusCode を特定するには BtrieveCollection::GetLastStatusCode を使用します。 |
| Btrieve::StatusCode BtrieveCollection::DocumentDelete | ( | int | id, |
| int | entityTag = -1 ) |
ドキュメントを削除します。
| [in] | id | ID。 |
| [in] | entityTag | エンティティ タグ。エンティティ タグは、ドキュメントのエンティティ タグと等しいか、または -1 である必要があります。 |
| = Btrieve::STATUS_CODE_NO_ERROR | 成功。 |
| != Btrieve::STATUS_CODE_NO_ERROR | エラーが発生しました。 |
| Btrieve::StatusCode BtrieveCollection::DocumentRetrieve | ( | int | id, |
| char * | json = NULL, | ||
| int | jsonSize = 0, | ||
| char * | blob = NULL, | ||
| int | blobSize = 0, | ||
| int | documentBlobOffset = 0, | ||
| int | documentBlobLength = 0 ) |
ドキュメントを取得します。
| [in] | id | ID。 |
| [out] | json | json。 |
| [in] | jsonSize | json のサイズ。 |
| [out] | blob | blob。 |
| [in] | blobSize | blob のサイズ。 |
| [in] | documentBlobOffset | ドキュメントの blob のオフセット。 |
| [in] | documentBlobLength | ドキュメントの blob の長さ。ドキュメントの blob の長さが 0 の場合は、ドキュメントの blob 全体は blob のオフセットから取得されます。 |
| = Btrieve::STATUS_CODE_NO_ERROR | 成功。 |
| != Btrieve::STATUS_CODE_NO_ERROR | エラーが発生しました。 |
| Btrieve::StatusCode BtrieveCollection::DocumentRetrieveBlob | ( | int | id, |
| char * | blob, | ||
| int | blobSize, | ||
| int | documentBlobOffset = 0, | ||
| int | documentBlobLength = 0 ) |
ドキュメントの blob を取得します。
| [in] | id | ID。 |
| [out] | blob | blob。 |
| [in] | blobSize | blob のサイズ。 |
| [in] | documentBlobOffset | ドキュメントの blob のオフセット。 |
| [in] | documentBlobLength | ドキュメントの blob の長さ。ドキュメントの blob の長さが 0 の場合は、ドキュメントの blob 全体は blob のオフセットから取得されます。 |
| = Btrieve::STATUS_CODE_NO_ERROR | 成功。 |
| != Btrieve::STATUS_CODE_NO_ERROR | エラーが発生しました。 |
| int BtrieveCollection::DocumentRetrieveEntityTag | ( | int | id | ) |
ドキュメントのエンティティ タグを取得します。
| [in] | id | ID。 |
| >= 0 | ドキュメントのエンティティ タグ。 |
| -1 | エラーが発生しました。 エラーに関連する Btrieve::StatusCode を特定するには BtrieveCollection::GetLastStatusCode を使用します。 |
| const char * BtrieveCollection::DocumentRetrieveJson | ( | int | id | ) |
ドキュメントの json を取得します。
| [in] | id | ID。 |
| != NULL | json。 |
| NULL | エラーが発生しました。 |
| const char * BtrieveCollection::DocumentRetrieveJson | ( | int | id, |
| char * | blob, | ||
| int | blobSize, | ||
| int | documentBlobOffset = 0, | ||
| int | documentBlobLength = 0 ) |
ドキュメントの json を取得します。
| [in] | id | ID。 |
| [out] | blob | blob。 |
| [in] | blobSize | blob のサイズ。 |
| [in] | documentBlobOffset | ドキュメントの blob のオフセット。 |
| [in] | documentBlobLength | ドキュメントの blob の長さ。ドキュメントの blob の長さが 0 の場合は、ドキュメントの blob 全体は blob のオフセットから取得されます。 |
| != NULL | json。 |
| NULL | エラーが発生しました。 |
| Btrieve::StatusCode BtrieveCollection::DocumentUpdate | ( | int | id, |
| const char * | json ) |
ドキュメントを更新します。
| [in] | id | ID。 |
| [in] | json | json。json が NULL の場合、ドキュメントの json は更新されません。 |
| = Btrieve::STATUS_CODE_NO_ERROR | 成功。 |
| != Btrieve::STATUS_CODE_NO_ERROR | エラーが発生しました。 |
| Btrieve::StatusCode BtrieveCollection::DocumentUpdate | ( | int | id, |
| const char * | json, | ||
| const char * | blob, | ||
| int | blobLength ) |
ドキュメントを更新します。
| [in] | id | ID。 |
| [in] | json | json。json が NULL の場合、ドキュメントの json は更新されません。 |
| [in] | blob | blob。blob が NULL の場合、ドキュメントの blob は更新されません。 |
| [in] | blobLength | blob の長さ。blob が NULL でなく、blobLength が 0 の場合、ドキュメントの blob は削除されます。 |
| = Btrieve::STATUS_CODE_NO_ERROR | 成功。 |
| != Btrieve::STATUS_CODE_NO_ERROR | エラーが発生しました。 |
| Btrieve::StatusCode BtrieveCollection::DocumentUpdate | ( | int | id, |
| int | entityTag, | ||
| const char * | json ) |
ドキュメントを更新します。
| [in] | id | ID。 |
| [in] | entityTag | エンティティ タグ。エンティティ タグは、ドキュメントのエンティティ タグと等しいか、または -1 である必要があります。 |
| [in] | json | json。json が NULL の場合、ドキュメントの json は更新されません。 |
| = Btrieve::STATUS_CODE_NO_ERROR | 成功。 |
| != Btrieve::STATUS_CODE_NO_ERROR | エラーが発生しました。 |
| Btrieve::StatusCode BtrieveCollection::DocumentUpdate | ( | int | id, |
| int | entityTag, | ||
| const char * | json, | ||
| const char * | blob, | ||
| int | blobLength ) |
ドキュメントを更新します。
| [in] | id | ID。 |
| [in] | entityTag | エンティティ タグ。エンティティ タグは、ドキュメントのエンティティ タグと等しいか、または -1 である必要があります。 |
| [in] | json | json。json が NULL の場合、ドキュメントの json は更新されません。 |
| [in] | blob | blob。blob が NULL の場合、ドキュメントの blob は更新されません。 |
| [in] | blobLength | blob の長さ。blob が NULL でなく、blobLength が 0 の場合、ドキュメントの blob は削除されます。 |
| = Btrieve::STATUS_CODE_NO_ERROR | 成功。 |
| != Btrieve::STATUS_CODE_NO_ERROR | エラーが発生しました。 |
| Btrieve::StatusCode BtrieveCollection::Encrypt | ( | const char * | password, |
| const char * | passwordAgain ) |
コレクションを暗号化します。
| [in] | password | パスワード。パスワードは、32 バイトまでに制限されたヌル終了文字列です。 |
| [in] | passwordAgain | パスワード(確認)。 |
| = Btrieve::STATUS_CODE_NO_ERROR | 成功。 |
| != Btrieve::STATUS_CODE_NO_ERROR | エラーが発生しました。 |
| Btrieve::StatusCode BtrieveCollection::GetLastStatusCode | ( | ) |
最新のステータス コードを取得します。
| = Btrieve::STATUS_CODE_NO_ERROR | 成功。 |
| != Btrieve::STATUS_CODE_NO_ERROR | エラーが発生しました。 |
| Btrieve::StatusCode BtrieveCollection::Query | ( | BtrieveDocumentSet * | btrieveDocumentSet, |
| const char * | query = NULL ) |
コレクションを照会します。
| [out] | btrieveDocumentSet | Btrieve ドキュメント セット。 |
| [in] | query | クエリ。クエリの最大長は Btrieve::MAXIMUM_RECORD_LENGTH バイトです。 |
| = Btrieve::STATUS_CODE_NO_ERROR | 成功。 |
| != Btrieve::STATUS_CODE_NO_ERROR | エラーが発生しました。 エラーに関する詳細説明は、Zen イベント ログで入手できます。 |