ZFFramework
 
Loading...
Searching...
No Matches
ZFVersion.h
Go to the documentation of this file.
1
5
6#ifndef _ZFI_ZFVersion_h_
7#define _ZFI_ZFVersion_h_
8
9#include "ZFComparer.h"
10
12
13// ============================================================
22 ZF_OUT zfstring &ret
23 , ZF_IN const zfchar *version
24 , ZF_IN zfindex subVersionIndex
25 );
28 ZF_IN const zfchar *version
29 , ZF_IN zfindex subVersionIndex
30 ) {
31 zfstring ret;
32 ZFVersionGet(ret, version, subVersionIndex);
33 return ret;
34}
35
39 ZF_OUT zfuint &ret
40 , ZF_IN const zfchar *version
41 , ZF_IN zfindex subVersionIndex
42 );
45 ZF_IN const zfchar *version
46 , ZF_IN zfindex subVersionIndex
47 ) {
48 zfuint ret = 0;
49 ZFVersionGetInt(ret, version, subVersionIndex);
50 return ret;
51}
52
60 ZF_IN_OUT zfstring &version
61 , ZF_IN zfindex subVersionIndex
62 , ZF_IN const zfchar *subVersion
63 , ZF_IN_OPT const zfchar *emptySubVersion = "0"
64 );
69 ZF_IN_OUT zfstring &version
70 , ZF_IN zfindex subVersionIndex
71 , ZF_IN zfuint subVersion
72 , ZF_IN_OPT const zfchar *emptySubVersion = "0"
73 );
74
75// ============================================================
76extern ZFLIB_ZFCore ZFCompareResult _ZFP_ZFComparerForVersion(
77 ZF_IN const zfchar *const &v0
78 , ZF_IN const zfchar *const &v1
79 );
86#define ZFComparerForVersion _ZFP_ZFComparerForVersion
87
95 ZF_IN const zfchar *version0
96 , ZF_IN const zfchar *version1
98 );
99
100// ============================================================
101// version index
115#define ZFVERSION_MAIN() 0
117#define ZFVERSION_SUB() 1
119#define ZFVERSION_MINOR() 2
121#define ZFVERSION_BUILD() 3
122
124
125#endif // #ifndef _ZFI_ZFVersion_h_
126
common comparer for ZFFramework
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
_ZFT_t_zfchar zfchar
char wrapper
Definition ZFCoreTypeDef_CharType.h:17
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:180
#define ZF_IN_OPT
dummy macro that shows the param used as optional input
Definition ZFCoreTypeDef_ClassType.h:184
#define ZF_OUT
dummy macro that shows the param used as required output
Definition ZFCoreTypeDef_ClassType.h:188
#define ZF_IN_OUT
dummy macro that shows the param used as required input and output
Definition ZFCoreTypeDef_ClassType.h:196
_ZFT_t_zfindex zfindex
similar to size_t, used for index and size only
Definition ZFCoreTypeDef_CoreType.h:154
_ZFT_t_zfuint zfuint
same as unsigned int, see zfindex
Definition ZFCoreTypeDef_CoreType.h:169
ZFCompareResult
compare result of two ZFObjects
Definition ZFCoreTypeDef_OtherType.h:28
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
void ZFVersionGet(zfstring &ret, const zfchar *version, zfindex subVersionIndex)
get sub version at subVersionIndex
void ZFVersionGetInt(zfuint &ret, const zfchar *version, zfindex subVersionIndex)
util method to get int version value of ZFVersionGet
#define ZFComparerForVersion
default comparer for sub version compare, compared by string's integer value
Definition ZFVersion.h:86
void ZFVersionSetInt(zfstring &version, zfindex subVersionIndex, zfuint subVersion, const zfchar *emptySubVersion="0")
util method to set int version value of ZFVersionSet
ZFCompareResult ZFVersionCompare(const zfchar *version0, const zfchar *version1, ZFComparer< const zfchar * >::Comparer subVersionComparer=_ZFP_ZFComparerForVersion)
compare two version
void ZFVersionSet(zfstring &version, zfindex subVersionIndex, const zfchar *subVersion, const zfchar *emptySubVersion="0")
set sub version at subVersionIndex
ZFCompareResult(* Comparer)(T_Comparable const &e0, T_Comparable2 const &e1)
see ZFComparer
Definition ZFCoreTypeDef_OtherType.h:130