説明
ExportJson 関数は、Lua のテーブルをJSON形式でエクスポートします。
|
既知の制限:
|
ファイルが適切なJSON形式でフォーマットされていない可能性があります。 |
引数
- filename:
エクスポートされるファイルの名前を指定する文字列。ファイル名には、パス全体が含まれている必要があります(後述の例を参照)。
- export_data:
エクスポートされるデータ。テーブル・オブジェクトである必要があります。
戻り値
- boolean:
以下の boolean 値を返します。
- true:
エクスポートに成功しました。
- false:
エクスポートに失敗しました。
例
ビルドの詳細テーブルをエクスポートするには、以下のようなコードでプラグインを作成します。
|
return function() local build = BuildDetails() local exportPath = GetPath(Enums.PathType.Library) .. "/BuildDetails.json" local success = ExportJson(exportPath, build) if success then Printf("The export was stored at: " .. exportPath) else Printf("The export failed.") end end |