blob: 60d1221c160ccd5b4f11df28dd78d73f7f8fd115 [file] [log] [blame]
Chris Lattner30fdc8d2010-06-08 16:52:24 +00001//===-- 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 Lattner30fdc8d2010-06-08 16:52:24 +000010#include "lldb/Core/Connection.h"
11
Zachary Turner12792af2014-10-06 21:23:09 +000012#if defined(_WIN32)
13#include "lldb/Host/windows/ConnectionGenericFileWindows.h"
14#endif
15
16#include "lldb/Host/ConnectionFileDescriptor.h"
17
Zachary Turner2f3df612017-04-06 21:28:29 +000018#include <string.h> // for strstr
19
Chris Lattner30fdc8d2010-06-08 16:52:24 +000020using namespace lldb_private;
21
Kate Stoneb9c1b512016-09-06 20:57:50 +000022Connection::Connection() {}
Chris Lattner30fdc8d2010-06-08 16:52:24 +000023
Kate Stoneb9c1b512016-09-06 20:57:50 +000024Connection::~Connection() {}
Zachary Turner12792af2014-10-06 21:23:09 +000025
Kate Stoneb9c1b512016-09-06 20:57:50 +000026Connection *Connection::CreateDefaultConnection(const char *url) {
Zachary Turner12792af2014-10-06 21:23:09 +000027#if defined(_WIN32)
Kate Stoneb9c1b512016-09-06 20:57:50 +000028 if (strstr(url, "file://") == url)
29 return new ConnectionGenericFile();
Zachary Turner12792af2014-10-06 21:23:09 +000030#endif
Kate Stoneb9c1b512016-09-06 20:57:50 +000031 return new ConnectionFileDescriptor();
Zachary Turner12792af2014-10-06 21:23:09 +000032}