From b95dc7e61ba02fdd12b1c11142db6c7aebfffd53 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 9 Mar 2023 13:22:35 +0300 Subject: db_get_usm / getMStringU - helpers to read UTF8 strings as CMStringA --- include/m_database.h | 1 + include/m_protoint.h | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'include') diff --git a/include/m_database.h b/include/m_database.h index 1831946c67..c8921e59f0 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -388,6 +388,7 @@ EXTERN_C MIR_CORE_DLL(char*) db_get_utfa(MCONTACT hContact, const char *szMod EXTERN_C MIR_CORE_DLL(wchar_t*) db_get_wsa(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szValue = nullptr); MIR_CORE_DLL(CMStringA) db_get_sm(MCONTACT hContact, const char *szModule, const char *szSetting, const char *szValue = nullptr); +MIR_CORE_DLL(CMStringA) db_get_usm(MCONTACT hContact, const char *szModule, const char *szSetting, const char *szValue = nullptr); MIR_CORE_DLL(CMStringW) db_get_wsm(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szValue = nullptr); EXTERN_C MIR_CORE_DLL(int) db_get_static(MCONTACT hContact, const char *szModule, const char *szSetting, char *pDest, int cbDest); diff --git a/include/m_protoint.h b/include/m_protoint.h index f4dbf2473a..55ff3a5949 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -162,6 +162,11 @@ public: __forceinline CMStringA getMStringA(MCONTACT hContact, const char *name, const char *szValue = nullptr) { return db_get_sm(hContact, m_szModuleName, name, szValue); } + __forceinline CMStringA getMStringU(const char *name, const char *szValue = nullptr) { + return db_get_usm(0, m_szModuleName, name, szValue); } + __forceinline CMStringA getMStringU(MCONTACT hContact, const char *name, const char *szValue = nullptr) { + return db_get_usm(hContact, m_szModuleName, name, szValue); } + __forceinline CMStringW getMStringW(const char *name, const wchar_t *szValue = nullptr) { return db_get_wsm(0, m_szModuleName, name, szValue); } __forceinline CMStringW getMStringW(MCONTACT hContact, const char *name, const wchar_t *szValue = nullptr) { -- cgit v1.2.3