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

Side by Side Diff: device/bluetooth/uribeacon/uri_encoder.h

Issue 2015703002: bluetooth: Remove UriBeacon code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Delete target Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « device/bluetooth/uribeacon/BUILD.gn ('k') | device/bluetooth/uribeacon/uri_encoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_BLUETOOTH_URIBEACON_URI_ENCODER_H_
6 #define DEVICE_BLUETOOTH_URIBEACON_URI_ENCODER_H_
7
8 #include <stdint.h>
9
10 #include <string>
11 #include <vector>
12
13 #include "base/strings/string_piece.h"
14
15 namespace device {
16
17 // The following functions EncodeUriBeaconUri() and DecodeUriBeaconUri() helps
18 // encoding/decoding URI with the UriBeacon encoding.
19 //
20 // Example usage:
21 //
22 // std::vector<uint8_t> encoded;
23 // EncodeUriBeaconUri("http://web.mit.edu/", encoded)
24 // // encoded -> {2, 'w', 'e', 'b', '.', 'm', 'i', 't', 2}
25 //
26 // const char encodedUri[] = {0, 'u', 'r', 'i', 'b', 'e', 'a', 'c', 'o', 'n',
27 // 8};
28 // const std::vector<uint8_t> kEncodedUri(encodedUri, encodedUri +
29 // sizeof(encodedUri));
30 // std::string decoded;
31 // DecodeUriBeaconUri(kEncodedUri, decoded)
32 // // decoded -> "http://uribeacon.org"
33
34 // Encodes the input string using URI encoding described in UriBeacon
35 // specifications. |input| must be ASCII characters.
36 void EncodeUriBeaconUri(const std::string& input, std::vector<uint8_t>& output);
37
38 // Decodes the input string using URI encoding described in UriBeacon
39 // specifications.
40 void DecodeUriBeaconUri(const std::vector<uint8_t>& input, std::string& output);
41
42 } // namespace device
43
44 #endif
OLDNEW
« no previous file with comments | « device/bluetooth/uribeacon/BUILD.gn ('k') | device/bluetooth/uribeacon/uri_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698