blob: 9b0f2e0601110e927c6d838b1da926d77b12b84d [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
Ben Chanc45688b2014-07-02 23:50:45 -07005#ifndef SHILL_GEOLOCATION_INFO_H_
6#define SHILL_GEOLOCATION_INFO_H_
Gaurav Shah6d2c72d2012-10-16 16:30:44 -07007
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
Paul Stewart8ae18742015-06-16 13:13:10 -070025 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.
Paul Stewart8ae18742015-06-16 13:13:10 -070036 bool Equals(const GeolocationInfo& info) const;
Gaurav Shah6d2c72d2012-10-16 16:30:44 -070037
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
Ben Chanc45688b2014-07-02 23:50:45 -070045#endif // SHILL_GEOLOCATION_INFO_H_