The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

757 lines
25KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. The code included in this file is provided under the terms of the ISC license
  8. http://www.isc.org/downloads/software-support-policy/isc-license. Permission
  9. To use, copy, modify, and/or distribute this software for any purpose with or
  10. without fee is hereby granted provided that the above copyright notice and
  11. this permission notice appear in all copies.
  12. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  13. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  14. DISCLAIMED.
  15. ==============================================================================
  16. */
  17. namespace juce
  18. {
  19. //==============================================================================
  20. #if JUCE_WINDOWS && ! DOXYGEN
  21. #define JUCE_NATIVE_WCHAR_IS_UTF8 0
  22. #define JUCE_NATIVE_WCHAR_IS_UTF16 1
  23. #define JUCE_NATIVE_WCHAR_IS_UTF32 0
  24. #else
  25. /** This macro will be set to 1 if the compiler's native wchar_t is an 8-bit type. */
  26. #define JUCE_NATIVE_WCHAR_IS_UTF8 0
  27. /** This macro will be set to 1 if the compiler's native wchar_t is a 16-bit type. */
  28. #define JUCE_NATIVE_WCHAR_IS_UTF16 0
  29. /** This macro will be set to 1 if the compiler's native wchar_t is a 32-bit type. */
  30. #define JUCE_NATIVE_WCHAR_IS_UTF32 1
  31. #endif
  32. #if JUCE_NATIVE_WCHAR_IS_UTF32 || DOXYGEN
  33. /** A platform-independent 32-bit unicode character type. */
  34. typedef wchar_t juce_wchar;
  35. #else
  36. typedef uint32 juce_wchar;
  37. #endif
  38. #ifndef DOXYGEN
  39. /** This macro is deprecated, but preserved for compatibility with old code. */
  40. #define JUCE_T(stringLiteral) (L##stringLiteral)
  41. #endif
  42. #if JUCE_DEFINE_T_MACRO
  43. /** The 'T' macro is an alternative for using the "L" prefix in front of a string literal.
  44. This macro is deprecated, but available for compatibility with old code if you set
  45. JUCE_DEFINE_T_MACRO = 1. The fastest, most portable and best way to write your string
  46. literals is as standard char strings, using escaped utf-8 character sequences for extended
  47. characters, rather than trying to store them as wide-char strings.
  48. */
  49. #define T(stringLiteral) JUCE_T(stringLiteral)
  50. #endif
  51. //==============================================================================
  52. // GNU libstdc++ does not have std::make_unsigned
  53. namespace internal
  54. {
  55. template <typename Type> struct make_unsigned { typedef Type type; };
  56. template <> struct make_unsigned<signed char> { typedef unsigned char type; };
  57. template <> struct make_unsigned<char> { typedef unsigned char type; };
  58. template <> struct make_unsigned<short> { typedef unsigned short type; };
  59. template <> struct make_unsigned<int> { typedef unsigned int type; };
  60. template <> struct make_unsigned<long> { typedef unsigned long type; };
  61. template <> struct make_unsigned<long long> { typedef unsigned long long type; };
  62. }
  63. //==============================================================================
  64. /**
  65. A collection of functions for manipulating characters and character strings.
  66. Most of these methods are designed for internal use by the String and CharPointer
  67. classes, but some of them may be useful to call directly.
  68. @see String, CharPointer_UTF8, CharPointer_UTF16, CharPointer_UTF32
  69. */
  70. class JUCE_API CharacterFunctions
  71. {
  72. public:
  73. //==============================================================================
  74. /** Converts a character to upper-case. */
  75. static juce_wchar toUpperCase (juce_wchar character) noexcept;
  76. /** Converts a character to lower-case. */
  77. static juce_wchar toLowerCase (juce_wchar character) noexcept;
  78. /** Checks whether a unicode character is upper-case. */
  79. static bool isUpperCase (juce_wchar character) noexcept;
  80. /** Checks whether a unicode character is lower-case. */
  81. static bool isLowerCase (juce_wchar character) noexcept;
  82. /** Checks whether a character is whitespace. */
  83. static bool isWhitespace (char character) noexcept;
  84. /** Checks whether a character is whitespace. */
  85. static bool isWhitespace (juce_wchar character) noexcept;
  86. /** Checks whether a character is a digit. */
  87. static bool isDigit (char character) noexcept;
  88. /** Checks whether a character is a digit. */
  89. static bool isDigit (juce_wchar character) noexcept;
  90. /** Checks whether a character is alphabetic. */
  91. static bool isLetter (char character) noexcept;
  92. /** Checks whether a character is alphabetic. */
  93. static bool isLetter (juce_wchar character) noexcept;
  94. /** Checks whether a character is alphabetic or numeric. */
  95. static bool isLetterOrDigit (char character) noexcept;
  96. /** Checks whether a character is alphabetic or numeric. */
  97. static bool isLetterOrDigit (juce_wchar character) noexcept;
  98. /** Checks whether a character is a printable character, i.e. alphabetic, numeric,
  99. a punctuation character or a space.
  100. */
  101. static bool isPrintable (char character) noexcept;
  102. /** Checks whether a character is a printable character, i.e. alphabetic, numeric,
  103. a punctuation character or a space.
  104. */
  105. static bool isPrintable (juce_wchar character) noexcept;
  106. /** Returns 0 to 16 for '0' to 'F", or -1 for characters that aren't a legal hex digit. */
  107. static int getHexDigitValue (juce_wchar digit) noexcept;
  108. /** Converts a byte of Windows 1252 codepage to unicode. */
  109. static juce_wchar getUnicodeCharFromWindows1252Codepage (uint8 windows1252Char) noexcept;
  110. //==============================================================================
  111. /** Parses a character string to read a floating-point number.
  112. Note that this will advance the pointer that is passed in, leaving it at
  113. the end of the number.
  114. */
  115. template <typename CharPointerType>
  116. static double readDoubleValue (CharPointerType& text) noexcept
  117. {
  118. #if JUCE_MINGW
  119. bool isNegative = false;
  120. #else
  121. JUCE_CONSTEXPR const int maxSignificantDigits = 17 + 1; // An additional digit for rounding
  122. JUCE_CONSTEXPR const int bufferSize = maxSignificantDigits + 7 + 1; // -.E-XXX and a trailing null-terminator
  123. char buffer[bufferSize] = {};
  124. char* currentCharacter = &(buffer[0]);
  125. #endif
  126. text = text.findEndOfWhitespace();
  127. auto c = *text;
  128. switch (c)
  129. {
  130. case '-':
  131. #if JUCE_MINGW
  132. isNegative = true;
  133. #else
  134. *currentCharacter++ = '-';
  135. #endif
  136. // Fall-through..
  137. case '+':
  138. c = *++text;
  139. }
  140. switch (c)
  141. {
  142. case 'n':
  143. case 'N':
  144. if ((text[1] == 'a' || text[1] == 'A') && (text[2] == 'n' || text[2] == 'N'))
  145. return std::numeric_limits<double>::quiet_NaN();
  146. break;
  147. case 'i':
  148. case 'I':
  149. if ((text[1] == 'n' || text[1] == 'N') && (text[2] == 'f' || text[2] == 'F'))
  150. return std::numeric_limits<double>::infinity();
  151. break;
  152. }
  153. #if JUCE_MINGW
  154. // MinGW does not have access to the locale functions required for strtold, so we parse the doubles
  155. // ourselves. There are some edge cases where the least significant digit will be wrong!
  156. double result[3] = { 0 }, accumulator[2] = { 0 };
  157. int exponentAdjustment[2] = { 0 }, exponentAccumulator[2] = { -1, -1 };
  158. int exponent = 0, decPointIndex = 0, digit = 0;
  159. int lastDigit = 0, numSignificantDigits = 0;
  160. bool digitsFound = false;
  161. JUCE_CONSTEXPR const int maxSignificantDigits = 17 + 1;
  162. for (;;)
  163. {
  164. if (text.isDigit())
  165. {
  166. lastDigit = digit;
  167. digit = (int) text.getAndAdvance() - '0';
  168. digitsFound = true;
  169. if (decPointIndex != 0)
  170. exponentAdjustment[1]++;
  171. if (numSignificantDigits == 0 && digit == 0)
  172. continue;
  173. if (++numSignificantDigits > maxSignificantDigits)
  174. {
  175. if (digit > 5)
  176. ++accumulator [decPointIndex];
  177. else if (digit == 5 && (lastDigit & 1) != 0)
  178. ++accumulator [decPointIndex];
  179. if (decPointIndex > 0)
  180. exponentAdjustment[1]--;
  181. else
  182. exponentAdjustment[0]++;
  183. while (text.isDigit())
  184. {
  185. ++text;
  186. if (decPointIndex == 0)
  187. exponentAdjustment[0]++;
  188. }
  189. }
  190. else
  191. {
  192. const auto maxAccumulatorValue = (double) ((std::numeric_limits<unsigned int>::max() - 9) / 10);
  193. if (accumulator [decPointIndex] > maxAccumulatorValue)
  194. {
  195. result [decPointIndex] = mulexp10 (result [decPointIndex], exponentAccumulator [decPointIndex])
  196. + accumulator [decPointIndex];
  197. accumulator [decPointIndex] = 0;
  198. exponentAccumulator [decPointIndex] = 0;
  199. }
  200. accumulator [decPointIndex] = accumulator[decPointIndex] * 10 + digit;
  201. exponentAccumulator [decPointIndex]++;
  202. }
  203. }
  204. else if (decPointIndex == 0 && *text == '.')
  205. {
  206. ++text;
  207. decPointIndex = 1;
  208. if (numSignificantDigits > maxSignificantDigits)
  209. {
  210. while (text.isDigit())
  211. ++text;
  212. break;
  213. }
  214. }
  215. else
  216. {
  217. break;
  218. }
  219. }
  220. result[0] = mulexp10 (result[0], exponentAccumulator[0]) + accumulator[0];
  221. if (decPointIndex != 0)
  222. result[1] = mulexp10 (result[1], exponentAccumulator[1]) + accumulator[1];
  223. c = *text;
  224. if ((c == 'e' || c == 'E') && digitsFound)
  225. {
  226. auto negativeExponent = false;
  227. switch (*++text)
  228. {
  229. case '-': negativeExponent = true; // fall-through..
  230. case '+': ++text;
  231. }
  232. while (text.isDigit())
  233. exponent = (exponent * 10) + ((int) text.getAndAdvance() - '0');
  234. if (negativeExponent)
  235. exponent = -exponent;
  236. }
  237. auto r = mulexp10 (result[0], exponent + exponentAdjustment[0]);
  238. if (decPointIndex != 0)
  239. r += mulexp10 (result[1], exponent - exponentAdjustment[1]);
  240. return isNegative ? -r : r;
  241. #else // ! JUCE_MINGW
  242. int numSigFigs = 0;
  243. bool decimalPointFound = false;
  244. for (;;)
  245. {
  246. if (text.isDigit())
  247. {
  248. auto digit = (int) text.getAndAdvance() - '0';
  249. if (numSigFigs >= maxSignificantDigits
  250. || ((numSigFigs == 0 && (! decimalPointFound)) && digit == 0))
  251. continue;
  252. *currentCharacter++ = (char) ('0' + (char) digit);
  253. numSigFigs++;
  254. }
  255. else if ((! decimalPointFound) && *text == '.')
  256. {
  257. ++text;
  258. *currentCharacter++ = '.';
  259. decimalPointFound = true;
  260. }
  261. else
  262. {
  263. break;
  264. }
  265. }
  266. c = *text;
  267. if ((c == 'e' || c == 'E') && numSigFigs > 0)
  268. {
  269. *currentCharacter++ = 'e';
  270. switch (*++text)
  271. {
  272. case '-': *currentCharacter++ = '-'; // Fall-through..
  273. case '+': ++text;
  274. }
  275. int exponentMagnitude = 0;
  276. while (text.isDigit())
  277. {
  278. if (currentCharacter == &buffer[bufferSize - 1])
  279. return std::numeric_limits<double>::quiet_NaN();
  280. auto digit = (int) text.getAndAdvance() - '0';
  281. if (digit != 0 || exponentMagnitude != 0)
  282. {
  283. *currentCharacter++ = (char) ('0' + (char) digit);
  284. exponentMagnitude = (exponentMagnitude * 10) + digit;
  285. }
  286. }
  287. if (exponentMagnitude > std::numeric_limits<double>::max_exponent10)
  288. return std::numeric_limits<double>::quiet_NaN();
  289. if (exponentMagnitude == 0)
  290. *currentCharacter++ = '0';
  291. }
  292. #if JUCE_WINDOWS
  293. static _locale_t locale = _create_locale (LC_ALL, "C");
  294. return _strtod_l (&buffer[0], nullptr, locale);
  295. #else
  296. static locale_t locale = newlocale (LC_ALL_MASK, "C", nullptr);
  297. #if JUCE_ANDROID
  298. return (double) strtold_l (&buffer[0], nullptr, locale);
  299. #else
  300. return strtod_l (&buffer[0], nullptr, locale);
  301. #endif
  302. #endif
  303. #endif // JUCE_MINGW
  304. }
  305. /** Parses a character string, to read a floating-point value. */
  306. template <typename CharPointerType>
  307. static double getDoubleValue (CharPointerType text) noexcept
  308. {
  309. return readDoubleValue (text);
  310. }
  311. //==============================================================================
  312. /** Parses a character string, to read an integer value. */
  313. template <typename IntType, typename CharPointerType>
  314. static IntType getIntValue (const CharPointerType text) noexcept
  315. {
  316. typedef typename internal::make_unsigned<IntType>::type UIntType;
  317. UIntType v = 0;
  318. auto s = text.findEndOfWhitespace();
  319. const bool isNeg = *s == '-';
  320. if (isNeg)
  321. ++s;
  322. for (;;)
  323. {
  324. auto c = s.getAndAdvance();
  325. if (c >= '0' && c <= '9')
  326. v = v * 10 + (UIntType) (c - '0');
  327. else
  328. break;
  329. }
  330. return isNeg ? - (IntType) v : (IntType) v;
  331. }
  332. template <typename ResultType>
  333. struct HexParser
  334. {
  335. template <typename CharPointerType>
  336. static ResultType parse (CharPointerType t) noexcept
  337. {
  338. ResultType result = 0;
  339. while (! t.isEmpty())
  340. {
  341. auto hexValue = CharacterFunctions::getHexDigitValue (t.getAndAdvance());
  342. if (hexValue >= 0)
  343. result = (result << 4) | hexValue;
  344. }
  345. return result;
  346. }
  347. };
  348. //==============================================================================
  349. /** Counts the number of characters in a given string, stopping if the count exceeds
  350. a specified limit. */
  351. template <typename CharPointerType>
  352. static size_t lengthUpTo (CharPointerType text, const size_t maxCharsToCount) noexcept
  353. {
  354. size_t len = 0;
  355. while (len < maxCharsToCount && text.getAndAdvance() != 0)
  356. ++len;
  357. return len;
  358. }
  359. /** Counts the number of characters in a given string, stopping if the count exceeds
  360. a specified end-pointer. */
  361. template <typename CharPointerType>
  362. static size_t lengthUpTo (CharPointerType start, const CharPointerType end) noexcept
  363. {
  364. size_t len = 0;
  365. while (start < end && start.getAndAdvance() != 0)
  366. ++len;
  367. return len;
  368. }
  369. /** Copies null-terminated characters from one string to another. */
  370. template <typename DestCharPointerType, typename SrcCharPointerType>
  371. static void copyAll (DestCharPointerType& dest, SrcCharPointerType src) noexcept
  372. {
  373. while (auto c = src.getAndAdvance())
  374. dest.write (c);
  375. dest.writeNull();
  376. }
  377. /** Copies characters from one string to another, up to a null terminator
  378. or a given byte size limit. */
  379. template <typename DestCharPointerType, typename SrcCharPointerType>
  380. static size_t copyWithDestByteLimit (DestCharPointerType& dest, SrcCharPointerType src, size_t maxBytesToWrite) noexcept
  381. {
  382. auto startAddress = dest.getAddress();
  383. auto maxBytes = (ssize_t) maxBytesToWrite;
  384. maxBytes -= sizeof (typename DestCharPointerType::CharType); // (allow for a terminating null)
  385. for (;;)
  386. {
  387. auto c = src.getAndAdvance();
  388. auto bytesNeeded = DestCharPointerType::getBytesRequiredFor (c);
  389. maxBytes -= bytesNeeded;
  390. if (c == 0 || maxBytes < 0)
  391. break;
  392. dest.write (c);
  393. }
  394. dest.writeNull();
  395. return (size_t) getAddressDifference (dest.getAddress(), startAddress)
  396. + sizeof (typename DestCharPointerType::CharType);
  397. }
  398. /** Copies characters from one string to another, up to a null terminator
  399. or a given maximum number of characters. */
  400. template <typename DestCharPointerType, typename SrcCharPointerType>
  401. static void copyWithCharLimit (DestCharPointerType& dest, SrcCharPointerType src, int maxChars) noexcept
  402. {
  403. while (--maxChars > 0)
  404. {
  405. auto c = src.getAndAdvance();
  406. if (c == 0)
  407. break;
  408. dest.write (c);
  409. }
  410. dest.writeNull();
  411. }
  412. /** Compares two characters. */
  413. static inline int compare (juce_wchar char1, juce_wchar char2) noexcept
  414. {
  415. if (auto diff = static_cast<int> (char1) - static_cast<int> (char2))
  416. return diff < 0 ? -1 : 1;
  417. return 0;
  418. }
  419. /** Compares two null-terminated character strings. */
  420. template <typename CharPointerType1, typename CharPointerType2>
  421. static int compare (CharPointerType1 s1, CharPointerType2 s2) noexcept
  422. {
  423. for (;;)
  424. {
  425. auto c1 = s1.getAndAdvance();
  426. if (auto diff = compare (c1, s2.getAndAdvance()))
  427. return diff;
  428. if (c1 == 0)
  429. break;
  430. }
  431. return 0;
  432. }
  433. /** Compares two null-terminated character strings, up to a given number of characters. */
  434. template <typename CharPointerType1, typename CharPointerType2>
  435. static int compareUpTo (CharPointerType1 s1, CharPointerType2 s2, int maxChars) noexcept
  436. {
  437. while (--maxChars >= 0)
  438. {
  439. auto c1 = s1.getAndAdvance();
  440. if (auto diff = compare (c1, s2.getAndAdvance()))
  441. return diff;
  442. if (c1 == 0)
  443. break;
  444. }
  445. return 0;
  446. }
  447. /** Compares two characters, using a case-independant match. */
  448. static inline int compareIgnoreCase (juce_wchar char1, juce_wchar char2) noexcept
  449. {
  450. return char1 != char2 ? compare (toUpperCase (char1), toUpperCase (char2)) : 0;
  451. }
  452. /** Compares two null-terminated character strings, using a case-independant match. */
  453. template <typename CharPointerType1, typename CharPointerType2>
  454. static int compareIgnoreCase (CharPointerType1 s1, CharPointerType2 s2) noexcept
  455. {
  456. for (;;)
  457. {
  458. auto c1 = s1.getAndAdvance();
  459. if (auto diff = compareIgnoreCase (c1, s2.getAndAdvance()))
  460. return diff;
  461. if (c1 == 0)
  462. break;
  463. }
  464. return 0;
  465. }
  466. /** Compares two null-terminated character strings, using a case-independent match. */
  467. template <typename CharPointerType1, typename CharPointerType2>
  468. static int compareIgnoreCaseUpTo (CharPointerType1 s1, CharPointerType2 s2, int maxChars) noexcept
  469. {
  470. while (--maxChars >= 0)
  471. {
  472. auto c1 = s1.getAndAdvance();
  473. if (auto diff = compareIgnoreCase (c1, s2.getAndAdvance()))
  474. return diff;
  475. if (c1 == 0)
  476. break;
  477. }
  478. return 0;
  479. }
  480. /** Finds the character index of a given substring in another string.
  481. Returns -1 if the substring is not found.
  482. */
  483. template <typename CharPointerType1, typename CharPointerType2>
  484. static int indexOf (CharPointerType1 textToSearch, const CharPointerType2 substringToLookFor) noexcept
  485. {
  486. int index = 0;
  487. auto substringLength = (int) substringToLookFor.length();
  488. for (;;)
  489. {
  490. if (textToSearch.compareUpTo (substringToLookFor, substringLength) == 0)
  491. return index;
  492. if (textToSearch.getAndAdvance() == 0)
  493. return -1;
  494. ++index;
  495. }
  496. }
  497. /** Returns a pointer to the first occurrence of a substring in a string.
  498. If the substring is not found, this will return a pointer to the string's
  499. null terminator.
  500. */
  501. template <typename CharPointerType1, typename CharPointerType2>
  502. static CharPointerType1 find (CharPointerType1 textToSearch, const CharPointerType2 substringToLookFor) noexcept
  503. {
  504. auto substringLength = (int) substringToLookFor.length();
  505. while (textToSearch.compareUpTo (substringToLookFor, substringLength) != 0
  506. && ! textToSearch.isEmpty())
  507. ++textToSearch;
  508. return textToSearch;
  509. }
  510. /** Returns a pointer to the first occurrence of a substring in a string.
  511. If the substring is not found, this will return a pointer to the string's
  512. null terminator.
  513. */
  514. template <typename CharPointerType>
  515. static CharPointerType find (CharPointerType textToSearch, const juce_wchar charToLookFor) noexcept
  516. {
  517. for (;; ++textToSearch)
  518. {
  519. auto c = *textToSearch;
  520. if (c == charToLookFor || c == 0)
  521. break;
  522. }
  523. return textToSearch;
  524. }
  525. /** Finds the character index of a given substring in another string, using
  526. a case-independent match.
  527. Returns -1 if the substring is not found.
  528. */
  529. template <typename CharPointerType1, typename CharPointerType2>
  530. static int indexOfIgnoreCase (CharPointerType1 haystack, const CharPointerType2 needle) noexcept
  531. {
  532. int index = 0;
  533. auto needleLength = (int) needle.length();
  534. for (;;)
  535. {
  536. if (haystack.compareIgnoreCaseUpTo (needle, needleLength) == 0)
  537. return index;
  538. if (haystack.getAndAdvance() == 0)
  539. return -1;
  540. ++index;
  541. }
  542. }
  543. /** Finds the character index of a given character in another string.
  544. Returns -1 if the character is not found.
  545. */
  546. template <typename Type>
  547. static int indexOfChar (Type text, const juce_wchar charToFind) noexcept
  548. {
  549. int i = 0;
  550. while (! text.isEmpty())
  551. {
  552. if (text.getAndAdvance() == charToFind)
  553. return i;
  554. ++i;
  555. }
  556. return -1;
  557. }
  558. /** Finds the character index of a given character in another string, using
  559. a case-independent match.
  560. Returns -1 if the character is not found.
  561. */
  562. template <typename Type>
  563. static int indexOfCharIgnoreCase (Type text, juce_wchar charToFind) noexcept
  564. {
  565. charToFind = CharacterFunctions::toLowerCase (charToFind);
  566. int i = 0;
  567. while (! text.isEmpty())
  568. {
  569. if (text.toLowerCase() == charToFind)
  570. return i;
  571. ++text;
  572. ++i;
  573. }
  574. return -1;
  575. }
  576. /** Returns a pointer to the first non-whitespace character in a string.
  577. If the string contains only whitespace, this will return a pointer
  578. to its null terminator.
  579. */
  580. template <typename Type>
  581. static Type findEndOfWhitespace (Type text) noexcept
  582. {
  583. while (text.isWhitespace())
  584. ++text;
  585. return text;
  586. }
  587. /** Returns a pointer to the first character in the string which is found in
  588. the breakCharacters string.
  589. */
  590. template <typename Type, typename BreakType>
  591. static Type findEndOfToken (Type text, BreakType breakCharacters, Type quoteCharacters)
  592. {
  593. juce_wchar currentQuoteChar = 0;
  594. while (! text.isEmpty())
  595. {
  596. auto c = text.getAndAdvance();
  597. if (currentQuoteChar == 0 && breakCharacters.indexOf (c) >= 0)
  598. {
  599. --text;
  600. break;
  601. }
  602. if (quoteCharacters.indexOf (c) >= 0)
  603. {
  604. if (currentQuoteChar == 0)
  605. currentQuoteChar = c;
  606. else if (currentQuoteChar == c)
  607. currentQuoteChar = 0;
  608. }
  609. }
  610. return text;
  611. }
  612. private:
  613. static double mulexp10 (double value, int exponent) noexcept;
  614. };
  615. } // namespace juce