| 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
|
|
|