From patchwork Thu Jan 31 23:47:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 462 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 545E360DBB for ; Fri, 1 Feb 2019 00:47:36 +0100 (CET) Received: from pendragon.ideasonboard.com (85-76-34-136-nat.elisa-mobile.fi [85.76.34.136]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 69B9241; Fri, 1 Feb 2019 00:47:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1548978455; bh=s1qlEfEwpCpQPl9CEYvMUJVqLPjuycDiB/CiAU4HOTQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WMfpaUg10KOjUQcKzFbmrPrDemMCKlGjQsvk5/Eu+VaQ30HrmHrPUjs2ixPwQtUH8 zi0KDZBc+926eTl7kZ9lgGgbkD271AiuSXiFuB6KfWPMnxa5MPcQcmG2Jg4iYX2fov Cja/sKBJyLIPwjUyd9K5jgfBunyuzXVzCAqHVt5w= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Fri, 1 Feb 2019 01:47:15 +0200 Message-Id: <20190131234721.22606-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190131234721.22606-1-laurent.pinchart@ideasonboard.com> References: <20190131234721.22606-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/8] cam: options: Move struct Option X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 23:47:36 -0000 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 Reviewed-by: Niklas Söderlund --- src/cam/options.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/cam/options.h b/src/cam/options.h index 491f6a316fff..6d1b12d235d8 100644 --- a/src/cam/options.h +++ b/src/cam/options.h @@ -17,6 +17,17 @@ enum OptionArgument { 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 { public: @@ -42,17 +53,6 @@ public: void usage(); 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