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

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

Issue 950083003: device/bluetooth: Implemented UriBeacon decoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « device/bluetooth/bluetooth.gyp ('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 <string>
9 #include <vector>
10
11 #include "base/strings/string_piece.h"
12
13 namespace device {
14
15 // The following functions EncodeUriBeaconUri() and DecodeUriBeaconUri() helps
16 // encoding/decoding URI with the UriBeacon encoding.
17 //
18 // Example usage:
19 //
20 // std::vector<uint8_t> encoded;
21 // EncodeUriBeaconUri("http://web.mit.edu/", encoded)
22 // // encoded -> {2, 'w', 'e', 'b', '.', 'm', 'i', 't', 2}
23 //
24 // const char encodedUri[] = {0, 'u', 'r', 'i', 'b', 'e', 'a', 'c', 'o', 'n',
25 // 8};
26 // const std::vector<uint8_t> kEncodedUri(encodedUri, encodedUri +
27 // sizeof(encodedUri));
28 // std::string decoded;
29 // DecodeUriBeaconUri(kEncodedUri, decoded)
30 // // decoded -> "http://uribeacon.org"
31
32 // Encodes the input string using URI encoding described in UriBeacon
33 // specifications. |input| must be ASCII characters.
34 void EncodeUriBeaconUri(const std::string& input, std::vector<uint8_t>& output);
35
36 // Decodes the input string using URI encoding described in UriBeacon
37 // specifications.
38 void DecodeUriBeaconUri(const std::vector<uint8_t>& input, std::string& output);
39
40 } // namespace device
41
42 #endif
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth.gyp ('k') | device/bluetooth/uribeacon/uri_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698