[libcamera-devel,v2,1/5] cam: options: Make KeyValueParser::parse() virtual

Message ID 20200427220529.1085074-2-niklas.soderlund@ragnatech.se
State Superseded
Headers show
Series
  • {cam, qcam}: Unify stream option parsing
Related show

Commit Message

Niklas Söderlund April 27, 2020, 10:05 p.m. UTC
Prepare for sub-classing of the KeyValueParser by making the parse()
method virtual.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
 src/cam/options.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Laurent Pinchart April 27, 2020, 10:33 p.m. UTC | #1
Hi Niklas,

Thank you for the patch.

On Tue, Apr 28, 2020 at 12:05:25AM +0200, Niklas Söderlund wrote:
> Prepare for sub-classing of the KeyValueParser by making the parse()
> method virtual.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> ---
>  src/cam/options.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/cam/options.h b/src/cam/options.h
> index 5e346b474f765841..5060fee0c26b896f 100644
> --- a/src/cam/options.h
> +++ b/src/cam/options.h
> @@ -71,10 +71,12 @@ public:
>  	{
>  	};
>  
> +	virtual ~KeyValueParser(){};

s/{};/ {}/

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +
>  	bool addOption(const char *name, OptionType type, const char *help,
>  		       OptionArgument argument = ArgumentNone);
>  
> -	Options parse(const char *arguments);
> +	virtual Options parse(const char *arguments);
>  	void usage(int indent);
>  
>  private:

Patch

diff --git a/src/cam/options.h b/src/cam/options.h
index 5e346b474f765841..5060fee0c26b896f 100644
--- a/src/cam/options.h
+++ b/src/cam/options.h
@@ -71,10 +71,12 @@  public:
 	{
 	};
 
+	virtual ~KeyValueParser(){};
+
 	bool addOption(const char *name, OptionType type, const char *help,
 		       OptionArgument argument = ArgumentNone);
 
-	Options parse(const char *arguments);
+	virtual Options parse(const char *arguments);
 	void usage(int indent);
 
 private: