Support string.toupper and string.tolower.

This commit is contained in:
Wilson Snyder
2019-11-17 05:05:09 -05:00
parent d480c2f033
commit 0c0198cf55
8 changed files with 116 additions and 9 deletions
+16 -1
View File
@@ -1754,7 +1754,22 @@ const char* vl_mc_scan_plusargs(const char* prefixp) VL_MT_SAFE {
}
//===========================================================================
// Heavy functions
// Heavy string functions
std::string VL_TOLOWER_NN(const std::string& ld) VL_MT_SAFE {
std::string out = ld;
for (std::string::iterator it = out.begin(); it != out.end(); ++it) {
*it = tolower(*it);
}
return out;
}
std::string VL_TOUPPER_NN(const std::string& ld) VL_MT_SAFE {
std::string out = ld;
for (std::string::iterator it = out.begin(); it != out.end(); ++it) {
*it = toupper(*it);
}
return out;
}
std::string VL_CVT_PACK_STR_NW(int lwords, WDataInP lwp) VL_MT_SAFE {
// See also _VL_VINT_TO_STRING