| 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 void CompositeHostConfig::AddConfigPath(const FilePath& path) { | |
| 18 configs_.push_back(new JsonHostConfig(path)); | |
| 19 } | |
| 20 | |
| 21 bool CompositeHostConfig::Read() { | |
| 22 bool result = true; | |
| 23 for (ScopedVector<JsonHostConfig>::iterator it = configs_.begin(); | |
| 24 it != configs_.end(); ++it) { | |
| 25 result = result && (*it)->Read(); | |
| 26 } | |
| 27 return result; | |
| 28 } | |
| 29 | |
| 30 bool CompositeHostConfig::GetString(const std::string& path, | |
| 31 std::string* out_value) const { | |
| 32 for (ScopedVector<JsonHostConfig>::const_iterator it = configs_.begin(); | |
| 33 it != configs_.end(); ++it) { | |
| 34 if ((*it)->GetString(path, out_value)) | |
| 35 return true; | |
| 36 } | |
| 37 return false; | |
| 38 } | |
| 39 | |
| 40 bool CompositeHostConfig::GetBoolean(const std::string& path, | |
| 41 bool* out_value) const { | |
| 42 for (ScopedVector<JsonHostConfig>::const_iterator it = configs_.begin(); | |
| 43 it != configs_.end(); ++it) { | |
| 44 if ((*it)->GetBoolean(path, out_value)) | |
| 45 return true; | |
| 46 } | |
| 47 return false; | |
| 48 } | |
| 49 | |
| 50 } // namespace remoting | |
| OLD | NEW |