1 //===-- CommandOptionValidators.cpp -----------------------------*- 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 #include "lldb/Interpreter/CommandOptionValidators.h"
11 
12 #include "lldb/Interpreter/CommandInterpreter.h"
13 #include "lldb/Target/Platform.h"
14 
15 using namespace lldb;
16 using namespace lldb_private;
17 
18 bool PosixPlatformCommandOptionValidator::IsValid(Platform &platform, const ExecutionContext &target) const
19 {
20     llvm::Triple::OSType os = platform.GetSystemArchitecture().GetTriple().getOS();
21     switch (os)
22     {
23     // Are there any other platforms that are not POSIX-compatible?
24     case llvm::Triple::Win32:
25         return false;
26     default:
27         return true;
28     }
29 }
30 
31 const char* PosixPlatformCommandOptionValidator::ShortConditionString() const
32 {
33     return "POSIX";
34 }
35 
36 const char* PosixPlatformCommandOptionValidator::LongConditionString() const
37 {
38     return "Option only valid for POSIX-compliant hosts.";
39 }
40