llvm-project/lldb/tools/lldb-mi/MICmdArgValListBase.h
Kate Stone b9c1b51e45 *** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style.  This kind of mass change has
*** two obvious implications:

Firstly, merging this particular commit into a downstream fork may be a huge
effort.  Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit.  The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):

    find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
    find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;

The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.

Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit.  There are alternatives available that will attempt
to look through this change and find the appropriate prior commit.  YMMV.

llvm-svn: 280751
2016-09-06 20:57:50 +00:00

104 lines
3.4 KiB
C++

//===-- MICmdArgValListBase.h -----------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#pragma once
// Third party headers:
#include <vector>
// In-house headers:
#include "MICmdArgValBase.h"
// Declarations:
class CMICmdArgContext;
//++
//============================================================================
// Details: MI common code class. Command argument with addition options class.
// For example --recurse 1 2 4 [group ...]. Arguments object that
// require a list of options associated with them derive from the
// CMICmdArgValListBase class. Additional options are also extracted
// from
// the command arguments text string.
// An argument knows what type of argument it is and how it is to
// interpret the options (context) string to find and validate a
// matching
// options and so extract a values from it .
// The CMICmdArgValBase objects are added to the derived argument
// class's
// container. The option arguments belong to that derived class and
// will
// be deleted that object goes out of scope.
// Based on the Interpreter pattern.
//--
class CMICmdArgValListBase
: public CMICmdArgValBaseTemplate<std::vector<CMICmdArgValBase *>> {
// Typedef:
public:
typedef std::vector<CMICmdArgValBase *> VecArgObjPtr_t;
// Enums:
public:
//++
//---------------------------------------------------------------------------------
// Details: CMICmdArgValListBase needs to know what type of argument to look
// for in
// the command options text. It also needs to create argument objects
// of
// a specific type.
//--
enum ArgValType_e {
eArgValType_File = 0,
eArgValType_Consume,
eArgValType_Number,
eArgValType_OptionLong,
eArgValType_OptionShort,
eArgValType_String,
eArgValType_StringQuoted,
eArgValType_StringQuotedNumber,
eArgValType_StringQuotedNumberPath,
eArgValType_StringAnything, // Accept any words for a string 'type' even if
// they look like --longOptions for example
eArgValType_ThreadGrp,
eArgValType_count, // Always the last one
eArgValType_invalid
};
// Methods:
public:
/* ctor */ CMICmdArgValListBase();
/* ctor */ CMICmdArgValListBase(const CMIUtilString &vrArgName,
const bool vbMandatory,
const bool vbHandleByCmd);
/* ctor */ CMICmdArgValListBase(const CMIUtilString &vrArgName,
const bool vbMandatory,
const bool vbHandleByCmd,
const ArgValType_e veType);
// Overridden:
public:
// From CMICmdArgValBase
/* dtor */ ~CMICmdArgValListBase() override;
// Methods:
protected:
bool IsExpectedCorrectType(const CMIUtilString &vrTxt,
const ArgValType_e veType) const;
CMICmdArgValBase *CreationObj(const CMIUtilString &vrTxt,
const ArgValType_e veType) const;
// Attributes:
protected:
ArgValType_e m_eArgType;
// Methods:
private:
void Destroy();
};