Changeset View
Changeset View
Standalone View
Standalone View
source/ps/scripting/JSInterface_VFS.h
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | namespace JSI_VFS | ||||
// Return file contents in a string. | // Return file contents in a string. | ||||
JS::Value ReadFile(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& filename); | JS::Value ReadFile(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& filename); | ||||
// Return file contents as an array of lines. | // Return file contents as an array of lines. | ||||
JS::Value ReadFileLines(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& filename); | JS::Value ReadFileLines(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& filename); | ||||
// Return file contents parsed as a JS Object | // Return file contents parsed as a JS Object | ||||
JS::Value ReadJSONFile(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& filePath); | JS::Value ReadJSONFile(ScriptInterface::CxPrivate* pCxPrivate, const std::vector<std::wstring>& validPaths, const std::wstring& filePath); | ||||
JS::Value Script_ReadJSONFile_GUI(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& filePath); | |||||
JS::Value Script_ReadJSONFile_Simulation(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& filePath); | |||||
JS::Value Script_ReadJSONFile_Maps(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& filePath); | |||||
// Save given JS Object to a JSON file | // Save given JS Object to a JSON file | ||||
void WriteJSONFile(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& filePath, JS::HandleValue val1); | void WriteJSONFile(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& filePath, JS::HandleValue val1); | ||||
// Tests whether the current script context is allowed to read from the given directory | |||||
bool PathRestrictionMet(ScriptInterface::CxPrivate* pCxPrivate, const std::vector<std::wstring>& validPaths, const std::wstring& filePath); | |||||
void RegisterReadOnlyScriptFunctions(const ScriptInterface& scriptInterface); | void RegisterReadOnlyScriptFunctions(const ScriptInterface& scriptInterface); | ||||
void RegisterWriteScriptFunctions(const ScriptInterface& scriptInterface); | void RegisterWriteScriptFunctions(const ScriptInterface& scriptInterface); | ||||
void RegisterScriptFunctions_GUI(const ScriptInterface& scriptInterface); | |||||
void RegisterScriptFunctions_Simulation(const ScriptInterface& scriptInterface); | |||||
void RegisterScriptFunctions_Maps(const ScriptInterface& scriptInterface); | |||||
} | } | ||||
#endif | #endif |
Wildfire Games · Phabricator