10127ef0fSEd Maste //===-- CommandOptionValidators.cpp -----------------------------*- C++ -*-===//
20127ef0fSEd Maste //
30127ef0fSEd Maste //                     The LLVM Compiler Infrastructure
40127ef0fSEd Maste //
50127ef0fSEd Maste // This file is distributed under the University of Illinois Open Source
60127ef0fSEd Maste // License. See LICENSE.TXT for details.
70127ef0fSEd Maste //
80127ef0fSEd Maste //===----------------------------------------------------------------------===//
90127ef0fSEd Maste 
100127ef0fSEd Maste #include "lldb/Interpreter/CommandOptionValidators.h"
110127ef0fSEd Maste 
120127ef0fSEd Maste #include "lldb/Interpreter/CommandInterpreter.h"
130127ef0fSEd Maste #include "lldb/Target/Platform.h"
140127ef0fSEd Maste 
150127ef0fSEd Maste using namespace lldb;
160127ef0fSEd Maste using namespace lldb_private;
170127ef0fSEd Maste 
IsValid(Platform & platform,const ExecutionContext & target) const18*435933ddSDimitry Andric bool PosixPlatformCommandOptionValidator::IsValid(
19*435933ddSDimitry Andric     Platform &platform, const ExecutionContext &target) const {
20*435933ddSDimitry Andric   llvm::Triple::OSType os =
21*435933ddSDimitry Andric       platform.GetSystemArchitecture().GetTriple().getOS();
22*435933ddSDimitry Andric   switch (os) {
230127ef0fSEd Maste   // Are there any other platforms that are not POSIX-compatible?
240127ef0fSEd Maste   case llvm::Triple::Win32:
250127ef0fSEd Maste     return false;
260127ef0fSEd Maste   default:
270127ef0fSEd Maste     return true;
280127ef0fSEd Maste   }
290127ef0fSEd Maste }
300127ef0fSEd Maste 
ShortConditionString() const31*435933ddSDimitry Andric const char *PosixPlatformCommandOptionValidator::ShortConditionString() const {
320127ef0fSEd Maste   return "POSIX";
330127ef0fSEd Maste }
340127ef0fSEd Maste 
LongConditionString() const35*435933ddSDimitry Andric const char *PosixPlatformCommandOptionValidator::LongConditionString() const {
360127ef0fSEd Maste   return "Option only valid for POSIX-compliant hosts.";
370127ef0fSEd Maste }
38