27 #pragma warning (push)
28 #pragma warning (disable: 4514 4996)
119 auto d = (
unsigned int) (
digit -
'0');
121 if (d < (
unsigned int) 10)
124 d += (
unsigned int) (
'0' -
'a');
126 if (d < (
unsigned int) 6)
129 d += (
unsigned int) (
'a' -
'A');
131 if (d < (
unsigned int) 6)
137double CharacterFunctions::mulexp10 (
const double value,
int exponent)
noexcept
145 const bool negative = (
exponent < 0);
150 double result = 1.0,
power = 10.0;
166 return negative ? (value / result) : (value * result);
172 return (juce_wchar)
c;
174 static const uint16 lookup[] = { 0x20AC, 0x0007, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
175 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0007, 0x017D, 0x0007,
176 0x0007, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
177 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0007, 0x017E, 0x0178 };
179 return (juce_wchar)
lookup[
c - 0x80];
188#define STR(value) QUOTE(value)
189#define ASYM_STRING_DOUBLE_PAIR(str, value) std::pair<String, double> (STR(str), value)
190#define STRING_DOUBLE_PAIR(value) ASYM_STRING_DOUBLE_PAIR(value, value)
191#define STRING_DOUBLE_PAIR_COMBOS(value) \
192 STRING_DOUBLE_PAIR(value), \
193 STRING_DOUBLE_PAIR(-value), \
194 ASYM_STRING_DOUBLE_PAIR(+value, value), \
195 ASYM_STRING_DOUBLE_PAIR(000000 ## value, value), \
196 ASYM_STRING_DOUBLE_PAIR(+000 ## value, value), \
197 ASYM_STRING_DOUBLE_PAIR(-0 ## value, -value)
203 :
UnitTest (
"CharacterFunctions", UnitTestCategories::text)
206 void runTest()
override
208 beginTest (
"readDoubleValue");
210 static const std::pair<String, double>
testValues[] =
278 String
nans[] = {
"NaN",
"-nan",
"+NAN",
"1.0E1024",
"-1.0E-999",
"1.23456789012345678901234567890e123456789"};
288 String
infs[] = {
"Inf",
"-inf",
"INF"};
299static CharacterFunctionsTests characterFunctionsTests;
static juce_wchar toLowerCase(juce_wchar character) noexcept
static bool isDigit(char character) noexcept
static bool isLowerCase(juce_wchar character) noexcept
static bool isLetter(char character) noexcept
static double readDoubleValue(CharPointerType &text) noexcept
static int getHexDigitValue(juce_wchar digit) noexcept
static bool isWhitespace(char character) noexcept
static bool isLetterOrDigit(char character) noexcept
static juce_wchar toUpperCase(juce_wchar character) noexcept
static bool isUpperCase(juce_wchar character) noexcept
static bool isPrintable(char character) noexcept
static juce_wchar getUnicodeCharFromWindows1252Codepage(uint8 windows1252Char) noexcept