mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 23:39:44 +03:00
cam: options: Move struct Option
The Option structure is declared within the OptionsParser, but will later be needed by other parsers. Move it outside the OptionsParser class. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
parent
0b2822749e
commit
377516a084
1 changed files with 11 additions and 11 deletions
|
@ -17,6 +17,17 @@ enum OptionArgument {
|
||||||
ArgumentOptional,
|
ArgumentOptional,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Option {
|
||||||
|
int opt;
|
||||||
|
const char *name;
|
||||||
|
OptionArgument argument;
|
||||||
|
const char *argumentName;
|
||||||
|
const char *help;
|
||||||
|
|
||||||
|
bool hasShortOption() const { return isalnum(opt); }
|
||||||
|
bool hasLongOption() const { return name != nullptr; }
|
||||||
|
};
|
||||||
|
|
||||||
class OptionsParser
|
class OptionsParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -42,17 +53,6 @@ public:
|
||||||
void usage();
|
void usage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct Option {
|
|
||||||
int opt;
|
|
||||||
const char *name;
|
|
||||||
OptionArgument argument;
|
|
||||||
const char *argumentName;
|
|
||||||
const char *help;
|
|
||||||
|
|
||||||
bool hasShortOption() const { return isalnum(opt); }
|
|
||||||
bool hasLongOption() const { return name != nullptr; }
|
|
||||||
};
|
|
||||||
|
|
||||||
std::vector<Option> options_;
|
std::vector<Option> options_;
|
||||||
std::map<unsigned int, Option *> optionsMap_;
|
std::map<unsigned int, Option *> optionsMap_;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue