ECDebugPrint.cpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright 2005 - 2016 Zarafa and its licensors
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Affero General Public License, version 3,
  6. * as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU Affero General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Affero General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. *
  16. */
  17. #include <kopano/platform.h>
  18. #include <kopano/ECDebugPrint.h>
  19. #include <kopano/ECDebug.h>
  20. #include <kopano/charset/convert.h>
  21. #include <kopano/stringutil.h>
  22. using namespace std;
  23. namespace KC {
  24. namespace details {
  25. string conversion_helpers<string>::convert_from(const wstring &s) {
  26. return convert_to<string>(s);
  27. }
  28. string conversion_helpers<string>::stringify(LPCVOID lpVoid) {
  29. if(!lpVoid) return "NULL";
  30. char szBuff[33];
  31. sprintf(szBuff, "0x%p", lpVoid);
  32. return szBuff;
  33. }
  34. const string conversion_helpers<string>::strNULL = "NULL";
  35. const string conversion_helpers<string>::strCOMMA= ",";
  36. wstring conversion_helpers<wstring>::convert_from(const string &s) {
  37. return convert_to<wstring>(s);
  38. }
  39. wstring conversion_helpers<wstring>::stringify(LPCVOID lpVoid) {
  40. if(!lpVoid) return L"NULL";
  41. wchar_t szBuff[33];
  42. swprintf(szBuff, ARRAY_SIZE(szBuff), L"0x%p", lpVoid);
  43. return szBuff;
  44. }
  45. const wstring conversion_helpers<wstring>::strNULL = L"NULL";
  46. const wstring conversion_helpers<wstring>::strCOMMA= L",";
  47. } // namespace details
  48. } /* namespace */