fix:修正unicode下的编译。
This commit is contained in:
parent
8b2905dadc
commit
65f2505515
@ -33,11 +33,11 @@ std::vector<ofString> COfStr::split(const ofString& input, const ofString& delim
|
|||||||
}
|
}
|
||||||
ofString COfStr::trim(const ofString& input)
|
ofString COfStr::trim(const ofString& input)
|
||||||
{
|
{
|
||||||
size_t start = input.find_first_not_of(" \t\n\r\f\v");
|
size_t start = input.find_first_not_of(ofT(" \t\n\r\f\v"));
|
||||||
if (start == std::string::npos) {
|
if (start == std::string::npos) {
|
||||||
return "";
|
return ofT("");
|
||||||
}
|
}
|
||||||
size_t end = input.find_last_not_of(" \t\n\r\f\v");
|
size_t end = input.find_last_not_of(ofT(" \t\n\r\f\v"));
|
||||||
return input.substr(start, end - start + 1);
|
return input.substr(start, end - start + 1);
|
||||||
}
|
}
|
||||||
} // namespace ofen
|
} // namespace ofen
|
||||||
|
@ -74,9 +74,15 @@ ofString OfUtil::now_time()
|
|||||||
#else
|
#else
|
||||||
localtime_r(&time_t_now, &tm_now);
|
localtime_r(&time_t_now, &tm_now);
|
||||||
#endif
|
#endif
|
||||||
std::ostringstream oss;
|
#ifdef UNICODE_OFSTR
|
||||||
oss << std::put_time(&tm_now, "%Y-%m-%d %H:%M:%S");
|
std::wostringstream oss;
|
||||||
|
oss << std::put_time(&tm_now, ofT("%Y-%m-%d %H:%M:%S"));
|
||||||
return oss.str();
|
return oss.str();
|
||||||
|
#else
|
||||||
|
std::ostringstream oss;
|
||||||
|
oss << std::put_time(&tm_now, ofT("%Y-%m-%d %H:%M:%S"));
|
||||||
|
return oss.str();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
Loading…
x
Reference in New Issue
Block a user