OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/inspector/string-16.h" | 5 #include "src/inspector/string-16.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cctype> | 8 #include <cctype> |
9 #include <cstdlib> | 9 #include <cstdlib> |
10 #include <cstring> | 10 #include <cstring> |
11 #include <iomanip> | 11 #include <iomanip> |
12 #include <limits> | 12 #include <limits> |
13 #include <locale> | 13 #include <locale> |
14 #include <sstream> | 14 #include <sstream> |
15 #include <string> | 15 #include <string> |
16 | 16 |
17 #include "src/base/platform/platform.h" | 17 #include "src/base/platform/platform.h" |
18 #include "src/inspector/protocol-platform.h" | |
19 | 18 |
20 namespace v8_inspector { | 19 namespace v8_inspector { |
21 | 20 |
22 namespace { | 21 namespace { |
23 | 22 |
24 bool isASCII(UChar c) { return !(c & ~0x7F); } | 23 bool isASCII(UChar c) { return !(c & ~0x7F); } |
25 | 24 |
26 bool isSpaceOrNewLine(UChar c) { | 25 bool isSpaceOrNewLine(UChar c) { |
27 return isASCII(c) && c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); | 26 return isASCII(c) && c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); |
28 } | 27 } |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 // There should be room left, since one UChar hasn't been | 532 // There should be room left, since one UChar hasn't been |
534 // converted. | 533 // converted. |
535 DCHECK((buffer + 3) <= (buffer + bufferVector.size())); | 534 DCHECK((buffer + 3) <= (buffer + bufferVector.size())); |
536 putUTF8Triple(buffer, *characters); | 535 putUTF8Triple(buffer, *characters); |
537 } | 536 } |
538 | 537 |
539 return std::string(bufferVector.data(), buffer - bufferVector.data()); | 538 return std::string(bufferVector.data(), buffer - bufferVector.data()); |
540 } | 539 } |
541 | 540 |
542 } // namespace v8_inspector | 541 } // namespace v8_inspector |
OLD | NEW |