OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "dbus/string_util.h" | 5 #include "dbus/string_util.h" |
6 | 6 |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 | 8 |
9 namespace dbus { | 9 namespace dbus { |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 const bool is_valid_character = | 32 const bool is_valid_character = |
33 ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z') || | 33 ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z') || |
34 ('0' <= c && c <= '9') || c == '_'; | 34 ('0' <= c && c <= '9') || c == '_'; |
35 if (!is_valid_character) | 35 if (!is_valid_character) |
36 return false; | 36 return false; |
37 element_length++; | 37 element_length++; |
38 } | 38 } |
39 } | 39 } |
40 | 40 |
41 // A trailing '/' character is not allowed unless the path is the root path. | 41 // A trailing '/' character is not allowed unless the path is the root path. |
42 if (value.size() > 1 && EndsWith(value, "/", kCaseSensitive)) | 42 if (value.size() > 1 && base::EndsWith(value, "/", kCaseSensitive)) |
43 return false; | 43 return false; |
44 | 44 |
45 return true; | 45 return true; |
46 } | 46 } |
47 | 47 |
48 } // namespace dbus | 48 } // namespace dbus |
OLD | NEW |