Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: third_party/WebKit/Source/platform/inspector_protocol/String16STL.h

Issue 2188203002: [DevTools] implement isSpaceOrNewline for the STL string wrapper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add include Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium 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 String16STL_h 5 #ifndef String16STL_h
6 #define String16STL_h 6 #define String16STL_h
7 7
8 #include <cctype>
8 #include <cstdlib> 9 #include <cstdlib>
9 #include <cstring> 10 #include <cstring>
10 #include <stdint.h> 11 #include <stdint.h>
11 #include <string> 12 #include <string>
12 #include <vector> 13 #include <vector>
13 14
14 using UChar = uint16_t; 15 using UChar = uint16_t;
15 using UChar32 = uint32_t; 16 using UChar32 = uint32_t;
16 using LChar = unsigned char; 17 using LChar = unsigned char;
17 // presubmit: allow wstring 18 // presubmit: allow wstring
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 static std::string intToString(int); 135 static std::string intToString(int);
135 static std::string doubleToString(double); 136 static std::string doubleToString(double);
136 // presubmit: allow wstring 137 // presubmit: allow wstring
137 wstring m_impl; 138 wstring m_impl;
138 mutable bool has_hash = false; 139 mutable bool has_hash = false;
139 mutable std::size_t hash_code = 0; 140 mutable std::size_t hash_code = 0;
140 }; 141 };
141 142
142 static inline bool isSpaceOrNewline(UChar c) 143 static inline bool isSpaceOrNewline(UChar c)
143 { 144 {
144 return false; 145 return std::isspace(c); // NOLINT
145 } 146 }
146 147
147 class String16Builder { 148 class String16Builder {
148 public: 149 public:
149 String16Builder() { } 150 String16Builder() { }
150 151
151 void append(const String16& str) 152 void append(const String16& str)
152 { 153 {
153 m_impl += str.impl(); 154 m_impl += str.impl();
154 } 155 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 254 }
254 }; 255 };
255 256
256 } // namespace std 257 } // namespace std
257 258
258 #endif // !defined(__APPLE__) || defined(_LIBCPP_VERSION) 259 #endif // !defined(__APPLE__) || defined(_LIBCPP_VERSION)
259 260
260 using String = WTF::String; 261 using String = WTF::String;
261 262
262 #endif // !defined(String16STL_h) 263 #endif // !defined(String16STL_h)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698