• Home
  • Raw
  • Download

Lines Matching full:uuid

27 // Returns the canonical, 128-bit canonical, and the format of the UUID
28 // in |canonical|, |canonical_128|, and |format| based on |uuid|.
29 void GetCanonicalUuid(std::string uuid, in GetCanonicalUuid() argument
38 if (uuid.empty()) in GetCanonicalUuid()
41 if (uuid.size() < 11 && in GetCanonicalUuid()
42 base::StartsWith(uuid, "0x", base::CompareCase::SENSITIVE)) { in GetCanonicalUuid()
43 uuid = uuid.substr(2); in GetCanonicalUuid()
46 if (!(uuid.size() == 4 || uuid.size() == 8 || uuid.size() == 36)) in GetCanonicalUuid()
49 for (size_t i = 0; i < uuid.size(); ++i) { in GetCanonicalUuid()
51 if (uuid[i] != '-') in GetCanonicalUuid()
54 if (!base::IsHexDigit(uuid[i])) in GetCanonicalUuid()
56 uuid[i] = base::ToLowerASCII(uuid[i]); in GetCanonicalUuid()
60 canonical->assign(uuid); in GetCanonicalUuid()
61 if (uuid.size() == 4) { in GetCanonicalUuid()
62 canonical_128->assign(kCommonUuidPrefix + uuid + kCommonUuidPostfix); in GetCanonicalUuid()
64 } else if (uuid.size() == 8) { in GetCanonicalUuid()
65 canonical_128->assign(uuid + kCommonUuidPostfix); in GetCanonicalUuid()
68 canonical_128->assign(uuid); in GetCanonicalUuid()
76 BluetoothUUID::BluetoothUUID(const std::string& uuid) { in BluetoothUUID() argument
77 GetCanonicalUuid(uuid, &value_, &canonical_value_, &format_); in BluetoothUUID()
81 BluetoothUUID::BluetoothUUID(GUID uuid) { in BluetoothUUID() argument
82 // 36 chars for UUID + 2 chars for braces + 1 char for null-terminator. in BluetoothUUID()
85 int result = ::StringFromGUID2(uuid, buffer, kBufferSize); in BluetoothUUID()
103 GUID BluetoothUUID::GetCanonicalValueAsGUID(base::StringPiece uuid) { in GetCanonicalValueAsGUID() argument
104 DCHECK_EQ(36u, uuid.size()); in GetCanonicalValueAsGUID()
105 base::string16 braced_uuid = L'{' + base::UTF8ToWide(uuid) + L'}'; in GetCanonicalValueAsGUID()
116 bool BluetoothUUID::operator<(const BluetoothUUID& uuid) const { in operator <()
117 return canonical_value_ < uuid.canonical_value_; in operator <()
120 bool BluetoothUUID::operator==(const BluetoothUUID& uuid) const { in operator ==()
121 return canonical_value_ == uuid.canonical_value_; in operator ==()
124 bool BluetoothUUID::operator!=(const BluetoothUUID& uuid) const { in operator !=()
125 return canonical_value_ != uuid.canonical_value_; in operator !=()
128 void PrintTo(const BluetoothUUID& uuid, std::ostream* out) { in PrintTo() argument
129 *out << uuid.canonical_value(); in PrintTo()