libfilezilla
Loading...
Searching...
No Matches
xml_writer.hpp
Go to the documentation of this file.
1#ifndef LIBFILEZILLA_AIO_XML_WRITER_HEADER
2#define LIBFILEZILLA_AIO_XML_WRITER_HEADER
3
8#include "writer.hpp"
9#include "../xml.hpp"
10
11#include <optional>
12
13namespace fz {
15class FZ_PUBLIC_SYMBOL xml_parser_writer final : public writer_base
16{
17public:
18 xml_parser_writer(xml::parser::callback_t && cb, std::wstring const& name, aio_buffer_pool & pool, progress_cb_t && progress_cb = nullptr);
19
20 void enable_pretty_log(logmsg::type t);
21
22private:
23 virtual aio_result FZ_PRIVATE_SYMBOL do_add_buffer(scoped_lock &, buffer_lease && b) override;
24 virtual aio_result FZ_PRIVATE_SYMBOL do_finalize(scoped_lock &) override;
25
26 xml::parser parser_;
28 std::optional<xml::pretty_logger> logger_;
29};
30
32class FZ_PUBLIC_SYMBOL xml_namespace_parser_writer final : public writer_base
33{
34public:
35 xml_namespace_parser_writer(xml::parser::callback_t && cb, std::wstring const& name, aio_buffer_pool & pool, progress_cb_t && progress_cb = nullptr);
36
37 void enable_pretty_log(logmsg::type t);
38
39private:
40 virtual aio_result FZ_PRIVATE_SYMBOL do_add_buffer(scoped_lock &, buffer_lease && b) override;
41 virtual aio_result FZ_PRIVATE_SYMBOL do_finalize(scoped_lock &) override;
42
44 std::optional<xml::pretty_logger> logger_;
45};
46}
47
48#endif
A buffer pool for use with async readers/writers.
Definition: aio.hpp:132
Definition: aio.hpp:25
A simple scoped lock.
Definition: mutex.hpp:93
Base class for all writers.
Definition: writer.hpp:28
std::function< void(writer_base const *, uint64_t written)> progress_cb_t
Definition: writer.hpp:77
A stremable XML parser that resolves namespace declarations and namespace prefixes.
Definition: xml.hpp:184
A streaming XML parser.
Definition: xml.hpp:54
std::function< bool(callback_event type, std::string_view path, std::string_view name, std::string &&value)> callback_t
Definition: xml.hpp:62
Similar to.
Definition: xml_writer.hpp:33
Forwards received data directly into an XML parser.
Definition: xml_writer.hpp:16
type
Definition: logger.hpp:16
The namespace used by libfilezilla.
Definition: apply.hpp:17
aio_result
Result of aio operations.
Definition: aio.hpp:213
Classes for writing data asynchronously into files.