12 #ifndef DOCWIRE_INPUT_H
13 #define DOCWIRE_INPUT_H
16 #include "chain_element.h"
17 #include "data_source.h"
18 #include "parsing_chain.h"
24 concept IStreamDerived = std::derived_from<T, std::istream>;
27 concept istream_derived_ref_qualified = IStreamDerived<std::remove_reference_t<T>>;
36 virtual continuation operator()(message_ptr msg,
const message_callbacks& emit_message)
override;
37 bool is_leaf()
const override {
return false; }
38 bool is_generator()
const override {
return true; }
41 ref_or_owned<data_source> m_data;
44 inline parsing_chain
operator|(ref_or_owned<data_source> data, ref_or_owned<chain_element> chain_element)
46 return input_chain_element{data} | chain_element;
49 inline parsing_chain
operator|(ref_or_owned<std::istream> stream, ref_or_owned<chain_element> chain_element)
51 return input_chain_element{data_source{seekable_stream_ptr{stream.to_shared_ptr()}}} | chain_element.to_shared_ptr();
54 template<data_source_compatible_type_ref_qualified T>
55 parsing_chain
operator|(T&& v, ref_or_owned<chain_element> chain_element)
57 return data_source{std::forward<T>(v)} | chain_element;
A utility class that simplifies declaring function attributes that need to be stored without requirin...
auto operator|(V &&value, F &&function)
Binds a value to a function, enabling the creation of a function call chain.
The main namespace for the DocWire SDK.