OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 285 |
286 /////////////////////////////////////////////////////////////////////////////// | 286 /////////////////////////////////////////////////////////////////////////////// |
287 // Traits<wchar_t> specializations (Windows only, currently) | 287 // Traits<wchar_t> specializations (Windows only, currently) |
288 /////////////////////////////////////////////////////////////////////////////// | 288 /////////////////////////////////////////////////////////////////////////////// |
289 | 289 |
290 #if defined(WEBRTC_WIN) | 290 #if defined(WEBRTC_WIN) |
291 | 291 |
292 template<> | 292 template<> |
293 struct Traits<wchar_t> { | 293 struct Traits<wchar_t> { |
294 typedef std::wstring string; | 294 typedef std::wstring string; |
295 inline static const wchar_t* Traits<wchar_t>::empty_str() { return L""; } | 295 inline static const wchar_t* empty_str() { return L""; } |
296 }; | 296 }; |
297 | 297 |
298 #endif // WEBRTC_WIN | 298 #endif // WEBRTC_WIN |
299 | 299 |
300 // Replaces all occurrences of "search" with "replace". | 300 // Replaces all occurrences of "search" with "replace". |
301 void replace_substrs(const char *search, | 301 void replace_substrs(const char *search, |
302 size_t search_len, | 302 size_t search_len, |
303 const char *replace, | 303 const char *replace, |
304 size_t replace_len, | 304 size_t replace_len, |
305 std::string *s); | 305 std::string *s); |
306 | 306 |
307 // True iff s1 starts with s2. | 307 // True iff s1 starts with s2. |
308 bool starts_with(const char *s1, const char *s2); | 308 bool starts_with(const char *s1, const char *s2); |
309 | 309 |
310 // True iff s1 ends with s2. | 310 // True iff s1 ends with s2. |
311 bool ends_with(const char *s1, const char *s2); | 311 bool ends_with(const char *s1, const char *s2); |
312 | 312 |
313 // Remove leading and trailing whitespaces. | 313 // Remove leading and trailing whitespaces. |
314 std::string string_trim(const std::string& s); | 314 std::string string_trim(const std::string& s); |
315 | 315 |
316 } // namespace rtc | 316 } // namespace rtc |
317 | 317 |
318 #endif // WEBRTC_BASE_STRINGUTILS_H__ | 318 #endif // WEBRTC_BASE_STRINGUTILS_H__ |
OLD | NEW |