|
Shinya Kitaoka |
810553 |
#pragma once
|
|
Shinya Kitaoka |
810553 |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef igs_resource_msg_from_err_h
|
|
Toshihiro Shimizu |
890ddd |
#define igs_resource_msg_from_err_h
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include <string></string>
|
|
Toshihiro Shimizu |
890ddd |
#include "igs_os_type.h" /* windows.h... */
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#define igs_tostr(n) igs_tostr_(n) /* __LINE__ --> 56 */
|
|
Shinya Kitaoka |
120a6e |
#define igs_tostr_(n) #n /* 56 --> "56" */
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef IGS_RESOURCE_LOG_EXPORT
|
|
Toshihiro Shimizu |
890ddd |
#define IGS_RESOURCE_LOG_EXPORT
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
/*------ 文字コード変換 --------------------------------------------*/
|
|
Shinya Kitaoka |
120a6e |
namespace igs {
|
|
Shinya Kitaoka |
120a6e |
namespace resource {
|
|
Toshihiro Shimizu |
890ddd |
/*--- localeを日本に設定し日本語を扱うことを指示 ---*/
|
|
Toshihiro Shimizu |
890ddd |
IGS_RESOURCE_LOG_EXPORT void locale_to_jp(void);
|
|
Toshihiro Shimizu |
890ddd |
/*--- マルチバイト文字列 --> ワイド文字文字列 ---*/
|
|
Shinya Kitaoka |
120a6e |
IGS_RESOURCE_LOG_EXPORT void mbs_to_wcs(const std::string &mbs,
|
|
Shinya Kitaoka |
120a6e |
std::wstring &wcs,
|
|
Shinya Kitaoka |
120a6e |
const UINT code_page = CP_THREAD_ACP);
|
|
Toshihiro Shimizu |
890ddd |
/*--- ワイド文字文字列 --> マルチバイト文字列 ---*/
|
|
Shinya Kitaoka |
120a6e |
IGS_RESOURCE_LOG_EXPORT void wcs_to_mbs(const std::wstring &wcs,
|
|
Shinya Kitaoka |
120a6e |
std::string &mbs,
|
|
Shinya Kitaoka |
120a6e |
const UINT code_page = CP_THREAD_ACP);
|
|
Toshihiro Shimizu |
890ddd |
/*
|
|
Shinya Kitaoka |
120a6e |
2012-08-22 呼び側の名前も変更
|
|
Shinya Kitaoka |
120a6e |
from_mbcs(-) --> ts_from_mbs(-)
|
|
Shinya Kitaoka |
120a6e |
mbcs_from(-) --> mbs_from_ts(-)
|
|
Toshihiro Shimizu |
890ddd |
*/
|
|
Toshihiro Shimizu |
890ddd |
/*--- UNICODE宣言ならマルチバイト文字列をワイド文字文字列に変換 ---*/
|
|
Shinya Kitaoka |
120a6e |
const std::basic_string<tchar> ts_from_mbs(</tchar>
|
|
Shinya Kitaoka |
120a6e |
const std::string &mbs, const UINT code_page = CP_THREAD_ACP);
|
|
Toshihiro Shimizu |
890ddd |
/*--- UNICODE宣言ならワイド文字文字列をマルチバイト文字列に変換 ---*/
|
|
Shinya Kitaoka |
120a6e |
const std::string mbs_from_ts(const std::basic_string<tchar> &ts,</tchar>
|
|
Shinya Kitaoka |
120a6e |
const UINT code_page = CP_THREAD_ACP);
|
|
Toshihiro Shimizu |
890ddd |
/*--- cp932を含む文字列をutf-8に変換(mbcsのみ) ---*/
|
|
Toshihiro Shimizu |
890ddd |
const std::string utf8_from_cp932_mb(const std::string &text);
|
|
Toshihiro Shimizu |
890ddd |
/*--- utf-8を含む文字列をcp932に変換(mbcsのみ) ---*/
|
|
Toshihiro Shimizu |
890ddd |
const std::string cp932_from_utf8_mb(const std::string &text);
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
/*------ エラーメッセージ表示 --------------------------------------*/
|
|
Shinya Kitaoka |
120a6e |
namespace igs {
|
|
Shinya Kitaoka |
120a6e |
namespace resource {
|
|
Toshihiro Shimizu |
890ddd |
const std::string msg_from_err_(/* 直によんではいけない */
|
|
Shinya Kitaoka |
120a6e |
const std::basic_string<tchar> &tit,</tchar>
|
|
Shinya Kitaoka |
120a6e |
const DWORD error_message_id,
|
|
Shinya Kitaoka |
120a6e |
const std::basic_string<tchar> &file,</tchar>
|
|
Shinya Kitaoka |
120a6e |
const std::basic_string<tchar> &line,</tchar>
|
|
Shinya Kitaoka |
120a6e |
const std::basic_string<tchar> &funcsig,</tchar>
|
|
Shinya Kitaoka |
120a6e |
const std::basic_string<tchar> &comp_type,</tchar>
|
|
Shinya Kitaoka |
120a6e |
const std::basic_string<tchar> &msc_full_ver,</tchar>
|
|
Shinya Kitaoka |
120a6e |
const std::basic_string<tchar> &date,</tchar>
|
|
Shinya Kitaoka |
120a6e |
const std::basic_string<tchar> &time);</tchar>
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
/*--- ::GetLastError()値からエラーメッセージを得る ---*/
|
|
Shinya Kitaoka |
120a6e |
#define igs_resource_msg_from_err(tit, error_message_id) \
|
|
Shinya Kitaoka |
120a6e |
igs::resource::msg_from_err_( \
|
|
Shinya Kitaoka |
120a6e |
tit, error_message_id, TEXT(__FILE__), TEXT(igs_tostr(__LINE__)), \
|
|
Shinya Kitaoka |
120a6e |
TEXT(__FUNCSIG__), TEXT(igs_tostr_(_MSC_VER)), \
|
|
Shinya Kitaoka |
120a6e |
TEXT(igs_tostr(_MSC_FULL_VER)), TEXT(__DATE__), TEXT(__TIME__))
|
|
Toshihiro Shimizu |
890ddd |
/*--- エラーメッセージを得る ---*/
|
|
Shinya Kitaoka |
120a6e |
#define igs_resource_msg_from_er(tit) \
|
|
Shinya Kitaoka |
120a6e |
igs::resource::msg_from_err_( \
|
|
Shinya Kitaoka |
120a6e |
tit, NO_ERROR, TEXT(__FILE__), TEXT(igs_tostr(__LINE__)), \
|
|
Shinya Kitaoka |
120a6e |
TEXT(__FUNCSIG__), TEXT(igs_tostr_(_MSC_VER)), \
|
|
Shinya Kitaoka |
120a6e |
TEXT(igs_tostr(_MSC_FULL_VER)), TEXT(__DATE__), TEXT(__TIME__))
|
|
Toshihiro Shimizu |
890ddd |
#endif /* !igs_resource_msg_from_err_h */
|