Chromium Code Reviews| 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 * EncodeUrl takes a URL in the form of a std::string and | |
|
mattreynolds
2017/03/09 22:11:31
Would it make sense to take a GURL as the input pa
iankc
2017/03/09 23:17:50
Acknowledged.
| |
| 14 * a pointer to a uint8_t vector to populate with the eddystone | |
| 15 * encoding of the url. | |
| 16 * Returns: | |
| 17 * -1 If the Url parameter is empty. | |
| 18 * -2 If the Url parameter is not a valid Url. | |
| 19 * -3 If the Url parameter is not a standard Https or Http Url. | |
| 20 * Length of encoded Url. | |
| 21 * Eddystone spec can be found here: | |
| 22 * https://github.com/google/eddystone/blob/master/protocol-specification.md | |
|
mattreynolds
2017/03/09 22:11:31
Nice comment! A few things to clean up:
* Use all
iankc
2017/03/09 23:17:50
Done.
| |
| 23 */ | |
| 24 int EncodeUrl(const std::string& url, std::vector<uint8_t>* encoded_url); | |
| 25 } | |
| 26 | |
| 27 #endif // COMPONENTS_PHYSICAL_WEB_EDDYSTONE_EDDYSTONE_ENCODER_H_ | |
| OLD | NEW |