summaryrefslogtreecommitdiff
path: root/technologies.h
blob: f82f964c607b68d756c794e40783c3e87d694253 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2014 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef PEERD_TECHNOLOGIES_H_
#define PEERD_TECHNOLOGIES_H_

#include <bitset>
#include <limits>
#include <string>
#include <vector>

namespace peerd {
namespace technologies {

extern const char kMDNSText[];
extern const char kBTText[];
extern const char kBTLEText[];

enum Technology {
  kMDNS,
  kBT,
  kBTLE,
};

static const size_t kTechnologiesBitSize =
    std::numeric_limits<std::underlying_type<Technology>::type>::digits;
using TechnologySet = std::bitset<kTechnologiesBitSize>;

// Adds a technology listed above to the given |tech|.
bool add_to(const std::string& text, TechnologySet* tech);

// Maps from a set of technologies to their string representations.
std::vector<std::string> techs2strings(const TechnologySet& tech);

}  // namespace technologies
}  // namespace peerd

#endif  // PEERD_TECHNOLOGIES_H_