Colm Donelan | a21620d | 2019-10-11 13:09:49 +0100 | [diff] [blame] | 1 | // |
Jim Flynn | bbfe603 | 2020-07-20 16:57:44 +0100 | [diff] [blame] | 2 | // Copyright © 2019 Arm Ltd and Contributors. All rights reserved. |
Colm Donelan | a21620d | 2019-10-11 13:09:49 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | #pragma once |
| 6 | |
| 7 | #include <string> |
| 8 | |
| 9 | namespace armnn |
| 10 | { |
| 11 | |
| 12 | namespace gatordmock |
| 13 | { |
| 14 | |
Colm Donelan | a21620d | 2019-10-11 13:09:49 +0100 | [diff] [blame] | 15 | /// Use Boost program options to process the command line. |
| 16 | /// -h or --help to print the options. |
| 17 | /// -n or --namespace to specify the UDS namespace that the server will be listening on. |
| 18 | /// -e or --echo print all sent and received packets to stdout. |
| 19 | /// -f or --file The path to the file that contains instructions for the mock gatord. |
| 20 | class CommandLineProcessor |
| 21 | { |
| 22 | public: |
Colm Donelan | b682d84 | 2019-10-16 12:24:20 +0100 | [diff] [blame] | 23 | bool ProcessCommandLine(int argc, char* argv[]); |
| 24 | bool IsEchoEnabled() |
| 25 | { |
| 26 | return m_Echo; |
| 27 | } |
Colm Donelan | a21620d | 2019-10-11 13:09:49 +0100 | [diff] [blame] | 28 | |
Colm Donelan | b682d84 | 2019-10-16 12:24:20 +0100 | [diff] [blame] | 29 | std::string GetUdsNamespace() |
| 30 | { |
| 31 | return m_UdsNamespace; |
| 32 | } |
| 33 | std::string GetCommandFile() |
| 34 | { |
| 35 | return m_File; |
| 36 | } |
Colm Donelan | a21620d | 2019-10-11 13:09:49 +0100 | [diff] [blame] | 37 | |
| 38 | private: |
| 39 | std::string m_UdsNamespace; |
| 40 | std::string m_File; |
| 41 | |
| 42 | bool m_Echo; |
| 43 | }; |
| 44 | |
Colm Donelan | b682d84 | 2019-10-16 12:24:20 +0100 | [diff] [blame] | 45 | } // namespace gatordmock |
Colm Donelan | a21620d | 2019-10-11 13:09:49 +0100 | [diff] [blame] | 46 | |
Colm Donelan | b682d84 | 2019-10-16 12:24:20 +0100 | [diff] [blame] | 47 | } // namespace armnn |