|
| FileSystem (Context *context) |
| Construct.
|
|
| ~FileSystem () override |
| Destruct.
|
|
bool | SetCurrentDir (const ea::string &pathName) |
|
bool | CreateDir (const ea::string &pathName) |
| Create a directory.
|
|
void | SetExecuteConsoleCommands (bool enable) |
|
int | SystemCommand (const ea::string &commandLine, bool redirectStdOutToLog=false) |
| Run a program using the command interpreter, block until it exits and return the exit code. Will fail if any allowed paths are defined.
|
|
int | SystemRun (const ea::string &fileName, const ea::vector< ea::string > &arguments, ea::string &output) |
| Run a specific program, block until it exits and return the exit code. Will fail if any allowed paths are defined. Returns STDOUT output of subprocess.
|
|
int | SystemRun (const ea::string &fileName, const ea::vector< ea::string > &arguments) |
| Run a specific program, block until it exits and return the exit code. Will fail if any allowed paths are defined.
|
|
int | SystemSpawn (const ea::string &fileName, const ea::vector< ea::string > &arguments) |
| Run a specific program, do not block until it exits. Will fail if any allowed paths are defined.
|
|
unsigned | SystemCommandAsync (const ea::string &commandLine) |
| Run a program using the command interpreter asynchronously. Return a request ID or M_MAX_UNSIGNED if failed. The exit code will be posted together with the request ID in an AsyncExecFinished event. Will fail if any allowed paths are defined.
|
|
unsigned | SystemRunAsync (const ea::string &fileName, const ea::vector< ea::string > &arguments) |
| Run a specific program asynchronously. Return a request ID or M_MAX_UNSIGNED if failed. The exit code will be posted together with the request ID in an AsyncExecFinished event. Will fail if any allowed paths are defined.
|
|
bool | SystemOpen (const ea::string &fileName, const ea::string &mode=EMPTY_STRING) |
| Open a file in an external program, with mode such as "edit" optionally specified. Will fail if any allowed paths are defined.
|
|
bool | Copy (const ea::string &srcFileName, const ea::string &destFileName) |
| Copy a file. Return true if successful.
|
|
bool | Rename (const ea::string &srcFileName, const ea::string &destFileName) |
| Rename a file. Return true if successful.
|
|
bool | Delete (const ea::string &fileName) |
| Delete a file. Return true if successful.
|
|
void | RegisterPath (const ea::string &pathName) |
| Register a path as allowed to access. If no paths are registered, all are allowed. Registering allowed paths is considered securing the Urho3D execution environment: running programs and opening files externally through the system will fail afterward.
|
|
bool | SetLastModifiedTime (const ea::string &fileName, FileTime newTime) |
| Set a file's last modified time as seconds since 1.1.1970. Return true on success.
|
|
bool | Reveal (const ea::string &path) |
| Reveal path or file in OS file browser.
|
|
ea::string | GetCurrentDir () const |
|
bool | GetExecuteConsoleCommands () const |
|
bool | HasRegisteredPaths () const |
| Return whether paths have been registered.
|
|
bool | CheckAccess (const ea::string &pathName) const |
| Check if a path is allowed to be accessed. If no paths are registered, all are allowed.
|
|
FileTime | GetLastModifiedTime (const ea::string &fileName, bool creationIsModification=false) const |
| Returns the file's last modified time as seconds since 1.1.1970, or 0 if can not be accessed.
|
|
bool | FileExists (const ea::string &fileName) const |
| Check if a file exists.
|
|
bool | DirExists (const ea::string &pathName) const |
| Check if a directory exists.
|
|
void | ScanDir (ea::vector< ea::string > &result, const ea::string &pathName, const ea::string &filter, ScanFlags flags) const |
| Scan a directory for specified files.
|
|
ea::string | GetProgramDir () const |
|
ea::string | GetProgramFileName () const |
| Return the program's executable file path, or empty string if not applicable.
|
|
ea::string | GetUserDocumentsDir () const |
|
ea::string | GetAppPreferencesDir (const ea::string &org, const ea::string &app) const |
| Return the application preferences directory.
|
|
bool | Exists (const ea::string &pathName) const |
| Check if a file or directory exists at the specified path.
|
|
bool | CopyDir (const ea::string &directoryIn, const ea::string &directoryOut, StringVector *copiedFiles=nullptr) |
| Copy files from one directory to another.
|
|
bool | CreateDirs (const ea::string &root, const ea::string &subdirectory) |
| Create subdirectories. New subdirectories will be made only in a subpath specified by subdirectory .
|
|
bool | CreateDirsRecursive (const ea::string &directoryIn) |
| Create specified subdirectory and any parent directory if it does not exist.
|
|
bool | RemoveDir (const ea::string &directoryIn, bool recursive) |
| Remove files in a directory, or remove entire directory recursively.
|
|
ea::string | GetTemporaryDir () const |
|
ea::string | FindResourcePrefixPath () const |
| Try to find resource prefix path starting from executable and going up.
|
|
| Object (Context *context) |
| Construct.
|
|
| ~Object () override |
| Destruct. Clean up self from event sender & receiver structures.
|
|
virtual StringHash | GetType () const =0 |
|
virtual const ea::string & | GetTypeName () const =0 |
|
virtual const TypeInfo * | GetTypeInfo () const =0 |
| Return type info.
|
|
virtual bool | IsInstanceOf (StringHash type) const =0 |
| Check whether current instance implements specified type.
|
|
virtual void | OnEvent (Object *sender, StringHash eventType, VariantMap &eventData) |
| Handle event.
|
|
virtual void | SerializeInBlock (Archive &archive) |
| Serialize content from/to archive. May throw ArchiveException.
|
|
template<typename T > |
bool | IsInstanceOf () const |
| Check current instance is type of specified class.
|
|
template<typename T > |
T * | Cast () |
| Cast the object to specified most derived class.
|
|
template<typename T > |
const T * | Cast () const |
| Cast the object to specified most derived class.
|
|
void | SubscribeToEventManual (StringHash eventType, EventHandler *handler) |
| Subscribe to an event that can be sent by any sender.
|
|
void | SubscribeToEventManual (Object *sender, StringHash eventType, EventHandler *handler) |
| Subscribe to a specific sender's event.
|
|
template<class T > |
void | SubscribeToEvent (StringHash eventType, T handler) |
| Subscribe to an event that can be sent by any sender.
|
|
template<class T > |
void | SubscribeToEvent (Object *sender, StringHash eventType, T handler) |
| Subscribe to a specific sender's event.
|
|
void | UnsubscribeFromEvent (StringHash eventType) |
| Unsubscribe from an event.
|
|
void | UnsubscribeFromEvent (Object *sender, StringHash eventType) |
| Unsubscribe from a specific sender's event.
|
|
void | UnsubscribeFromEvents (Object *sender) |
| Unsubscribe from a specific sender's events.
|
|
void | UnsubscribeFromAllEvents () |
| Unsubscribe from all events.
|
|
void | UnsubscribeFromAllEventsExcept (const ea::vector< StringHash > &exceptions) |
| Unsubscribe from all events except those listed.
|
|
void | UnsubscribeFromAllEventsExcept (const ea::vector< Object * > &exceptions) |
| Unsubscribe from all events except those with listed senders.
|
|
void | SendEvent (StringHash eventType) |
| Send event to all subscribers.
|
|
void | SendEvent (StringHash eventType, VariantMap &eventData) |
| Send event with parameters to all subscribers.
|
|
VariantMap & | GetEventDataMap () const |
| Return a preallocated map for event data. Used for optimization to avoid constant re-allocation of event data maps.
|
|
template<typename... Args> |
void | SendEvent (StringHash eventType, const Args &... args) |
| Send event with variadic parameter pairs to all subscribers. The parameters are (paramID, paramValue) pairs.
|
|
Context * | GetContext () const |
| Return execution context.
|
|
const Variant & | GetGlobalVar (StringHash key) const |
|
const VariantMap & | GetGlobalVars () const |
|
void | SetGlobalVar (StringHash key, const Variant &value) |
|
Object * | GetSubsystem (StringHash type) const |
| Return subsystem by type.
|
|
Object * | GetEventSender () const |
| Return active event sender. Null outside event handling.
|
|
EventHandler * | GetEventHandler () const |
| Return active event handler. Null outside event handling.
|
|
bool | HasSubscribedToEvent (StringHash eventType) const |
| Return whether has subscribed to an event without specific sender.
|
|
bool | HasSubscribedToEvent (Object *sender, StringHash eventType) const |
| Return whether has subscribed to a specific sender's event.
|
|
bool | HasEventHandlers () const |
| Return whether has subscribed to any event.
|
|
template<class T > |
T * | GetSubsystem () const |
| Template version of returning a subsystem.
|
|
const ea::string & | GetCategory () const |
|
void | SendEvent (StringHash eventType, const VariantMap &eventData) |
| Send event with parameters to all subscribers.
|
|
void | SetBlockEvents (bool block) |
| Block object from sending and receiving events.
|
|
bool | GetBlockEvents () const |
| Return sending and receiving events blocking status.
|
|
| RefCounted () |
| Construct. Allocate the reference count structure and set an initial self weak reference.
|
|
virtual | ~RefCounted () |
| Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
|
|
| RefCounted (const RefCounted &rhs)=delete |
| Prevent copy construction.
|
|
RefCounted & | operator= (const RefCounted &rhs)=delete |
| Prevent assignment.
|
|
int | AddRef () |
|
int | ReleaseRef () |
|
int | Refs () const |
|
int | WeakRefs () const |
|
RefCount * | RefCountPtr () const |
| Return pointer to the reference count structure.
|
|
bool | HasScriptObject () const |
| Return true if script runtime object wrapping this native object exists.
|
|
bool | IsScriptStrongRef () const |
| Return true if script reference is strong.
|
|
Subsystem for file and directory operations and access control.