nixd
Toggle main menu visibility
Loading...
Searching...
No Matches
nixd
include
nixd
Support
StreamProc.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
nixd/Support/PipedProc.h
"
4
5
#include <llvm/Support/raw_ostream.h>
6
#include <
lspserver/Connection.h
>
7
8
namespace
nixd
{
9
10
struct
StreamProc
{
11
private
:
12
std::unique_ptr<util::PipedProc> Proc;
13
std::unique_ptr<llvm::raw_fd_ostream> Stream;
14
15
public
:
16
/// \brief Launch a streamed process with \p Action.
17
///
18
/// The value returned by \p Action will be interpreted as process's exit
19
/// value.
20
StreamProc
(
const
std::function<
int
()> &Action);
21
22
[[nodiscard]] llvm::raw_fd_ostream &
stream
()
const
{
23
assert(Stream);
24
return
*Stream;
25
}
26
27
[[nodiscard]]
util::PipedProc
&
proc
()
const
{
28
assert(Proc);
29
return
*Proc;
30
}
31
32
[[nodiscard]] std::unique_ptr<lspserver::InboundPort>
mkIn
()
const
;
33
34
[[nodiscard]] std::unique_ptr<lspserver::OutboundPort>
mkOut
()
const
;
35
};
36
37
}
// namespace nixd
Connection.h
PipedProc.h
nixd
Definition
CommandLine/Configuration.h:9
nixd::StreamProc::proc
util::PipedProc & proc() const
Definition
StreamProc.h:27
nixd::StreamProc::StreamProc
StreamProc(const std::function< int()> &Action)
Launch a streamed process with Action.
Definition
StreamProc.cpp:17
nixd::StreamProc::mkIn
std::unique_ptr< lspserver::InboundPort > mkIn() const
Definition
StreamProc.cpp:8
nixd::StreamProc::mkOut
std::unique_ptr< lspserver::OutboundPort > mkOut() const
Definition
StreamProc.cpp:13
nixd::StreamProc::stream
llvm::raw_fd_ostream & stream() const
Definition
StreamProc.h:22
nixd::util::PipedProc
Definition
PipedProc.h:9
Generated by
1.17.0