OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium 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 "remoting/host/composite_host_config.h" |
| 6 |
| 7 #include "remoting/host/json_host_config.h" |
| 8 |
| 9 namespace remoting { |
| 10 |
| 11 CompositeHostConfig::CompositeHostConfig() { |
| 12 } |
| 13 |
| 14 CompositeHostConfig::~CompositeHostConfig() { |
| 15 } |
| 16 |
| 17 bool CompositeHostConfig::AddConfigPath(const FilePath& path) { |
| 18 scoped_ptr<JsonHostConfig> config(new JsonHostConfig(path)); |
| 19 if (!config->Read()) { |
| 20 return false; |
| 21 } |
| 22 configs_.push_back(config.release()); |
| 23 return true; |
| 24 } |
| 25 |
| 26 bool CompositeHostConfig::GetString(const std::string& path, |
| 27 std::string* out_value) const { |
| 28 for (std::vector<HostConfig*>::const_iterator it = configs_.begin(); |
| 29 it != configs_.end(); ++it) { |
| 30 if ((*it)->GetString(path, out_value)) |
| 31 return true; |
| 32 } |
| 33 return false; |
| 34 } |
| 35 |
| 36 bool CompositeHostConfig::GetBoolean(const std::string& path, |
| 37 bool* out_value) const { |
| 38 for (std::vector<HostConfig*>::const_iterator it = configs_.begin(); |
| 39 it != configs_.end(); ++it) { |
| 40 if ((*it)->GetBoolean(path, out_value)) |
| 41 return true; |
| 42 } |
| 43 return false; |
| 44 } |
| 45 |
| 46 } // namespace remoting |
OLD | NEW |