From c2b21668af643baedd2e90ad91f118e1442d7ac2 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 27 Oct 2016 21:21:57 +1100 Subject: Tidy CaseMapString by moving some mechanics into CaseConvert. Use StringEncode and StringDecode more and make more likely to be optimized. --- src/CaseConvert.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/CaseConvert.cxx') diff --git a/src/CaseConvert.cxx b/src/CaseConvert.cxx index 63a27222b..e84fbdab4 100644 --- a/src/CaseConvert.cxx +++ b/src/CaseConvert.cxx @@ -630,6 +630,14 @@ size_t CaseConvertString(char *converted, size_t sizeConverted, const char *mixe return pCaseConv->CaseConvertString(converted, sizeConverted, mixed, lenMixed); } +std::string CaseConvertString(const std::string &s, enum CaseConversion conversion) { + std::string retMapped(s.length() * maxExpansionCaseConversion, 0); + size_t lenMapped = CaseConvertString(&retMapped[0], retMapped.length(), s.c_str(), s.length(), + conversion); + retMapped.resize(lenMapped); + return retMapped; +} + #ifdef SCI_NAMESPACE } #endif -- cgit v1.2.3