ustring removeAccentFromChar (ustring ch) { bool isUp = isUpperCase (ch); ch = ch.lowercase (); _size_t_ posVowel = getVowelPos (ch); if (posVowel != ustring::npos) ch = _(Vowels[posVowel]); if (isUp) ch = ch.uppercase (); return ch; }
ustring addAccentToChar (ustring ch, Accents accent) { bool isUp = isUpperCase (ch); ch = ch.lowercase (); _size_t_ pos = Vowels.find (ch); if (pos != ustring::npos) ch = _(VowelsWithAccents[pos * NUMBER_OF_ACCENTS + accent]); if (isUp) ch = ch.uppercase (); return ch; }
ustring removeMarkFromChar (ustring ch) { bool isUp = isUpperCase (ch); _size_t_ pos = getMarkedCharPos (ch); _size_t_ accent = getAccentFromChar (ch); if (pos != ustring::npos) ch = addAccentToChar (_(LettersWithoutMarks[pos]), accent); if (isUp) ch = ch.uppercase (); return ch; }
ustring addMarkToChar (ustring ch, Marks mark) { bool isUp = isUpperCase (ch); _size_t_ accent = getAccentFromChar (ch); _size_t_ pos = LettersMayChangeMarks.find (removeAccentFromChar (ch).lowercase ()); if (pos != ustring::npos) { ch = addAccentToChar (_(LettersWithMarks [mark * LettersWithoutMarks.length () + pos]), accent); if (isUp) ch = ch.uppercase (); } return ch; }
bool isUpperCase (ustring ch) { return ch.uppercase () == ch; }