LEFT | RIGHT |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
16 */ | 16 */ |
17 | 17 |
18 #pragma once | 18 #pragma once |
19 | 19 |
20 #include <algorithm> | 20 #include <algorithm> |
21 #include <cstddef> | 21 #include <cstddef> |
22 #include <cstring> | 22 #include <cstring> |
23 #include <type_traits> | 23 #include <type_traits> |
24 | 24 |
25 #include <emscripten.h> | |
26 | |
27 #include "debug.h" | 25 #include "debug.h" |
28 | 26 #include "library.h" |
29 extern "C" | |
30 { | |
31 // It seems that calling JS is the easiest solution for lowercasing Unicode | |
32 // characters. | |
33 char16_t CharToLower(char16_t charCode); | |
34 } | |
35 | 27 |
36 inline void String_assert_readonly(bool readOnly); | 28 inline void String_assert_readonly(bool readOnly); |
37 | 29 |
38 class String | 30 class String |
39 { | 31 { |
40 friend class DependentString; | 32 friend class DependentString; |
41 friend class OwnedString; | 33 friend class OwnedString; |
42 | 34 |
43 public: | 35 public: |
44 typedef char16_t value_type; | 36 typedef char16_t value_type; |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 if (negative) | 398 if (negative) |
407 mBuf[pos++] = '-'; | 399 mBuf[pos++] = '-'; |
408 | 400 |
409 for (int i = size - 1; i >= 0; i--) | 401 for (int i = size - 1; i >= 0; i--) |
410 { | 402 { |
411 mBuf[pos + i] = '0' + (num % 10); | 403 mBuf[pos + i] = '0' + (num % 10); |
412 num /= 10; | 404 num /= 10; |
413 } | 405 } |
414 } | 406 } |
415 }; | 407 }; |
LEFT | RIGHT |