|
jaulib v1.4.0-2-g788cf73
Jau Support Library (C++, Java, ..)
|
Namespaces | |
| namespace | fs |
| Author: Sven Gothel sgoth.nosp@m.el@j.nosp@m.ausof.nosp@m.t.co.nosp@m.m Copyright (c) 2022 Gothel Software e.K. | |
| namespace | http |
| namespace | impl |
| namespace | net |
| namespace | uri_tk |
| Limited URI toolkit to query handled protocols by the IO implementation. | |
Classes | |
| struct | AsyncStreamResponse |
| Asynchronous stream response. More... | |
| class | Bitstream |
| Versatile Bitstream implementation supporting: More... | |
| class | ByteInStream_Feed |
| Ringbuffer-Based byte input stream with an externally provisioned data feed. More... | |
| class | ByteInStream_URL |
| Ringbuffer-Based byte input stream with a URL connection provisioned data feed. More... | |
| class | ByteStream |
| Byte stream interface. More... | |
| class | ByteStream_File |
| File based byte input stream, including named file descriptor. More... | |
| class | ByteStream_Recorder |
| Wrapped byte input stream with the capability to record the read byte stream at will. More... | |
| class | ByteStream_SecMemory |
| Secure Memory-Based byte input stream. More... | |
| class | IOStateCap |
| Supporting std::basic_ios's iostate capabilities for all ByteStream implementations. More... | |
| struct | SyncStreamResponse |
| Synchronous stream response. More... | |
| class | url_header_resp |
| Synchronized URL header response completion as used by asynchronous read_url_stream(). More... | |
Typedefs | |
| typedef jau::function< bool(AsyncStreamResponse &, const uint8_t *, size_t, bool)> | AsyncStreamConsumerFunc |
| Asynchronous stream consumer function. | |
| using | AsyncStreamResponseRef = std::shared_ptr<AsyncStreamResponse> |
| typedef jau::ringbuffer< uint8_t, size_t > | ByteRingbuffer |
| using | net_tk_handle = void* |
| typedef jau::ordered_atomic< io_result_t, std::memory_order_relaxed > | relaxed_atomic_io_result_t |
| typedef std::basic_string< char, std::char_traits< char >, jau::callocator_sec< char > > | secure_string |
| template<typename T> | |
| using | secure_vector = std::vector<T, jau::callocator_sec<T>> |
| typedef jau::function< bool(secure_vector< uint8_t > &, bool)> | StreamConsumerFunc |
| Stream consumer function. | |
| typedef jau::function< bool(SyncStreamResponse &, const uint8_t *, size_t, bool)> | SyncStreamConsumerFunc |
| Synchronous stream consumer function. | |
| using | SyncStreamResponseRef = std::shared_ptr<SyncStreamResponse> |
Enumerations | |
| enum class | io_dir_t : int8_t { io_dir_t::READ = 0 , io_dir_t::WRITE = 1 } |
| I/O direction, read or write. More... | |
| enum class | io_result_t : int8_t { io_result_t::FAILED = -1 , io_result_t::NONE = 0 , io_result_t::SUCCESS = 1 } |
| I/O operation result value. More... | |
| enum class | ioaccess_t : bool { ioaccess_t::read = false , ioaccess_t::write = true } |
| I/O read or write access. More... | |
| enum class | iomode_t : uint32_t { iomode_t::none = 0 , iomode_t::read = 1U << 0 , iomode_t::write = 1U << 1 , iomode_t::rw = read | write , iomode_t::atend = 1U << 2 , iomode_t::trunc = 1U << 3 , iomode_t::writetrunc = write | trunc } |
| Stream I/O mode, e.g. More... | |
| enum class | iostate_t : uint32_t { iostate_t::none = 0 , iostate_t::goodbit = 0 , iostate_t::badbit = 1U << 0 , iostate_t::eofbit = 1U << 1 , iostate_t::failbit = 1U << 2 , iostate_t::timeout = 1U << 3 } |
Functions | |
| net_tk_handle | create_net_tk_handle () noexcept |
| creates a reusable handle, free with free_net_tk_handle() after use. | |
| void | free_net_tk_handle (net_tk_handle handle) noexcept |
| frees a handle after use created by create_net_tk_handle() | |
| JAU_MAKE_BITFIELD_ENUM_STRING (iomode_t, read, write, atend, trunc) | |
| JAU_MAKE_BITFIELD_ENUM_STRING (iostate_t, goodbit, badbit, eofbit, failbit, timeout) | |
| std::ostream & | operator<< (std::ostream &os, const Bitstream &v) |
| std::ostream & | operator<< (std::ostream &os, const ByteStream &v) |
| std::ostream & | operator<< (std::ostream &os, io_result_t v) |
| void | print_stats (const std::string &prefix, const uint64_t &out_bytes_total, const jau::fraction_i64 &td) noexcept |
| uint64_t | read_file (const std::string &input_file, secure_vector< uint8_t > &buffer, const StreamConsumerFunc &consumer_fn) noexcept |
| Synchronous byte input stream reader from given file path using the given StreamConsumerFunc consumer_fn. | |
| uint64_t | read_stream (ByteStream &in, secure_vector< uint8_t > &buffer, const StreamConsumerFunc &consumer_fn) noexcept |
| Synchronous byte input stream reader using the given StreamConsumerFunc consumer_fn. | |
| uint64_t | read_stream (ByteStream &in, secure_vector< uint8_t > &buffer1, secure_vector< uint8_t > &buffer2, const StreamConsumerFunc &consumer_fn) noexcept |
| Synchronous double-buffered byte input stream reader using the given StreamConsumerFunc consumer_fn. | |
| uint64_t | read_url_stream (const std::string &url, secure_vector< uint8_t > &buffer, const StreamConsumerFunc &consumer_fn) noexcept |
| Synchronous URL stream reader using the given StreamConsumerFunc consumer_fn. | |
| AsyncStreamResponseRef | read_url_stream_async (net_tk_handle handle, const std::string &url, http::PostRequestPtr httpPostReq, ByteRingbuffer *buffer, const AsyncStreamConsumerFunc &consumer_fn) noexcept |
| Asynchronous URL stream reader using the given AsyncStreamConsumerFunc consumer_fn. | |
| SyncStreamResponseRef | read_url_stream_sync (net_tk_handle handle, const std::string &url, http::PostRequestPtr httpPostReq, ByteRingbuffer *buffer, const SyncStreamConsumerFunc &consumer_fn) noexcept |
| Synchronous URL stream reader using the given SyncStreamConsumerFunc consumer_fn. | |
| std::unique_ptr< ByteStream > | to_ByteInStream (const std::string &path_or_uri, jau::fraction_i64 timeout=20_s) noexcept |
| Parses the given path_or_uri, if it matches a supported protocol, see jau::io::uri::protocol_supported(), but is not a local file, see jau::io::uri::is_local_file_protocol(), ByteInStream_URL is being attempted. | |
| std::string | to_string (const ioaccess_t v) noexcept |
| Return std::string representation of the given ioaccess_t. | |
| std::string | toString (io_result_t v) noexcept |
Variables | |
| const size_t | BEST_URLSTREAM_RINGBUFFER_SIZE = 2_uz * 16384_uz |