RStudio Launcher Plugin SDK
1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
|
Class which allows reading from or writing to streams asynchronously. More...
#include <Asio.hpp>
Public Member Functions | |
AsioStream (int in_streamHandle) | |
Constructor. More... | |
~AsioStream () noexcept | |
Destructor. Closes the stream. | |
void | close () noexcept |
Closes the stream. Nothing may be read from or written to the stream after this is called. | |
void | readBytes (const OnReadBytes &in_onReadBytes, const OnError &in_onError) |
Attempts to read bytes from this ASIO stream. More... | |
void | writeBytes (const std::string &in_data, const OnError &in_onError, const AsioFunction &in_onFinishedWriting=AsioFunction()) |
Writes the provided data to the stream asynchronously. More... | |
Class which allows reading from or writing to streams asynchronously.
|
explicit |
Constructor.
in_streamHandle | The handle of the stream for which to create this ASIO stream descriptor. |
void rstudio::launcher_plugins::system::AsioStream::readBytes | ( | const OnReadBytes & | in_onReadBytes, |
const OnError & | in_onError | ||
) |
Attempts to read bytes from this ASIO stream.
in_onReadBytes | Callback function which will be invoked on successful read. |
in_onError | Callback function which will be invoked if an error occurs. |
void rstudio::launcher_plugins::system::AsioStream::writeBytes | ( | const std::string & | in_data, |
const OnError & | in_onError, | ||
const AsioFunction & | in_onFinishedWriting = AsioFunction() |
||
) |
Writes the provided data to the stream asynchronously.
This method is thread safe. Each provided block of data will be written to the stream in full before a new one begins.