blob: d6b721fd7ca3c59f604c627ba5370af32dfd506a [file] [log] [blame]
Peter Qiuc0beca52015-09-03 11:25:46 -07001//
2// Copyright (C) 2012 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
Gaurav Shah6d2c72d2012-10-16 16:30:44 -070016
Ben Chanc45688b2014-07-02 23:50:45 -070017#ifndef SHILL_GEOLOCATION_INFO_H_
18#define SHILL_GEOLOCATION_INFO_H_
Gaurav Shah6d2c72d2012-10-16 16:30:44 -070019
20#include <map>
21#include <string>
Gaurav Shahb790aa22012-10-23 12:51:12 -070022#include <vector>
Gaurav Shah6d2c72d2012-10-16 16:30:44 -070023
24#include <gtest/gtest_prod.h> // for FRIEND_TEST
25
26namespace shill {
27
28class WiFiMainTest;
29
30// This class stores properties (key-value pairs) for a single entity
31// (e.g. a WiFi access point) that may be used for geolocation.
32class GeolocationInfo {
33 public:
34 GeolocationInfo();
35 ~GeolocationInfo();
36
Paul Stewart8ae18742015-06-16 13:13:10 -070037 void AddField(const std::string& key, const std::string& value);
38 const std::string& GetFieldValue(const std::string& key) const;
Gaurav Shahb790aa22012-10-23 12:51:12 -070039
40 const std::map<std::string, std::string> properties() const {
41 return properties_;
42 }
43
Gaurav Shah6d2c72d2012-10-16 16:30:44 -070044 private:
45 FRIEND_TEST(WiFiMainTest, GetGeolocationObjects);
46
47 // An equality testing helper for unit tests.
Paul Stewart8ae18742015-06-16 13:13:10 -070048 bool Equals(const GeolocationInfo& info) const;
Gaurav Shah6d2c72d2012-10-16 16:30:44 -070049
50 std::map<std::string, std::string> properties_;
51};
52
Gaurav Shahb790aa22012-10-23 12:51:12 -070053typedef std::vector<GeolocationInfo> GeolocationInfos;
54
Gaurav Shah6d2c72d2012-10-16 16:30:44 -070055} // namespace shill
56
Ben Chanc45688b2014-07-02 23:50:45 -070057#endif // SHILL_GEOLOCATION_INFO_H_