diff options
author | mcheshkov <mcheshkov@yandex-team.ru> | 2022-02-10 16:46:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:15 +0300 |
commit | e9d19cec64684c9c1e6b0c98297e5b895cf904fe (patch) | |
tree | 2768b1223e96a8a0610a93d18425d9647c1123c8 /contrib/libs/icu/common/uresdata.h | |
parent | 60040c91ffe701a84689b2c6310ff845e65cff42 (diff) | |
download | ydb-e9d19cec64684c9c1e6b0c98297e5b895cf904fe.tar.gz |
Restoring authorship annotation for <mcheshkov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/icu/common/uresdata.h')
-rw-r--r-- | contrib/libs/icu/common/uresdata.h | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/contrib/libs/icu/common/uresdata.h b/contrib/libs/icu/common/uresdata.h index d1b67babf2..23d04432bc 100644 --- a/contrib/libs/icu/common/uresdata.h +++ b/contrib/libs/icu/common/uresdata.h @@ -1,4 +1,4 @@ -// © 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** @@ -6,7 +6,7 @@ * Corporation and others. All Rights Reserved. ****************************************************************************** * file name: uresdata.h -* encoding: UTF-8 +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -69,16 +69,16 @@ typedef uint32_t Resource; #define RES_GET_OFFSET(res) ((res)&0x0fffffff) #define RES_GET_POINTER(pRoot, res) ((pRoot)+RES_GET_OFFSET(res)) -/* get signed and unsigned integer values directly from the Resource handle - * NOTE: For proper logging, please use the res_getInt() constexpr - */ +/* get signed and unsigned integer values directly from the Resource handle + * NOTE: For proper logging, please use the res_getInt() constexpr + */ #if U_SIGNED_RIGHT_SHIFT_IS_ARITHMETIC -# define RES_GET_INT_NO_TRACE(res) (((int32_t)((res)<<4L))>>4L) +# define RES_GET_INT_NO_TRACE(res) (((int32_t)((res)<<4L))>>4L) #else -# define RES_GET_INT_NO_TRACE(res) (int32_t)(((res)&0x08000000) ? (res)|0xf0000000 : (res)&0x07ffffff) +# define RES_GET_INT_NO_TRACE(res) (int32_t)(((res)&0x08000000) ? (res)|0xf0000000 : (res)&0x07ffffff) #endif -#define RES_GET_UINT_NO_TRACE(res) ((res)&0x0fffffff) +#define RES_GET_UINT_NO_TRACE(res) ((res)&0x0fffffff) #define URES_IS_ARRAY(type) ((int32_t)(type)==URES_ARRAY || (int32_t)(type)==URES_ARRAY16) #define URES_IS_TABLE(type) ((int32_t)(type)==URES_TABLE || (int32_t)(type)==URES_TABLE16 || (int32_t)(type)==URES_TABLE32) @@ -425,27 +425,27 @@ res_unload(ResourceData *pResData); U_INTERNAL UResType U_EXPORT2 res_getPublicType(Resource res); -/////////////////////////////////////////////////////////////////////////// -// To enable tracing, use the inline versions of the res_get* functions. // -/////////////////////////////////////////////////////////////////////////// - +/////////////////////////////////////////////////////////////////////////// +// To enable tracing, use the inline versions of the res_get* functions. // +/////////////////////////////////////////////////////////////////////////// + /* * Return a pointer to a zero-terminated, const UChar* string * and set its length in *pLength. * Returns NULL if not found. */ U_INTERNAL const UChar * U_EXPORT2 -res_getStringNoTrace(const ResourceData *pResData, Resource res, int32_t *pLength); +res_getStringNoTrace(const ResourceData *pResData, Resource res, int32_t *pLength); U_INTERNAL const uint8_t * U_EXPORT2 -res_getBinaryNoTrace(const ResourceData *pResData, Resource res, int32_t *pLength); +res_getBinaryNoTrace(const ResourceData *pResData, Resource res, int32_t *pLength); U_INTERNAL const int32_t * U_EXPORT2 -res_getIntVectorNoTrace(const ResourceData *pResData, Resource res, int32_t *pLength); - -U_INTERNAL const UChar * U_EXPORT2 -res_getAlias(const ResourceData *pResData, Resource res, int32_t *pLength); +res_getIntVectorNoTrace(const ResourceData *pResData, Resource res, int32_t *pLength); +U_INTERNAL const UChar * U_EXPORT2 +res_getAlias(const ResourceData *pResData, Resource res, int32_t *pLength); + U_INTERNAL Resource U_EXPORT2 res_getResource(const ResourceData *pResData, const char *key); @@ -476,55 +476,55 @@ U_CFUNC Resource res_findResource(const ResourceData *pResData, Resource r, #ifdef __cplusplus #include "resource.h" -#include "restrace.h" +#include "restrace.h" U_NAMESPACE_BEGIN -inline const UChar* res_getString(const ResourceTracer& traceInfo, - const ResourceData *pResData, Resource res, int32_t *pLength) { - traceInfo.trace("string"); - return res_getStringNoTrace(pResData, res, pLength); -} - -inline const uint8_t* res_getBinary(const ResourceTracer& traceInfo, - const ResourceData *pResData, Resource res, int32_t *pLength) { - traceInfo.trace("binary"); - return res_getBinaryNoTrace(pResData, res, pLength); -} - -inline const int32_t* res_getIntVector(const ResourceTracer& traceInfo, - const ResourceData *pResData, Resource res, int32_t *pLength) { - traceInfo.trace("intvector"); - return res_getIntVectorNoTrace(pResData, res, pLength); -} - -inline int32_t res_getInt(const ResourceTracer& traceInfo, Resource res) { - traceInfo.trace("int"); - return RES_GET_INT_NO_TRACE(res); -} - -inline uint32_t res_getUInt(const ResourceTracer& traceInfo, Resource res) { - traceInfo.trace("uint"); - return RES_GET_UINT_NO_TRACE(res); -} - +inline const UChar* res_getString(const ResourceTracer& traceInfo, + const ResourceData *pResData, Resource res, int32_t *pLength) { + traceInfo.trace("string"); + return res_getStringNoTrace(pResData, res, pLength); +} + +inline const uint8_t* res_getBinary(const ResourceTracer& traceInfo, + const ResourceData *pResData, Resource res, int32_t *pLength) { + traceInfo.trace("binary"); + return res_getBinaryNoTrace(pResData, res, pLength); +} + +inline const int32_t* res_getIntVector(const ResourceTracer& traceInfo, + const ResourceData *pResData, Resource res, int32_t *pLength) { + traceInfo.trace("intvector"); + return res_getIntVectorNoTrace(pResData, res, pLength); +} + +inline int32_t res_getInt(const ResourceTracer& traceInfo, Resource res) { + traceInfo.trace("int"); + return RES_GET_INT_NO_TRACE(res); +} + +inline uint32_t res_getUInt(const ResourceTracer& traceInfo, Resource res) { + traceInfo.trace("uint"); + return RES_GET_UINT_NO_TRACE(res); +} + class ResourceDataValue : public ResourceValue { public: - ResourceDataValue() : - res(static_cast<Resource>(URES_NONE)), - fTraceInfo() {} + ResourceDataValue() : + res(static_cast<Resource>(URES_NONE)), + fTraceInfo() {} virtual ~ResourceDataValue(); - void setData(const ResourceData *data) { - resData = *data; - } - - void setResource(Resource r, ResourceTracer&& traceInfo) { - res = r; - fTraceInfo = traceInfo; - } + void setData(const ResourceData *data) { + resData = *data; + } - const ResourceData &getData() const { return resData; } + void setResource(Resource r, ResourceTracer&& traceInfo) { + res = r; + fTraceInfo = traceInfo; + } + + const ResourceData &getData() const { return resData; } virtual UResType getType() const; virtual const UChar *getString(int32_t &length, UErrorCode &errorCode) const; virtual const UChar *getAliasString(int32_t &length, UErrorCode &errorCode) const; @@ -542,11 +542,11 @@ public: virtual UnicodeString getStringOrFirstOfArray(UErrorCode &errorCode) const; private: - // TODO(ICU-20769): If UResourceBundle.fResData becomes a pointer, - // then remove this value field again and just store a pResData pointer. - ResourceData resData; + // TODO(ICU-20769): If UResourceBundle.fResData becomes a pointer, + // then remove this value field again and just store a pResData pointer. + ResourceData resData; Resource res; - ResourceTracer fTraceInfo; + ResourceTracer fTraceInfo; }; U_NAMESPACE_END |