Changeset View
Changeset View
Standalone View
Standalone View
source/ps/scripting/JSInterface_VFS.h
Show All 12 Lines | |||||||||||||
* | * | ||||||||||||
* You should have received a copy of the GNU General Public License | * You should have received a copy of the GNU General Public License | ||||||||||||
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | ||||||||||||
*/ | */ | ||||||||||||
#ifndef INCLUDED_JSI_VFS | #ifndef INCLUDED_JSI_VFS | ||||||||||||
#define INCLUDED_JSI_VFS | #define INCLUDED_JSI_VFS | ||||||||||||
#include "scriptinterface/ScriptInterface.h" | #include "scriptinterface/ScriptInterface.h" | ||||||||||||
StanUnsubmitted Not Done Inline Actions
Stan: | |||||||||||||
namespace JSI_VFS | namespace JSI_VFS | ||||||||||||
{ | { | ||||||||||||
// Return an array of pathname strings, one for each matching entry in the | // Return an array of pathname strings, one for each matching entry in the | ||||||||||||
// specified directory. | // specified directory. | ||||||||||||
JS::Value BuildDirEntList(ScriptInterface::CmptPrivate* pCmptPrivate, const std::vector<CStrW>& validPaths, const std::wstring& path, const std::wstring& filterStr, bool recurse); | JS::Value BuildDirEntList(ScriptInterface::CmptPrivate* pCmptPrivate, const std::vector<CStrW>& validPaths, const std::wstring& path, const std::wstring& filterStr, bool recurse); | ||||||||||||
// Return true iff the file exists | // Return true iff the file exists | ||||||||||||
Show All 15 Lines | namespace JSI_VFS | ||||||||||||
JS::Value ReadJSONFile(ScriptInterface::CmptPrivate* pCmptPrivate, const std::vector<CStrW>& validPaths, const CStrW& filePath); | JS::Value ReadJSONFile(ScriptInterface::CmptPrivate* pCmptPrivate, const std::vector<CStrW>& validPaths, const CStrW& filePath); | ||||||||||||
// Save given JS Object to a JSON file | // Save given JS Object to a JSON file | ||||||||||||
void WriteJSONFile(ScriptInterface::CmptPrivate* pCmptPrivate, const std::wstring& filePath, JS::HandleValue val1); | void WriteJSONFile(ScriptInterface::CmptPrivate* pCmptPrivate, const std::wstring& filePath, JS::HandleValue val1); | ||||||||||||
// Tests whether the current script context is allowed to read from the given directory | // Tests whether the current script context is allowed to read from the given directory | ||||||||||||
bool PathRestrictionMet(ScriptInterface::CmptPrivate* pCmptPrivate, const std::vector<CStrW>& validPaths, const CStrW& filePath); | bool PathRestrictionMet(ScriptInterface::CmptPrivate* pCmptPrivate, const std::vector<CStrW>& validPaths, const CStrW& filePath); | ||||||||||||
// Return a hash of the files in paths. | |||||||||||||
std::string Hash(ScriptInterface::CmptPrivate* pCmptPrivate, const std::vector<std::string>& paths); | |||||||||||||
void RegisterScriptFunctions_GUI(const ScriptInterface& scriptInterface); | void RegisterScriptFunctions_GUI(const ScriptInterface& scriptInterface); | ||||||||||||
void RegisterScriptFunctions_Simulation(const ScriptInterface& scriptInterface); | void RegisterScriptFunctions_Simulation(const ScriptInterface& scriptInterface); | ||||||||||||
void RegisterScriptFunctions_Maps(const ScriptInterface& scriptInterface); | void RegisterScriptFunctions_Maps(const ScriptInterface& scriptInterface); | ||||||||||||
} | } | ||||||||||||
#endif // INCLUDED_JSI_VFS | #endif // INCLUDED_JSI_VFS |
Wildfire Games · Phabricator