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 const int kEmptyURL = -1; | |
13 const int kInvalidURL = -2; | |
mattreynolds
2017/03/09 23:39:48
In C++, use "Url" when including an initialism in
iankc
2017/03/10 22:28:45
Done.
| |
14 const int kInvalidFormat = -3; | |
15 const int kNullEncodedUrl = -4; | |
16 /* | |
17 * EncodeUrl takes a URL in the form of a std::string and | |
18 * a pointer to a uint8_t vector to populate with the eddystone | |
19 * encoding of the URL. | |
20 * Returns: | |
21 * kEmptyURL If the URL parameter is empty. | |
22 * kInvalidURL If the URL parameter is not a valid Url. | |
23 * kInvalidFormat If the URL parameter is not a standard HTTPS or HTTP URL. | |
24 * kNullEncodedUrl If the encoded_url vector is NULL. | |
25 * Length of encoded URL. | |
26 * Eddystone spec can be found here: | |
27 * https://github.com/google/eddystone/blob/master/protocol-specification.md | |
28 */ | |
29 int EncodeUrl(const std::string& url, std::vector<uint8_t>* encoded_url); | |
30 } | |
31 | |
32 #endif // COMPONENTS_PHYSICAL_WEB_EDDYSTONE_EDDYSTONE_ENCODER_H_ | |
OLD | NEW |