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

output callback util More...

#include "ZFObject.h"

Go to the source code of this file.

Classes

class  v_ZFOutputFormatStep
 see ZFOutputForFormat More...
 
class  ZFOutputFormat
 see ZFOutputForFormat More...
 
class  ZFOutputFormatBasic
 basic output format More...
 

Macros

#define ZFCallbackSerializeType_ZFOutputForFormat
 see ZFCALLBACK_SERIALIZE_TYPE_DEFINE
 
#define ZFSerializableKeyword_ZFOutputForFormat_output
 keyword for serialize
 
#define ZFSerializableKeyword_ZFOutputForFormat_format
 keyword for serialize
 

Typedefs

typedef v_ZFOutputFormatStep::ZFEnumType ZFOutputFormatStep
 see v_ZFOutputFormatStep
 

Functions

zfbool ZFOutputFormatStepFromStringT (zfauto &ret, const zfchar *src, zfindex srcLen=((zfindex) -1), zfstring *errorHint=zft_zfnull)
 see v_ZFOutputFormatStep, return enum object if success
 
zfbool ZFOutputFormatStepToStringT (zfstring &ret, v_ZFOutputFormatStep *const &value, zfstring *errorHint=zft_zfnull)
 see ZFOutputFormatStep, return empty string if error
 
zfstring ZFOutputFormatStepToString (v_ZFOutputFormatStep *const &value, zfstring *errorHint=zft_zfnull)
 see v_ZFOutputFormatStep, return empty string if error
 
const zfstringZFTypeId_ZFOutputFormatStep (void)
 
zfbool ZFOutputFormatStepFromDataT (_ZFP_PropTypeW_ZFOutputFormatStep &v, const ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializableData *outErrorPos=zft_zfnull)
 see ZFTYPEID_DECLARE
 
_ZFP_PropTypeW_ZFOutputFormatStep ZFOutputFormatStepFromData (const ZFSerializableData &serializableData, zfstring *outErrorHint=zft_zfnull, ZFSerializableData *outErrorPos=zft_zfnull)
 see ZFTYPEID_DECLARE
 
zfbool ZFOutputFormatStepToDataT (ZFSerializableData &serializableData, _ZFP_PropTypeW_ZFOutputFormatStep const &v, zfstring *outErrorHint=zft_zfnull)
 see ZFTYPEID_DECLARE
 
ZFSerializableData ZFOutputFormatStepToData (_ZFP_PropTypeW_ZFOutputFormatStep const &v, zfstring *outErrorHint=zft_zfnull)
 see ZFTYPEID_DECLARE
 
zfbool ZFOutputFormatStepFromStringT (_ZFP_PropTypeW_ZFOutputFormatStep &v, const zfchar *src, zfindex srcLen=((zfindex) -1), zfstring *errorHint=zft_zfnull)
 util method to convert ZFOutputFormatStep from string
 
_ZFP_PropTypeW_ZFOutputFormatStep ZFOutputFormatStepFromString (const zfchar *src, zfindex srcLen=((zfindex) -1), zfstring *errorHint=zft_zfnull)
 util method to convert ZFOutputFormatStep from string
 
zfbool ZFOutputFormatStepToStringT (zfstring &s, _ZFP_PropTypeW_ZFOutputFormatStep const &v, zfstring *errorHint=zft_zfnull)
 util method to convert ZFOutputFormatStep to string
 
zfstring ZFOutputFormatStepToString (_ZFP_PropTypeW_ZFOutputFormatStep const &v, zfstring *errorHint=zft_zfnull)
 util method to convert ZFOutputFormatStep to string
 
zfbool ZFOutputForFormatT (ZFCallback &ret, const ZFOutput &output, ZFOutputFormat *format)
 see ZFOutputForFormat
 
ZFOutput ZFOutputForFormat (const ZFOutput &output, ZFOutputFormat *format)
 create an output callback with specified format rule
 

Detailed Description

output callback util

Macro Definition Documentation

◆ ZFCallbackSerializeType_ZFOutputForFormat

#define ZFCallbackSerializeType_ZFOutputForFormat

see ZFCALLBACK_SERIALIZE_TYPE_DEFINE

serializable data:

<ZFCallback callbackType="ZFOutputForFormat">
<ZFCallback category="output" ... /> // the output
<YourOutputFormat category="format" ... /> // the format object
callback used by ZFFramework
Definition ZFCallback.h:96

Function Documentation

◆ ZFTypeId_ZFOutputFormatStep()

const zfstring & ZFTypeId_ZFOutputFormatStep ( void )
inline


◆ ZFOutputForFormat()

ZFOutput ZFOutputForFormat ( const ZFOutput & output,
ZFOutputFormat * format )
extern

create an output callback with specified format rule

each time before anything would be outputed to the original output, it would be processed by the format object to determin the final output

note:

  • the original output and the format object would be retained by the result output until it's destroyed
  • the result output is serializable if both the original output and the format object are serializable
  • serialization may cause performance issue, you may use ZFOutputForFormatT and ZFCallback::callbackSerializeDisable to disable the default serialization step, see ZFCallbackSerializeType_ZFInputForPathInfo for more info
  • if output success, the original output size would be returned, instead of the formated size