mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-29 18:35:37 -04:00
[libcalamares] Implement object-style command line
- handle command: and timeout: entries - test for setting the values
This commit is contained in:
parent
72bac332be
commit
c641f5dec6
3 changed files with 46 additions and 1 deletions
|
@ -33,6 +33,12 @@ namespace CalamaresUtils
|
|||
*/
|
||||
struct CommandLine : public QPair< QString, int >
|
||||
{
|
||||
/// An invalid command line
|
||||
CommandLine()
|
||||
: QPair< QString, int >( QString(), -1 )
|
||||
{
|
||||
}
|
||||
|
||||
CommandLine( const QString& s )
|
||||
: QPair< QString, int >( s, 10 )
|
||||
{
|
||||
|
@ -52,6 +58,11 @@ struct CommandLine : public QPair< QString, int >
|
|||
{
|
||||
return second;
|
||||
}
|
||||
|
||||
bool isValid() const
|
||||
{
|
||||
return !first.isEmpty();
|
||||
}
|
||||
} ;
|
||||
|
||||
/** @brief Abbreviation, used internally. */
|
||||
|
@ -82,6 +93,7 @@ public:
|
|||
using CommandList_t::cbegin;
|
||||
using CommandList_t::cend;
|
||||
using CommandList_t::const_iterator;
|
||||
using CommandList_t::at;
|
||||
|
||||
protected:
|
||||
using CommandList_t::append;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue