System.JSON.Builders.TJSONCollectionBuilder.TElements.AddElements

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

function AddElements(const AElements: array of const): TElements; overload;
function AddElements(const ABuilder: TJSONCollectionBuilder): TElements; overload; inline;
function AddElements(const AJSON: string): TElements; overload; inline;

C++

HIDESBASE TJSONCollectionBuilder::TElements* __fastcall AddElements(const System::TVarRec *AElements, const int AElements_High)/* overload */;
HIDESBASE TJSONCollectionBuilder::TElements* __fastcall AddElements(TJSONCollectionBuilder* const ABuilder)/* overload */;
HIDESBASE TJSONCollectionBuilder::TElements* __fastcall AddElements(const System::UnicodeString AJSON)/* overload */;

プロパティ

種類 可視性 ソース ユニット
function public
System.JSON.Builders.pas
System.JSON.Builders.hpp
System.JSON.Builders TElements


説明

指定された複数の値を JSON 配列に追加し、メソッド連鎖用にこの TElements インスタンスを返します。

値は、JSON ビルダ、JSON 文字列、または定数の配列として指定することができます。

定数の配列を指定する場合、配列やオブジェクトの先頭および末尾を示す配列内の項目として、"{"、"}"、"["、"]" という文字列を使用することができます。次に例を示します。

Delphi の場合:

MyElements.AddElements(['value 1',
                        '[',
                          'array',
                          'value',
                          '2'
                        ']',
                        '{',
                          'key 3.1',
                          'value 3.1',
                        '}']);

C++ の場合:

MyElements->AddElements(ARRAYOFCONST(String("value 1"),
                                     String("["),
                                       String("array"),
                                       String("value"),
                                       String("2"),
                                     String("]"),
                                     String("{"),
                                       String("key 3.1"),
                                       String("value 3.1"),
                                     String("}")])));

上記の例では、JSON 配列に以下の値を設定しています。

"value 1",
[
  "array",
  "value",
  "2"
],
{
  "key 3.1": "value 3.1"
}

関連項目