refactor: refactor project
- finish document export function. - add lost database validation code in export function. - add assistant macros for convenient utilize functions located in utilities namespace. - update sqlite database open function.
This commit is contained in:
@@ -23,10 +23,12 @@ namespace VSW::Materializer::Utilities {
|
||||
/**
|
||||
* @brief Get relative address from given absolute address
|
||||
* @details This function is used when exporting function pointer into database.
|
||||
* @param[out] relative_addr_str
|
||||
* The variable holding relative address result.
|
||||
* The result is module based relative address like \c xxx.dll+0x00000000.
|
||||
* @param[in] absolute_addr The absolute address
|
||||
* @return Module based relative address like \c xxx.dll+0x00000000.
|
||||
*/
|
||||
YYCC::yycc_u8string RelativeAddress(const EnhancedReporter& reporter, const void* absolute_addr);
|
||||
void RelativeAddress(const EnhancedReporter& reporter, YYCC::yycc_u8string& relative_addr_str, const void* absolute_addr);
|
||||
void CopyStrGuid(const EnhancedReporter& reporter, YYCC::yycc_u8string& dst, const CKGUID& src);
|
||||
void CopyGuid(const EnhancedReporter& reporter, int64_t& dst, const CKGUID& src);
|
||||
void CopyCKString(
|
||||
@@ -37,4 +39,14 @@ namespace VSW::Materializer::Utilities {
|
||||
const YYCC::yycc_char8_t* fallback = YYCC::EncodingHelper::ToUTF8(NULLPTR_CKSTRING)
|
||||
);
|
||||
|
||||
#pragma region Convenient Macros
|
||||
|
||||
#define CP_ADDR(dst, src) ::VSW::Materializer::Utilities::RelativeAddress(expctx.reporter, (dst), (src))
|
||||
#define CP_STR_GUID(dst, src) ::VSW::Materializer::Utilities::CopyStrGuid(expctx.reporter, (dst), (src))
|
||||
#define CP_GUID(dst, src) ::VSW::Materializer::Utilities::CopyGuid(expctx.reporter, (dst), (src))
|
||||
#define CP_CKSTR(dst, src, ...) ::VSW::Materializer::Utilities::CopyCKString(expctx.reporter, (dst), (src), expctx.cp, ##__VA_ARGS__)
|
||||
|
||||
#pragma endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user