add generator 'caption' property
This commit is contained in:
@@ -405,6 +405,13 @@ std::wstring util::capitalized(const std::wstring& str) {
|
||||
str.substr(1);
|
||||
}
|
||||
|
||||
std::string util::capitalized(const std::string& str) {
|
||||
if (str.empty()) return str;
|
||||
static const std::locale loc("");
|
||||
return std::string({static_cast<char>(std::toupper(str[0], loc))}) +
|
||||
str.substr(1);
|
||||
}
|
||||
|
||||
std::wstring util::pascal_case(const std::wstring& str) {
|
||||
if (str.empty()) return str;
|
||||
static const std::locale loc("");
|
||||
|
||||
@@ -71,6 +71,8 @@ namespace util {
|
||||
double parse_double(const std::string& str);
|
||||
double parse_double(const std::string& str, size_t offset, size_t len);
|
||||
|
||||
std::string capitalized(const std::string& str);
|
||||
|
||||
std::wstring lower_case(const std::wstring& str);
|
||||
std::wstring upper_case(const std::wstring& str);
|
||||
std::wstring capitalized(const std::wstring& str);
|
||||
|
||||
Reference in New Issue
Block a user