blob: 1af88964f526967d8d08609f74453168a4009c1a [file] [log] [blame]
Chris Lattner24943d22010-06-08 16:52:24 +00001//===-- CommandObjectFile.h -------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_CommandObjectFile_h_
11#define liblldb_CommandObjectFile_h_
12
13// C Includes
14// C++ Includes
Greg Clayton143fcc32011-04-13 00:18:08 +000015#include <vector>
Chris Lattner24943d22010-06-08 16:52:24 +000016// Other libraries and framework includes
17// Project includes
Jim Ingham84cdc152010-06-15 19:49:27 +000018#include "lldb/Interpreter/Options.h"
Chris Lattner24943d22010-06-08 16:52:24 +000019#include "lldb/Core/ArchSpec.h"
20#include "lldb/Interpreter/CommandObject.h"
Greg Clayton143fcc32011-04-13 00:18:08 +000021#include "CommandObjectPlatform.h"
Chris Lattner24943d22010-06-08 16:52:24 +000022
23namespace lldb_private {
24
25//-------------------------------------------------------------------------
26// CommandObjectFile
27//-------------------------------------------------------------------------
28
Greg Clayton143fcc32011-04-13 00:18:08 +000029 class FileOptionGroup : public OptionGroup
30 {
31 public:
32
33 FileOptionGroup ();
34
35 virtual
36 ~FileOptionGroup ();
37
38
39 virtual uint32_t
40 GetNumDefinitions ();
41
42 virtual const OptionDefinition*
43 GetDefinitions ();
44
45 virtual Error
46 SetOptionValue (CommandInterpreter &interpreter,
47 uint32_t option_idx,
48 const char *option_value);
49
50 virtual void
51 OptionParsingStarting (CommandInterpreter &interpreter);
52
53 virtual Error
54 OptionParsingFinished (CommandInterpreter &interpreter);
55
56 ArchSpec m_arch;
57 lldb::PlatformSP m_arch_platform_sp; // The platform that was used to resolve m_arch
58 std::string m_arch_str; // Save the arch triple in case a platform is specified after the architecture
59 };
60
Chris Lattner24943d22010-06-08 16:52:24 +000061class CommandObjectFile : public CommandObject
62{
63public:
64
Greg Clayton238c0a12010-09-18 01:14:36 +000065 CommandObjectFile (CommandInterpreter &interpreter);
Chris Lattner24943d22010-06-08 16:52:24 +000066
67 virtual
68 ~CommandObjectFile ();
69
70 virtual bool
Greg Clayton238c0a12010-09-18 01:14:36 +000071 Execute (Args& command,
Chris Lattner24943d22010-06-08 16:52:24 +000072 CommandReturnObject &result);
73
74 virtual Options *
75 GetOptions ();
76
Jim Ingham802f8b02010-06-30 05:02:46 +000077
78 virtual int
Greg Clayton238c0a12010-09-18 01:14:36 +000079 HandleArgumentCompletion (Args &input,
Jim Ingham802f8b02010-06-30 05:02:46 +000080 int &cursor_index,
81 int &cursor_char_position,
82 OptionElementVector &opt_element_vector,
83 int match_start_point,
84 int max_return_elements,
85 bool &word_complete,
86 StringList &matches);
87
Chris Lattner24943d22010-06-08 16:52:24 +000088
89private:
Greg Clayton143fcc32011-04-13 00:18:08 +000090 OptionGroupOptions m_option_group;
91 FileOptionGroup m_file_options;
92 PlatformOptionGroup m_platform_options;
Chris Lattner24943d22010-06-08 16:52:24 +000093};
94
95} // namespace lldb_private
96
97#endif // liblldb_CommandObjectFile_h_