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

abstract IO More...

#include "ZFIODef_fwd.h"

Go to the source code of this file.

Macros

#define ZFCallbackSerializeType_ZFInputForPathInfo
 see ZFCALLBACK_SERIALIZE_TYPE_DEFINE
 
#define ZFCallbackSerializeType_ZFOutputForPathInfo
 see ZFCALLBACK_SERIALIZE_TYPE_DEFINE
 
#define ZFCallbackSerializeType_ZFInputForLocal
 see ZFCALLBACK_SERIALIZE_TYPE_DEFINE
 
#define ZFCallbackSerializeType_ZFOutputForLocal
 see ZFCALLBACK_SERIALIZE_TYPE_DEFINE
 
#define ZFPathInfoChainCharMap()
 see ZFPathInfoChainDecode
 

Functions

zfbool ZFIOIsExist (const ZFPathInfo &pathInfo)
 see ZFIOImplForPathType
 
zfbool ZFIOIsDir (const ZFPathInfo &pathInfo)
 see ZFIOImplForPathType
 
zfbool ZFIOToFileName (zfstring &ret, const ZFPathInfo &pathInfo)
 see ZFIOImplForPathType
 
zfbool ZFIOToChild (zfstring &ret, const ZFPathInfo &pathInfo, const zfstring &childName)
 see ZFIOImplForPathType
 
zfbool ZFIOToParent (zfstring &ret, const ZFPathInfo &pathInfo)
 see ZFIOImplForPathType
 
zfbool ZFIOPathCreate (const ZFPathInfo &pathInfo, zfbool autoCreateParent=(_ZFT_t_zftrue))
 see ZFIOImplForPathType
 
zfbool ZFIORemove (const ZFPathInfo &pathInfo, zfbool isRecursive=(_ZFT_t_zftrue), zfbool isForce=(_ZFT_t_zftrue))
 see ZFIOImplForPathType
 
zfbool ZFIOMove (const ZFPathInfo &pathInfoFrom, const zfstring &pathDataTo, zfbool isForce=(_ZFT_t_zftrue))
 see ZFIOImplForPathType
 
zfautoT< ZFIOTokenZFIOOpen (const ZFPathInfo &pathInfo, ZFIOOpenOptionFlags flags, zfbool autoCreateParent=(_ZFT_t_zftrue))
 see ZFIOImplForPathType
 
ZFPathInfo ZFLocalPathInfo (const zfstring &localPath=(zft_zfnull))
 return local path info for current context
 
zfbool ZFPathInfoForLocalT (ZFPathInfo &ret, const ZFPathInfo &pathInfo, const zfstring &childPath)
 util to make a child path info relative to existing one
 
zfbool ZFPathInfoForLocalT (zfstring &ret, const ZFPathInfo &pathInfo, const zfstring &childPath)
 util to make a child path info relative to existing one
 
ZFPathInfo ZFPathInfoForLocal (const ZFPathInfo &pathInfo, const zfstring &childPath)
 see ZFPathInfoForLocalT
 
ZFInput ZFInputForPathInfo (const ZFPathInfo &pathInfo)
 util to create a file input callback
 
zfbool ZFInputForPathInfoT (ZFCallback &ret, const ZFPathInfo &pathInfo)
 see ZFInputForPathInfo
 
ZFInput ZFInputForPathInfoToken (ZFIOToken *token)
 see ZFInputForPathInfo
 
zfbool ZFInputForPathInfoTokenT (ZFCallback &ret, ZFIOToken *token)
 see ZFInputForPathInfo
 
ZFOutput ZFOutputForPathInfo (const ZFPathInfo &pathInfo)
 util to create a file output callback
 
zfbool ZFOutputForPathInfoT (ZFCallback &ret, const ZFPathInfo &pathInfo)
 see ZFOutputForPathInfo
 
ZFOutput ZFOutputForPathInfoToken (ZFIOToken *token)
 see ZFOutputForPathInfo
 
zfbool ZFOutputForPathInfoTokenT (ZFCallback &ret, ZFIOToken *token)
 see ZFOutputForPathInfo
 
ZFInput ZFInputForLocal (const zfstring &localPath, const ZFPathInfo &pathInfo)
 util to create a file input callback
 
zfbool ZFInputForLocalT (ZFCallback &ret, const zfstring &localPath, const ZFPathInfo &pathInfo)
 see ZFInputForLocal
 
ZFOutput ZFOutputForLocal (const zfstring &localPath, const ZFPathInfo &pathInfo)
 util to create a file output callback
 
zfbool ZFOutputForLocalT (ZFCallback &ret, const zfstring &localPath, const ZFPathInfo &pathInfo)
 see ZFOutputForLocal
 
void ZFInputMarkSerializable (ZFCallback &ret, const ZFPathInfo &pathInfo, ZFIOOpenOptionFlags flags=(v_ZFIOOpenOption::e_Read))
 util to mark a ZFInput serializable with specified pathInfo
 
void ZFOutputMarkSerializable (ZFCallback &ret, const ZFPathInfo &pathInfo, ZFIOOpenOptionFlags flags=(v_ZFIOOpenOption::e_Write))
 util to mark a ZFOutput serializable with specified pathInfo
 
zfbool ZFPathInfoChainDecode (ZFPathInfo &chainPathInfo, zfstring &pathData, const zfchar *pathDataOrig)
 util for impl to parse chained path data
 
zfbool ZFPathInfoChainDecodeString (zfstring &chainPathInfoString, zfstring &pathData, const zfchar *pathDataOrig)
 see ZFPathInfoChainDecode
 
void ZFPathInfoChainEncodeT (zfstring &ret, const ZFPathInfo &chainPathInfo, const zfchar *pathData)
 see ZFPathInfoChainDecode
 
zfstring ZFPathInfoChainEncode (const ZFPathInfo &chainPathInfo, const zfchar *pathData)
 see ZFPathInfoChainDecode
 

Detailed Description

abstract IO

Macro Definition Documentation

◆ ZFCallbackSerializeType_ZFInputForPathInfo

#define ZFCallbackSerializeType_ZFInputForPathInfo

see ZFCALLBACK_SERIALIZE_TYPE_DEFINE

serializable data:

callbackType="ZFInputForPathInfo"
pathInfo="ZFPathInfo" // required, the path info
>
callback used by ZFFramework
Definition ZFCallback.h:98

◆ ZFCallbackSerializeType_ZFOutputForPathInfo

#define ZFCallbackSerializeType_ZFOutputForPathInfo

see ZFCALLBACK_SERIALIZE_TYPE_DEFINE

serializable data:

callbackType="ZFOutputForPathInfo"
pathInfo="ZFPathInfo" // required, the path info
>

◆ ZFCallbackSerializeType_ZFInputForLocal

#define ZFCallbackSerializeType_ZFInputForLocal

see ZFCALLBACK_SERIALIZE_TYPE_DEFINE

serializable data:

callbackType="ZFInputForLocal"
localPath="zfstring" // required, the local path
>

◆ ZFCallbackSerializeType_ZFOutputForLocal

#define ZFCallbackSerializeType_ZFOutputForLocal

see ZFCALLBACK_SERIALIZE_TYPE_DEFINE

serializable data:

callbackType="ZFOutputForLocal"
localPath="zfstring" // required, the local path
>

◆ ZFPathInfoChainCharMap

#define ZFPathInfoChainCharMap ( )

see ZFPathInfoChainDecode

keep all printable chars except:

  • %
  • |

Function Documentation

◆ ZFLocalPathInfo()

ZFPathInfo ZFLocalPathInfo ( const zfstring & localPath = (zft_zfnull))
extern

return local path info for current context

this method is designed for script only, when called from cpp side, it always return a dummy path info

◆ ZFInputForPathInfo()

ZFInput ZFInputForPathInfo ( const ZFPathInfo & pathInfo)
extern

util to create a file input callback

param:

auto open and auto close files, may return a null callback if open file error

note, additional impl can be attached by ZFIO_DECLARE

◆ ZFInputForPathInfoT()

zfbool ZFInputForPathInfoT ( ZFCallback & ret,
const ZFPathInfo & pathInfo )
extern

see ZFInputForPathInfo

this method is designed for performance for further impl, by:

◆ ZFOutputForPathInfo()

ZFOutput ZFOutputForPathInfo ( const ZFPathInfo & pathInfo)
extern

util to create a file output callback

param:

auto open and auto close files, may return a null callback if open file error

note, additional impl can be attached by ZFIO_DECLARE

◆ ZFOutputForPathInfoT()

zfbool ZFOutputForPathInfoT ( ZFCallback & ret,
const ZFPathInfo & pathInfo )
extern

see ZFOutputForPathInfo

this method is designed for performance for further impl, by:

◆ ZFInputForLocal()

ZFInput ZFInputForLocal ( const zfstring & localPath,
const ZFPathInfo & pathInfo )
extern

util to create a file input callback

param:

auto open and auto close files, may return a null callback if open file error

note, additional impl can be attached by ZFIO_DECLARE

◆ ZFOutputForLocal()

ZFOutput ZFOutputForLocal ( const zfstring & localPath,
const ZFPathInfo & pathInfo )
extern

util to create a file output callback

param:

auto open and auto close files, may return a null callback if open file error

note, additional impl can be attached by ZFIO_DECLARE

◆ ZFPathInfoChainDecode()

zfbool ZFPathInfoChainDecode ( ZFPathInfo & chainPathInfo,
zfstring & pathData,
const zfchar * pathDataOrig )
extern

util for impl to parse chained path data

chained path info format: 'pathType1:pathType2:pathData2|pathData1'
or, if recursively chained: 'pathType1:pathType2:pathType3:pathData3%7cpathData2|pathData1'
note if the chained path info contains the special '|' char, it must be escaped by '%7c', or use ZFCoreDataEncode with ZFPathInfoChainCharMap

typical case:

// if original path info is:
pathType1:pathType2:pathType3:pathData3%7cpathData2|pathData1
// the pathDataOrig should be:
pathType2:pathType3:pathData3%7cpathData2|pathData1
// after decode, chainPathInfo should be:
pathType2
pathType3:pathData3|pathData2
// pathData should be:
pathData1