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

Side by Side Diff: components/physical_web/eddystone/eddystone_encoder.h

Issue 2731273004: Add Platform Independent Eddystone Encoder (Closed)
Patch Set: Fixing more Casting Created 3 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
OLDNEW
(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_
OLDNEW
« no previous file with comments | « components/physical_web/eddystone/BUILD.gn ('k') | components/physical_web/eddystone/eddystone_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698