added: to convert/text
wchar_t ToLower(wchar_t c) wchar_t ToUpper(wchar_t c) void ToLower(std::wstring & s) void ToUpper(std::wstring & s) template<class StringType1, class StringType2> bool EqualNoCase(const StringType1 * str1, const StringType2 * str2) template<class StringType1, class StringType2> bool EqualNoCase(const StringType1 & str1, const StringType2 & str2) template<class StringType1, class StringType2> bool EqualNoCase(const StringType1 * str1_begin, const StringType1 * str1_end, const StringType2 * str2) added: to space: Value * GetValueNoCase(const wchar_t * name); Value * GetValueNoCase(const std::wstring & name); const Value * GetValueNoCase(const wchar_t * name) const; const Value * GetValueNoCase(const std::wstring & name) const; git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1111 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2017, Tomasz Sowa
|
||||
* Copyright (c) 2017-2018, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -153,6 +153,43 @@ bool IsDigit(wchar_t c, int base, int * digit)
|
||||
|
||||
|
||||
|
||||
wchar_t ToLower(wchar_t c)
|
||||
{
|
||||
if( c >= 'A' && c <= 'Z' )
|
||||
return c - 'A' + 'a';
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
wchar_t ToUpper(wchar_t c)
|
||||
{
|
||||
if( c >= 'a' && c <= 'z' )
|
||||
return c - 'a' + 'A';
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
void ToLower(std::wstring & s)
|
||||
{
|
||||
std::wstring::size_type i;
|
||||
|
||||
for(i=0 ; i<s.size() ; ++i)
|
||||
s[i] = ToLower(s[i]);
|
||||
}
|
||||
|
||||
|
||||
void ToUpper(std::wstring & s)
|
||||
{
|
||||
std::wstring::size_type i;
|
||||
|
||||
for(i=0 ; i<s.size() ; ++i)
|
||||
s[i] = ToUpper(s[i]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user