[libcalamares] Implement object-style command line

- handle command: and timeout: entries
 - test for setting the values
This commit is contained in:
Adriaan de Groot 2018-01-29 21:08:42 +01:00
parent 72bac332be
commit c641f5dec6
3 changed files with 46 additions and 1 deletions

View file

@ -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;