llvm-project/lldb/tools/lldb-dap/ClientLauncher.h
Sergei Druzhkov f31e8e930b
[lldb-dap][NFC] Add missed references (#174455)
Pass `args` as const reference to methods.
2026-01-05 21:30:54 +03:00

51 lines
1.4 KiB
C++

//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLDB_TOOLS_LLDB_DAP_CLIENTLAUNCHER_H
#define LLDB_TOOLS_LLDB_DAP_CLIENTLAUNCHER_H
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include <vector>
namespace lldb_dap {
class ClientLauncher {
public:
enum Client {
VSCode,
VSCodeURL,
};
virtual ~ClientLauncher() = default;
virtual llvm::Error Launch(const std::vector<llvm::StringRef> &args) = 0;
static std::optional<Client> GetClientFrom(llvm::StringRef str);
static std::unique_ptr<ClientLauncher> GetLauncher(Client client);
};
class VSCodeLauncher : public ClientLauncher {
public:
using ClientLauncher::ClientLauncher;
llvm::Error Launch(const std::vector<llvm::StringRef> &args) override;
std::string GetLaunchURL(const std::vector<llvm::StringRef> &args) const;
static std::string URLEncode(llvm::StringRef str);
};
class VSCodeURLPrinter : public VSCodeLauncher {
using VSCodeLauncher::VSCodeLauncher;
llvm::Error Launch(const std::vector<llvm::StringRef> &args) override;
};
} // namespace lldb_dap
#endif