| // Copyright 2017 The Chromium OS Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #include "debugd/src/variant_utils.h" |
| |
| namespace debugd { |
| |
| bool AddIntOption(ProcessWithId* process, |
| const brillo::VariantDictionary& options, |
| const std::string& key, |
| const std::string& flag_name, |
| brillo::ErrorPtr* error) { |
| int value; |
| ParseResult result = GetOption(options, key, &value, error); |
| if (result == ParseResult::PARSED) |
| process->AddIntOption(flag_name, value); |
| |
| return result != ParseResult::PARSE_ERROR; |
| } |
| |
| } // namespace debugd |