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

namespace impl More...

#include "ZFCoreTypeDef.h"
#include "ZFCoreArray.h"
#include "ZFCoreStaticRegister.h"

Go to the source code of this file.

Macros

#define ZF_NAMESPACE_CURRENT()
 get current namespace name
 

Functions

const zfcharZFNamespaceSkipGlobal (const zfchar *ns)
 skip "zf." in "zf.NS0.NS1.funcName"
 
zfbool ZFNamespaceSplit (ZFCoreArray< ZFIndexRange > &ret, const zfchar *src, zfindex srcLen=((zfindex) -1))
 util to split namespace components, similar to ZFCoreDataPairSplitString
 
void ZFNamespaceGetAllT (ZFCoreArray< zfstring > &ret)
 get all namespace
 
ZFCoreArray< zfstringZFNamespaceGetAll (void)
 see ZFNamespaceGetAllT
 
void ZFNamespaceGetAllT (ZFCoreArray< zfstring > &ret, const zfchar *parent, zfbool recursive=_ZFT_t_zffalse)
 see ZFNamespaceGetAllT
 
ZFCoreArray< zfstringZFNamespaceGetAll (const zfchar *parent, zfbool recursive=_ZFT_t_zffalse)
 see ZFNamespaceGetAllT
 

Detailed Description

namespace impl

Macro Definition Documentation

◆ ZF_NAMESPACE_CURRENT

#define ZF_NAMESPACE_CURRENT ( )

get current namespace name

note:

  • global namespace and ZFFramework's main namespace (ZF_NAMESPACE_GLOBAL) are ensured null
  • embeded namespace are supported, however, you must ensure it's valid declared by ZF_NAMESPACE_BEGIN_REGISTER
  • for embeded namespace, the namespace text are something looks like "GrandParent.Parent.Child"

Function Documentation

◆ ZFNamespaceSkipGlobal()

const zfchar * ZFNamespaceSkipGlobal ( const zfchar * ns)
extern

skip "zf." in "zf.NS0.NS1.funcName"

things to skip:

return null if everything are skipped

◆ ZFNamespaceSplit()

zfbool ZFNamespaceSplit ( ZFCoreArray< ZFIndexRange > & ret,
const zfchar * src,
zfindex srcLen = ((zfindex) -1) )
extern

util to split namespace components, similar to ZFCoreDataPairSplitString

if success, ret ensured to have at least one element even if the namespace is empty, at this case, the only one element would be ZFIndexRangeZero