ZFFramework
 
Loading...
Searching...
No Matches
ZFFile_path.h File Reference

file utility More...

#include "ZFFile_fwd.h"

Go to the source code of this file.

Namespaces

namespace  ZFGlobalEvent
 

 

Functions

zfstring ZFPathForCwd ()
 get current working directory
 
zfbool ZFPathForCwd (const zfstring &path)
 change current working directory
 
zfstring ZFPathForCwdOrModule ()
 util method to access ZFPathForCwd, return ZFPathForModule if not available
 
const zfstringZFPathForModule ()
 get module's parent's path, e.g. "/path"
 
const zfstringZFPathForModuleFile ()
 get module's path, e.g. "/path/module.exe"
 
zfidentity ZFGlobalEvent::E_ZFPathForSettingOnUpdate (void)
 see ZFObject::observerNotify
 
const zfstringZFPathForSetting ()
 get a proper data path that app can save settings to
 
void ZFPathForSetting (const zfstring &path)
 change the data path, null to use defalut path
 
zfidentity ZFGlobalEvent::E_ZFPathForStorageOnUpdate (void)
 see ZFObject::observerNotify
 
const zfstringZFPathForStorage ()
 get a proper storage path that app can write files to
 
void ZFPathForStorage (const zfstring &path)
 change the storage path, null to use defalut path
 
zfidentity ZFGlobalEvent::E_ZFPathForStorageSharedOnUpdate (void)
 see ZFObject::observerNotify
 
const zfstringZFPathForStorageShared ()
 get a proper shared storage path that app can write files to, and other app can access
 
void ZFPathForStorageShared (const zfstring &path)
 change the storage path, null to use defalut path
 
zfidentity ZFGlobalEvent::E_ZFPathForCacheOnUpdate (void)
 see ZFObject::observerNotify
 
zfidentity ZFGlobalEvent::E_ZFPathForCacheBeforeClear (void)
 see ZFObject::observerNotify
 
zfidentity ZFGlobalEvent::E_ZFPathForCacheAfterClear (void)
 see ZFObject::observerNotify
 
const zfstringZFPathForCache ()
 get a proper cache path that app can write files to
 
void ZFPathForCache (const zfstring &path)
 change the cache path, null to use defalut path
 
void ZFPathForCacheClear ()
 clear all caches under ZFPathForCache
 

Detailed Description

file utility

Function Documentation

◆ ZFPathForCwd() [1/2]

zfstring ZFPathForCwd ( )
extern

get current working directory

return null if not available

◆ ZFPathForCwd() [2/2]

zfbool ZFPathForCwd ( const zfstring & path)
extern

change current working directory

return false if failed

◆ ZFPathForModule()

const zfstring & ZFPathForModule ( )
extern

get module's parent's path, e.g. "/path"

path is ensured to use '/' as separator, and no extra separator would be added to tail

◆ ZFPathForModuleFile()

const zfstring & ZFPathForModuleFile ( )
extern

get module's path, e.g. "/path/module.exe"

path is ensured to use '/' as separator
it's not ensured module path is actually executable's path, use other path types for data storage such as ZFPathForSetting

◆ ZFPathForSetting()

const zfstring & ZFPathForSetting ( )
extern

get a proper data path that app can save settings to

path is ensured to use '/' as separator, and no extra separator would be added to tail

◆ ZFPathForStorage()

const zfstring & ZFPathForStorage ( )
extern

get a proper storage path that app can write files to

path is ensured to use '/' as separator, and no extra separator would be added to tail

◆ ZFPathForStorageShared()

const zfstring & ZFPathForStorageShared ( )
extern

get a proper shared storage path that app can write files to, and other app can access

note, this path may or may not be writable, maybe external storage path or user's home path, write with caution and only if necessary
path is ensured to use '/' as separator, and no extra separator would be added to tail

◆ ZFPathForCache()

const zfstring & ZFPathForCache ( )
extern

get a proper cache path that app can write files to

cache is used for temp files only, may or may not be deleted automatically
path is ensured to use '/' as separator, and no extra separator would be added to tail