| 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 <stddef.h> |
| 8 |
| 7 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 8 | 10 |
| 9 namespace dbus { | 11 namespace dbus { |
| 10 | 12 |
| 11 // This implementation is based upon D-Bus Specification Version 0.19. | 13 // This implementation is based upon D-Bus Specification Version 0.19. |
| 12 bool IsValidObjectPath(const std::string& value) { | 14 bool IsValidObjectPath(const std::string& value) { |
| 13 // A valid object path begins with '/'. | 15 // A valid object path begins with '/'. |
| 14 if (!base::StartsWith(value, "/", base::CompareCase::SENSITIVE)) | 16 if (!base::StartsWith(value, "/", base::CompareCase::SENSITIVE)) |
| 15 return false; | 17 return false; |
| 16 | 18 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 37 | 39 |
| 38 // A trailing '/' character is not allowed unless the path is the root path. | 40 // A trailing '/' character is not allowed unless the path is the root path. |
| 39 if (value.size() > 1 && | 41 if (value.size() > 1 && |
| 40 base::EndsWith(value, "/", base::CompareCase::SENSITIVE)) | 42 base::EndsWith(value, "/", base::CompareCase::SENSITIVE)) |
| 41 return false; | 43 return false; |
| 42 | 44 |
| 43 return true; | 45 return true; |
| 44 } | 46 } |
| 45 | 47 |
| 46 } // namespace dbus | 48 } // namespace dbus |
| OLD | NEW |