Gaurav Shah | 6d2c72d | 2012-10-16 16:30:44 -0700 | [diff] [blame] | 1 | // 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 | #include "shill/geolocation_info.h" |
| 6 | |
Gaurav Shah | 6d2c72d | 2012-10-16 16:30:44 -0700 | [diff] [blame] | 7 | #include <string> |
| 8 | |
| 9 | namespace shill { |
| 10 | |
| 11 | using std::string; |
| 12 | |
| 13 | GeolocationInfo::GeolocationInfo() { |
| 14 | } |
| 15 | |
| 16 | GeolocationInfo::~GeolocationInfo() { |
| 17 | } |
| 18 | |
Gaurav Shah | b790aa2 | 2012-10-23 12:51:12 -0700 | [diff] [blame] | 19 | void GeolocationInfo::AddField(const string &key, |
| 20 | const string &value) { |
Gaurav Shah | 6d2c72d | 2012-10-16 16:30:44 -0700 | [diff] [blame] | 21 | properties_[key] = value; |
| 22 | } |
| 23 | |
Gaurav Shah | b790aa2 | 2012-10-23 12:51:12 -0700 | [diff] [blame] | 24 | const string &GeolocationInfo::GetFieldValue( |
| 25 | const string &key) const { |
Gaurav Shah | 6d2c72d | 2012-10-16 16:30:44 -0700 | [diff] [blame] | 26 | return properties_.find(key)->second; |
| 27 | } |
| 28 | |
| 29 | bool GeolocationInfo::Equals(const GeolocationInfo &info) const{ |
| 30 | return properties_ == info.properties_; |
| 31 | } |
| 32 | |
| 33 | } // namespace shill |