blob: c728367a218553324416917ac8d9834d289775f2 [file] [log] [blame]
//===-- OutputRedirector.h -------------------------------------*- C++ -*-===//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include <thread>
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
namespace lldb_vscode {
/// Redirects the output of a given file descriptor to a callback.
/// \return
/// \a Error::success if the redirection was set up correctly, or an error
/// otherwise.
llvm::Error RedirectFd(int fd, std::function<void(llvm::StringRef)> callback);
} // namespace lldb_vscode