#include "nel/gui/string_case.h" namespace NLGUI { inline bool isSeparator (ucchar c) { return (c == ' ') || (c == '\t') || (c == '\n') || (c == '\r'); } // *************************************************************************** inline bool isEndSentence (ucstring& str, uint index) { // Ex: One sentence. Another sentence. // ^ // Counterexample: nevrax.com // ^ ucchar c = str[index]; if ((str[index] == ' ') || (str[index] == '\n')) { if (index < 1) return false; c = str[index-1]; return (c == '.') || (c == '!') || (c == '?'); } return false; } void setCase( ucstring &str, TCaseMode mode ) { const uint length = (uint)str.length(); uint i; bool newString = true; bool newSentence = true; bool newWord = true; switch (mode) { case CaseLower: str = NLMISC::toLower (str); break; case CaseUpper: str = NLMISC::toUpper (str); break; case CaseFirstStringLetterUp: for (i=0; i