change StdString function's name

This commit is contained in:
hyzboy 2019-11-29 11:59:32 +08:00
parent be7b35f383
commit d8e2bde533
2 changed files with 8 additions and 10 deletions

View File

@ -5,30 +5,30 @@
#include<hgl/CodePage.h> #include<hgl/CodePage.h>
#if HGL_OS == HGL_OS_Windows #if HGL_OS == HGL_OS_Windows
inline hgl::OSString ToOSString(const std::string &str) inline hgl::OSString std_to_os(const std::string &str)
{ {
return hgl::to_u16(str.c_str(),(int)(str.length())); return hgl::to_u16(str.c_str(),(int)(str.length()));
} }
inline std::string ToStdString(const hgl::OSString &str) inline std::string to_std(const hgl::OSString &str)
{ {
hgl::UTF8String u8_str=hgl::to_u8(str); hgl::UTF8String u8_str=hgl::to_u8(str);
return std::string(u8_str.c_str()); return std::string(u8_str.c_str());
} }
#else #else
inline hgl::OSString ToOSString(const std::string &str) inline hgl::OSString std_to_os(const std::string &str)
{ {
return hgl::OSString(str.c_str(),str.size()); return hgl::OSString(str.c_str(),str.size());
} }
inline std::string ToStdString(const hgl::OSString &str) inline std::string to_std(const hgl::OSString &str)
{ {
return std::string(str.c_str()); return std::string(str.c_str());
} }
#endif// #endif//
inline hgl::UTF8String ToUTF8String(const std::string &str) inline hgl::UTF8String std_to_u8(const std::string &str)
{ {
return hgl::UTF8String(str.c_str(),int(str.size())); return hgl::UTF8String(str.c_str(),int(str.size()));
} }

View File

@ -55,18 +55,16 @@ file(GLOB BASE_LOG_SOURCE Log/*.*)
SOURCE_GROUP("Log\\Header Files" FILES ${BASE_LOG_HEADER}) SOURCE_GROUP("Log\\Header Files" FILES ${BASE_LOG_HEADER})
SOURCE_GROUP("Log\\Source Files" FILES ${BASE_LOG_SOURCE}) SOURCE_GROUP("Log\\Source Files" FILES ${BASE_LOG_SOURCE})
add_library(CMCore STATIC #${SYSTEM_INFO_SOURCE} add_cm_library(CMCore "CM" #${SYSTEM_INFO_SOURCE}
${TYPE_TEMPLATE_HEADER} ${TYPE_TEMPLATE_HEADER}
${BASE_TYPE_SOURCE} ${BASE_TYPE_SOURCE}
${BASE_IO_SOURCE} ${BASE_IO_SOURCE}
${BASE_FILE_SYSTEM_SOURCE} ${BASE_FILE_SYSTEM_SOURCE}
${BASE_OTHER_SOURCE} ${BASE_OTHER_SOURCE}
${BASE_PLUG_IN_HEADER} ${BASE_PLUG_IN_HEADER}
${BASE_PLUG_IN_SOURCE} ${BASE_PLUG_IN_SOURCE}
${BASE_LOG_HEADER} ${BASE_LOG_HEADER}
${BASE_LOG_SOURCE} ${BASE_LOG_SOURCE}
) )
set_property(TARGET CMCore PROPERTY FOLDER "CM")