| AngelScript

filesystem object

Path: /sdk/add_on/scriptfile/

This object provides support for inspecting directories on the filesystem.

Register with `RegisterScriptFileSystem(asIScriptEngine*)`.

# Public C++ interface

class CScriptFileSystem
{
public:
CScriptFileSystem();
void AddRef() const;
void Release() const;
// Sets the current path that should be used in other calls when using relative paths
// It can use relative paths too, so moving up a directory is used by passing in ".."
bool ChangeCurrentPath(const std::string &path);
std::string GetCurrentPath() const;
// Returns true if the path is a directory. Input can be either a full path or a relative path
bool IsDir(const std::string &path) const;
// Returns a list of the files in the current path
CScriptArray *GetFiles() const;
// Returns a list of the directories in the current path
CScriptArray *GetDirs() const;
};

# Public script interface

      class filesystem
      {
        bool           changeCurrentPath(const string &in);
        string         getCurrentPath() const;
        array<string> @getDirs();
        array<string> @getFiles();
        bool           isDir(const string &in);
      }