summaryrefslogtreecommitdiff
path: root/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/MessageProducer.h
blob: 4f3799555abe0df38274224ec57bb85f598f0672 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once
#include <string>
#include <functional>

namespace lsp {
    /// The encoding style of the JSON-RPC messages (both input and output).
    enum JSONStreamStyle {
        /// Encoding per the LSP specification, with mandatory Content-Length header.
        Standard,
        /// Messages are delimited by a '// -----' line. Comment lines start with //.
        Delimited
    };
}
class MessageProducer
{
public:
        typedef  std::function< void(std::string&&) >  MessageConsumer;
        virtual  ~MessageProducer() = default;
        virtual void listen(MessageConsumer) = 0;
};