diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
commit | 5f29bb8a675e8f96452b632e7129113f7dec850e (patch) | |
tree | 3d3f2a0d3ad10872a4dcaba8ec8d1d20c87ab147 /include/lldb/Interpreter/Options.h | |
parent | 88c643b6fec27eec436c8d138fee6346e92337d6 (diff) |
Notes
Diffstat (limited to 'include/lldb/Interpreter/Options.h')
-rw-r--r-- | include/lldb/Interpreter/Options.h | 59 |
1 files changed, 21 insertions, 38 deletions
diff --git a/include/lldb/Interpreter/Options.h b/include/lldb/Interpreter/Options.h index aa9e564083a9..a008d51d721e 100644 --- a/include/lldb/Interpreter/Options.h +++ b/include/lldb/Interpreter/Options.h @@ -1,9 +1,8 @@ //===-- Options.h -----------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -47,8 +46,7 @@ static inline bool isprint8(int ch) { return isprint(ch); } -//---------------------------------------------------------------------- -/// @class Options Options.h "lldb/Interpreter/Options.h" +/// \class Options Options.h "lldb/Interpreter/Options.h" /// A command line option parsing protocol class. /// /// Options is designed to be subclassed to contain all needed options for a @@ -61,7 +59,6 @@ static inline bool isprint8(int ch) { /// *optstring, const struct option *longopts, int *longindex); /// \endcode /// -//---------------------------------------------------------------------- class Options { public: Options(); @@ -74,12 +71,10 @@ public: uint32_t NumCommandOptions(); - //------------------------------------------------------------------ /// Get the option definitions to use when parsing Args options. /// - /// @see Args::ParseOptions (Options&) - /// @see man getopt_long_only - //------------------------------------------------------------------ + /// \see Args::ParseOptions (Options&) + /// \see man getopt_long_only Option *GetLongOptions(); // This gets passed the short option as an integer... @@ -115,7 +110,6 @@ public: // and subclasses shouldn't have to do it. void NotifyOptionParsingStarting(ExecutionContext *execution_context); - //------------------------------------------------------------------ /// Parse the provided arguments. /// /// The parsed options are set via calls to SetOptionValue. In case of a @@ -132,7 +126,6 @@ public: /// param[in] require_validation /// When true, it will fail option parsing if validation could /// not occur due to not having a platform. - //------------------------------------------------------------------ llvm::Expected<Args> Parse(const Args &args, ExecutionContext *execution_context, lldb::PlatformSP platform_sp, @@ -147,66 +140,60 @@ public: Status NotifyOptionParsingFinished(ExecutionContext *execution_context); - //------------------------------------------------------------------ /// Set the value of an option. /// - /// @param[in] option_idx + /// \param[in] option_idx /// The index into the "struct option" array that was returned /// by Options::GetLongOptions(). /// - /// @param[in] option_arg + /// \param[in] option_arg /// The argument value for the option that the user entered, or /// nullptr if there is no argument for the current option. /// - /// @param[in] execution_context + /// \param[in] execution_context /// The execution context to use for evaluating the option. /// May be nullptr if the option is to be evaluated outside any /// particular context. /// - /// @see Args::ParseOptions (Options&) - /// @see man getopt_long_only - //------------------------------------------------------------------ + /// \see Args::ParseOptions (Options&) + /// \see man getopt_long_only virtual Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) = 0; - //------------------------------------------------------------------ /// Handles the generic bits of figuring out whether we are in an option, /// and if so completing it. /// - /// @param[in/out] request + /// \param[in/out] request /// The completion request that we need to act upon. /// - /// @param[in] interpreter + /// \param[in] interpreter /// The interpreter that's doing the completing. /// /// FIXME: This is the wrong return value, since we also need to /// make a distinction between total number of matches, and the window the /// user wants returned. /// - /// @return + /// \return /// \btrue if we were in an option, \bfalse otherwise. - //------------------------------------------------------------------ bool HandleOptionCompletion(lldb_private::CompletionRequest &request, OptionElementVector &option_map, CommandInterpreter &interpreter); - //------------------------------------------------------------------ /// Handles the generic bits of figuring out whether we are in an option, /// and if so completing it. /// - /// @param[in/out] request + /// \param[in/out] request /// The completion request that we need to act upon. /// - /// @param[in] interpreter + /// \param[in] interpreter /// The command interpreter doing the completion. /// /// FIXME: This is the wrong return value, since we also need to /// make a distinction between total number of matches, and the window the /// user wants returned. /// - /// @return + /// \return /// \btrue if we were in an option, \bfalse otherwise. - //------------------------------------------------------------------ virtual bool HandleOptionArgumentCompletion(lldb_private::CompletionRequest &request, OptionElementVector &opt_element_vector, @@ -284,40 +271,36 @@ public: ~OptionGroupOptions() override = default; - //---------------------------------------------------------------------- /// Append options from a OptionGroup class. /// /// Append all options from \a group using the exact same option groups that /// each option is defined with. /// - /// @param[in] group + /// \param[in] group /// A group of options to take option values from and copy their /// definitions into this class. - //---------------------------------------------------------------------- void Append(OptionGroup *group); - //---------------------------------------------------------------------- /// Append options from a OptionGroup class. /// /// Append options from \a group that have a usage mask that has any bits in /// "src_mask" set. After the option definition is copied into the options /// definitions in this class, set the usage_mask to "dst_mask". /// - /// @param[in] group + /// \param[in] group /// A group of options to take option values from and copy their /// definitions into this class. /// - /// @param[in] src_mask + /// \param[in] src_mask /// When copying options from \a group, you might only want some of /// the options to be appended to this group. This mask allows you /// to control which options from \a group get added. It also allows /// you to specify the same options from \a group multiple times /// for different option sets. /// - /// @param[in] dst_mask + /// \param[in] dst_mask /// Set the usage mask for any copied options to \a dst_mask after /// copying the option definition. - //---------------------------------------------------------------------- void Append(OptionGroup *group, uint32_t src_mask, uint32_t dst_mask); void Finalize(); |