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 #ifndef V8_INSPECTOR_STRINGUTIL_H_ | 5 #ifndef V8_INSPECTOR_STRINGUTIL_H_ |
6 #define V8_INSPECTOR_STRINGUTIL_H_ | 6 #define V8_INSPECTOR_STRINGUTIL_H_ |
7 | 7 |
8 #include "src/base/macros.h" | 8 #include "src/base/macros.h" |
9 #include "src/inspector/string-16.h" | 9 #include "src/inspector/string-16.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 class StringUtil { | 22 class StringUtil { |
23 public: | 23 public: |
24 static String substring(const String& s, size_t pos, size_t len) { | 24 static String substring(const String& s, size_t pos, size_t len) { |
25 return s.substring(pos, len); | 25 return s.substring(pos, len); |
26 } | 26 } |
27 static String fromInteger(int number) { return String::fromInteger(number); } | 27 static String fromInteger(int number) { return String::fromInteger(number); } |
28 static String fromInteger(size_t number) { | 28 static String fromInteger(size_t number) { |
29 return String::fromInteger(number); | 29 return String::fromInteger(number); |
30 } | 30 } |
31 static String fromDouble(double number) { return String::fromDouble(number); } | 31 static String fromDouble(double number) { |
| 32 return String::fromDoubleForcePointAsSeparator(number); |
| 33 } |
32 static const size_t kNotFound = String::kNotFound; | 34 static const size_t kNotFound = String::kNotFound; |
33 static void builderReserve(StringBuilder& builder, size_t capacity) { | 35 static void builderReserve(StringBuilder& builder, size_t capacity) { |
34 builder.reserveCapacity(capacity); | 36 builder.reserveCapacity(capacity); |
35 } | 37 } |
36 }; | 38 }; |
37 | 39 |
38 std::unique_ptr<protocol::Value> parseJSON(const StringView& json); | 40 std::unique_ptr<protocol::Value> parseJSON(const StringView& json); |
39 std::unique_ptr<protocol::Value> parseJSON(const String16& json); | 41 std::unique_ptr<protocol::Value> parseJSON(const String16& json); |
40 | 42 |
41 } // namespace protocol | 43 } // namespace protocol |
(...skipping 24 matching lines...) Expand all Loading... |
66 explicit StringBufferImpl(String16&); | 68 explicit StringBufferImpl(String16&); |
67 String16 m_owner; | 69 String16 m_owner; |
68 StringView m_string; | 70 StringView m_string; |
69 | 71 |
70 DISALLOW_COPY_AND_ASSIGN(StringBufferImpl); | 72 DISALLOW_COPY_AND_ASSIGN(StringBufferImpl); |
71 }; | 73 }; |
72 | 74 |
73 } // namespace v8_inspector | 75 } // namespace v8_inspector |
74 | 76 |
75 #endif // V8_INSPECTOR_STRINGUTIL_H_ | 77 #endif // V8_INSPECTOR_STRINGUTIL_H_ |
OLD | NEW |