blob: 20b924317ef90ca22d12697b1aab67be830609d9 [file] [log] [blame]
Gaurav Shah6d2c72d2012-10-16 16:30:44 -07001// Copyright (c) 2012 The Chromium OS 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 SHILL_GEOLOCATION_INFO_
6#define SHILL_GEOLOCATION_INFO_
7
8#include <map>
9#include <string>
Gaurav Shahb790aa22012-10-23 12:51:12 -070010#include <vector>
Gaurav Shah6d2c72d2012-10-16 16:30:44 -070011
12#include <gtest/gtest_prod.h> // for FRIEND_TEST
13
14namespace shill {
15
16class WiFiMainTest;
17
18// This class stores properties (key-value pairs) for a single entity
19// (e.g. a WiFi access point) that may be used for geolocation.
20class GeolocationInfo {
21 public:
22 GeolocationInfo();
23 ~GeolocationInfo();
24
25 void AddField(const std::string &key, const std::string &value);
26 const std::string &GetFieldValue(const std::string &key) const;
Gaurav Shahb790aa22012-10-23 12:51:12 -070027
28 const std::map<std::string, std::string> properties() const {
29 return properties_;
30 }
31
Gaurav Shah6d2c72d2012-10-16 16:30:44 -070032 private:
33 FRIEND_TEST(WiFiMainTest, GetGeolocationObjects);
34
35 // An equality testing helper for unit tests.
36 bool Equals(const GeolocationInfo &info) const;
37
38 std::map<std::string, std::string> properties_;
39};
40
Gaurav Shahb790aa22012-10-23 12:51:12 -070041typedef std::vector<GeolocationInfo> GeolocationInfos;
42
Gaurav Shah6d2c72d2012-10-16 16:30:44 -070043} // namespace shill
44
45#endif // SHILL_GEOLOCATION_INFO_