summaryrefslogtreecommitdiffstats
path: root/lldb/include/lldb/Interpreter/CommandAlias.h
blob: cfe693dc2f0450f2f30f63eb8dfca477f1a005c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//===-- CommandAlias.h -----------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef liblldb_CommandAlias_h_
#define liblldb_CommandAlias_h_

// C Includes
// C++ Includes
#include <memory>

// Other libraries and framework includes
// Project includes
#include "lldb/lldb-forward.h"
#include "lldb/Interpreter/Args.h"

namespace lldb_private {
class CommandAlias
{
public:
    typedef std::unique_ptr<CommandAlias> UniquePointer;

    static UniquePointer
    GetCommandAlias (lldb::CommandObjectSP cmd_sp,
                     const char *options_args);
    
    void
    GetAliasExpansion (StreamString &help_string);
    
    bool
    IsValid ()
    {
        return m_underlying_command_sp && m_option_args_sp;
    }
    
    explicit operator bool ()
    {
        return IsValid();
    }
    
    lldb::CommandObjectSP GetUnderlyingCommand() { return m_underlying_command_sp; }
    OptionArgVectorSP GetOptionArguments() { return m_option_args_sp; }
    
protected:
    CommandAlias (lldb::CommandObjectSP cmd_sp = nullptr,
                  OptionArgVectorSP args_sp = nullptr);
    
private:
    lldb::CommandObjectSP m_underlying_command_sp;
    OptionArgVectorSP m_option_args_sp ;
};
} // namespace lldb_private

#endif // liblldb_CommandAlias_h_
OpenPOWER on IntegriCloud