From patchwork Wed Jul 7 02:19:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 12817 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id EB862BD794 for ; Wed, 7 Jul 2021 02:20:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1FE7968518; Wed, 7 Jul 2021 04:20:37 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="K6K9WFPa"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 01CF368506 for ; Wed, 7 Jul 2021 04:20:33 +0200 (CEST) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8B14E2E4 for ; Wed, 7 Jul 2021 04:20:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1625624432; bh=R/qMO5o5HOEtdLAGq//T6U0IGZuZS2NFt8bYoUAD6H4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=K6K9WFParKf+48TbdBKMxXuVj9rigBNdNw+rhzWfuD3/+xiA2hGvCW6KxPrpgA1i+ hpub9lmTbFciEBXASAO31kNoxRHGfZnIVsnyPsb986PTCItgQIiqYiTGlx+SXzvtjN W36kCE2oyU8jFB0aHT26BYWnVeJJA+q196D2lGRA= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Wed, 7 Jul 2021 05:19:15 +0300 Message-Id: <20210707021941.20804-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210707021941.20804-1-laurent.pinchart@ideasonboard.com> References: <20210707021941.20804-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 04/30] cam: options: Move OptionValue class after OptionsParser X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" To prepare for usage of the OptionsParser::Options class in OptionValue, move the definition of the OptionValue class after OptionsParser. There is not functional change. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/cam/options.h | 54 +++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/cam/options.h b/src/cam/options.h index 688fe26011f8..a3b18bb6c4ea 100644 --- a/src/cam/options.h +++ b/src/cam/options.h @@ -74,6 +74,33 @@ private: std::map optionsMap_; }; +class OptionsParser +{ +public: + class Options : public OptionsBase + { + }; + + OptionsParser(); + ~OptionsParser(); + + bool addOption(int opt, OptionType type, const char *help, + const char *name = nullptr, + OptionArgument argument = ArgumentNone, + const char *argumentName = nullptr, bool array = false); + bool addOption(int opt, KeyValueParser *parser, const char *help, + const char *name = nullptr, bool array = false); + + Options parse(int argc, char *argv[]); + void usage(); + +private: + void parseValueError(const Option &option); + + std::list