Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | //===-- Connection.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 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 10 | #include "lldb/Core/Connection.h" |
| 11 | |
Zachary Turner | 12792af | 2014-10-06 21:23:09 +0000 | [diff] [blame] | 12 | #if defined(_WIN32) |
| 13 | #include "lldb/Host/windows/ConnectionGenericFileWindows.h" |
| 14 | #endif |
| 15 | |
| 16 | #include "lldb/Host/ConnectionFileDescriptor.h" |
| 17 | |
Zachary Turner | 2f3df61 | 2017-04-06 21:28:29 +0000 | [diff] [blame] | 18 | #include <string.h> // for strstr |
| 19 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 20 | using namespace lldb_private; |
| 21 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 22 | Connection::Connection() {} |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 23 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 24 | Connection::~Connection() {} |
Zachary Turner | 12792af | 2014-10-06 21:23:09 +0000 | [diff] [blame] | 25 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 26 | Connection *Connection::CreateDefaultConnection(const char *url) { |
Zachary Turner | 12792af | 2014-10-06 21:23:09 +0000 | [diff] [blame] | 27 | #if defined(_WIN32) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 28 | if (strstr(url, "file://") == url) |
| 29 | return new ConnectionGenericFile(); |
Zachary Turner | 12792af | 2014-10-06 21:23:09 +0000 | [diff] [blame] | 30 | #endif |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 31 | return new ConnectionFileDescriptor(); |
Zachary Turner | 12792af | 2014-10-06 21:23:09 +0000 | [diff] [blame] | 32 | } |