File indexing completed on 2026-05-10 08:42:49
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_HOST_OPTIONPARSER_H
0010 #define LLDB_HOST_OPTIONPARSER_H
0011
0012 #include <mutex>
0013 #include <string>
0014
0015 #include "llvm/ADT/StringRef.h"
0016 #include "llvm/ADT/ArrayRef.h"
0017
0018 struct option;
0019
0020 namespace lldb_private {
0021
0022 struct OptionDefinition;
0023
0024 struct Option {
0025
0026 const OptionDefinition *definition;
0027
0028 int *flag;
0029
0030 int val;
0031 };
0032
0033 class OptionParser {
0034 public:
0035 enum OptionArgument { eNoArgument = 0, eRequiredArgument, eOptionalArgument };
0036
0037 static void Prepare(std::unique_lock<std::mutex> &lock);
0038
0039 static void EnableError(bool error);
0040
0041
0042
0043 static int Parse(llvm::MutableArrayRef<char *> argv,
0044 llvm::StringRef optstring, const Option *longopts,
0045 int *longindex);
0046
0047 static char *GetOptionArgument();
0048 static int GetOptionIndex();
0049 static int GetOptionErrorCause();
0050 static std::string GetShortOptionString(struct option *long_options);
0051 };
0052 }
0053
0054 #endif