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 size_t kEmptyUrl = static_cast<size_t>(-1); |
| 14 const size_t kInvalidUrl = static_cast<size_t>(-2); |
| 15 const size_t kInvalidFormat = static_cast<size_t>(-3); |
| 16 const size_t kNullEncodedUrl = static_cast<size_t>(-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. |
| 25 * kInvalidFormat If the URL parameter is not a standard HTTPS/HTTP URL. |
| 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 size_t EncodeUrl(const std::string& url, std::vector<uint8_t>* encoded_url); |
| 32 } |
| 33 |
| 34 #endif // COMPONENTS_PHYSICAL_WEB_EDDYSTONE_EDDYSTONE_ENCODER_H_ |
OLD | NEW |