OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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 COMPONENTS_PHYSICAL_WEB_EDDYSTONE_EDDYSTONE_ENCODER_H_ | |
6 #define COMPONENTS_PHYSICAL_WEB_EDDYSTONE_EDDYSTONE_ENCODER_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 namespace physical_web { | |
12 | |
13 const int kEmptyUrl = -1; | |
14 const int kInvalidUrl = -2; | |
15 const int kInvalidFormat = -3; | |
16 const int kNullEncodedUrl = -4; | |
17 | |
18 /* | |
19 * EncodeUrl takes a URL in the form of a std::string and | |
20 * a pointer to a uint8_t vector to populate with the eddystone | |
21 * encoding of the URL. | |
22 * Returns: | |
23 * kEmptyUrl If the URL parameter is empty. | |
24 * kInvalidUrl If the URL parameter is not a valid Url. | |
Olivier
2017/03/13 11:57:56
s/Url/URL for consistency
iankc
2017/03/13 17:53:01
Done.
| |
25 * kInvalidFormat If the URL parameter is not a standard HTTPS or HTTP URL. | |
Olivier
2017/03/13 11:57:55
or is IP URL.
iankc
2017/03/13 17:53:01
Acknowledged.
| |
26 * kNullEncodedUrl If the encoded_url vector is NULL. | |
27 * Length of encoded URL. | |
28 * Eddystone spec can be found here: | |
29 * https://github.com/google/eddystone/blob/master/protocol-specification.md | |
30 */ | |
31 int EncodeUrl(const std::string& url, std::vector<uint8_t>* encoded_url); | |
32 } | |
33 | |
34 #endif // COMPONENTS_PHYSICAL_WEB_EDDYSTONE_EDDYSTONE_ENCODER_H_ | |
OLD | NEW |