| // Copyright 2024 Google LLC |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| #pragma once |
| |
| #include "dbus_interface.hpp" |
| #include "parser.hpp" |
| #include "payload_update_common.hpp" |
| |
| #include <memory> |
| #include <string> |
| #include <vector> |
| |
| namespace google::hoth::tools |
| { |
| namespace payload_update |
| { |
| class PayloadUpdateCLI |
| { |
| public: |
| PayloadUpdateCLI(std::unique_ptr<Parser> parser, |
| std::unique_ptr<DBusInterface> bus) : |
| parser(std::move(parser)), |
| dbus(std::move(bus)) |
| {} |
| bool getOptions(); |
| bool execute(); |
| |
| private: |
| bool doUpdate(); |
| Args args; |
| std::unique_ptr<Parser> parser; |
| std::unique_ptr<DBusInterface> dbus; |
| }; |
| } // namespace payload_update |
| } // namespace google::hoth::tools |