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

Unified Diff: device/bluetooth/bluetooth_uuid.cc

Issue 220323004: device/bluetooth: Rename device::bluetooth_utils::UUID to device::BluetoothUUID (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initialized |empty_device_| in BluetoothDeviceWinTest. Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/bluetooth_uuid.h ('k') | device/bluetooth/bluetooth_uuid_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_uuid.cc
diff --git a/device/bluetooth/bluetooth_utils.cc b/device/bluetooth/bluetooth_uuid.cc
similarity index 70%
rename from device/bluetooth/bluetooth_utils.cc
rename to device/bluetooth/bluetooth_uuid.cc
index b8747365d6add606394deacfd95ed2c9ced24b41..2689a6cbe9f36dc6d911f6dc766ba564965b46ed 100644
--- a/device/bluetooth/bluetooth_utils.cc
+++ b/device/bluetooth/bluetooth_uuid.cc
@@ -1,17 +1,14 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "device/bluetooth/bluetooth_utils.h"
-
-#include <vector>
+#include "device/bluetooth/bluetooth_uuid.h"
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
namespace device {
-namespace bluetooth_utils {
namespace {
@@ -24,11 +21,11 @@ const int kUuidSize = 36;
void GetCanonicalUuid(std::string uuid,
std::string* canonical,
std::string* canonical_128,
- UUID::Format* format) {
+ BluetoothUUID::Format* format) {
// Initialize the values for the failure case.
canonical->clear();
canonical_128->clear();
- *format = UUID::kFormatInvalid;
+ *format = BluetoothUUID::kFormatInvalid;
if (uuid.empty())
return;
@@ -47,12 +44,12 @@ void GetCanonicalUuid(std::string uuid,
if (uuid.size() == 4) {
canonical->assign(uuid);
canonical_128->assign(kCommonUuidPrefix + uuid + kCommonUuidPostfix);
- *format = UUID::kFormat16Bit;
+ *format = BluetoothUUID::kFormat16Bit;
return;
}
canonical->assign(uuid);
canonical_128->assign(uuid + kCommonUuidPostfix);
- *format = UUID::kFormat32Bit;
+ *format = BluetoothUUID::kFormat32Bit;
return;
}
@@ -69,42 +66,36 @@ void GetCanonicalUuid(std::string uuid,
canonical->assign(uuid);
canonical_128->assign(uuid);
- *format = UUID::kFormat128Bit;
+ *format = BluetoothUUID::kFormat128Bit;
}
} // namespace
-UUID::UUID(const std::string& uuid) {
+BluetoothUUID::BluetoothUUID(const std::string& uuid) {
GetCanonicalUuid(uuid, &value_, &canonical_value_, &format_);
}
-UUID::~UUID() {
+BluetoothUUID::BluetoothUUID() : format_(kFormatInvalid) {
+}
+
+BluetoothUUID::~BluetoothUUID() {
}
-bool UUID::IsValid() const {
+bool BluetoothUUID::IsValid() const {
return format_ != kFormatInvalid;
}
-bool UUID::operator<(const UUID& uuid) const {
+bool BluetoothUUID::operator<(const BluetoothUUID& uuid) const {
return canonical_value_ < uuid.canonical_value_;
}
-bool UUID::operator==(const UUID& uuid) const {
+bool BluetoothUUID::operator==(const BluetoothUUID& uuid) const {
return canonical_value_ == uuid.canonical_value_;
}
-bool UUID::operator!=(const UUID& uuid) const {
+bool BluetoothUUID::operator!=(const BluetoothUUID& uuid) const {
return canonical_value_ != uuid.canonical_value_;
}
-std::string CanonicalUuid(std::string uuid) {
- std::string value;
- std::string canonical_value;
- UUID::Format format;
- GetCanonicalUuid(uuid, &value, &canonical_value, &format);
- return canonical_value;
-}
-
-} // namespace bluetooth_utils
} // namespace device
« no previous file with comments | « device/bluetooth/bluetooth_uuid.h ('k') | device/bluetooth/bluetooth_uuid_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698