diff --git a/include/config.h b/include/config.h index 2d238ad..25f5886 100644 --- a/include/config.h +++ b/include/config.h @@ -45,7 +45,7 @@ namespace cfg { * The default implementation is using @p static_cast. * * @tparam From The original type. - * @tparam To A new type. + * @tparam To A new type. * * @note * If a custom type needs to be saved to a configuration file, @@ -282,9 +282,7 @@ class VarConverter, std::string> { } }; -/** - * Basic information about a configuration variable. - */ +//! Basic information about a configuration variable. class VarBase { public: using Ptr = std::shared_ptr; @@ -314,9 +312,9 @@ class VarBase { /** * @brief The configuration variable. * - * @tparam T The variable type. - * @tparam FromStr A converter that can convert a string into a type-matching value. - * @tparam ToStr A converter that can convert a type-matching value into a string. + * @tparam T The variable type. + * @tparam FromStr A converter that can convert a string into a type-matching value. + * @tparam ToStr A converter that can convert a type-matching value into a string. */ template , typename ToStr = VarConverter> @@ -329,8 +327,8 @@ class Var : public VarBase { /** * @brief The listener for value change events. * - * @param old_val The old value before changing. - * @param new_val The new value after changing. + * @param old_val The old value before changing. + * @param new_val The new value after changing. */ using OnChange = std::function; @@ -387,7 +385,7 @@ class Var : public VarBase { /** * @brief Remove a listener. * - * @param key A unique key corresponding to the listener. + * @param key A unique key corresponding to the listener. */ void RemoveListener(const std::uint64_t key) noexcept { const std::unique_lock locker {mtx_}; @@ -397,7 +395,7 @@ class Var : public VarBase { /** * @brief Add a listener for value change events. * - * @param listener A listener. + * @param listener A listener. * @return A unique key corresponding to the listener. */ std::uint64_t AddListener(OnChange listener) noexcept { @@ -420,9 +418,7 @@ class Var : public VarBase { std::unordered_map listeners_; }; -/** - * The configuration. - */ +//! The configuration. class Config { public: using Ptr = std::shared_ptr; @@ -458,8 +454,8 @@ class Config { /** * @brief Lookup a variable by its name. * - * @tparam T A variable type. - * @param name A variable name. + * @tparam T A variable type. + * @param name A variable name. * @return The found variable or @p nullptr. * * @exception std::invalid_argument The type of the found variable does not match @p T. diff --git a/include/containers/block_deque.h b/include/containers/block_deque.h index 6e0f947..505045b 100644 --- a/include/containers/block_deque.h +++ b/include/containers/block_deque.h @@ -24,9 +24,7 @@ namespace ws { -/** - * The block double-ended queue. - */ +//! The block double-ended queue. template class BlockDeque { public: diff --git a/include/containers/buffer.h b/include/containers/buffer.h index cf5adf4..6c89457 100644 --- a/include/containers/buffer.h +++ b/include/containers/buffer.h @@ -42,6 +42,7 @@ enum class NewLine { * @brief An auto-expandable buffer, supporting storing bytes and strings. * * @details + * @code * Writing Offset ──────┐ * Reading Offset ─────┐ │ * │ │ @@ -49,6 +50,8 @@ enum class NewLine { * ┌───────────────────▼────────────────▼────────────────┐ * │ Prependable Bytes │ Readable Bytes │ Writable Bytes │ * └───────────────────┴────────────────┴────────────────┘ + * @endcode + * * Prependable space can be reused. */ class Buffer { @@ -163,9 +166,7 @@ class Buffer { std::atomic write_pos_ {0}; }; -/** - * An enhanced buffer supporting I/O reading and writing. - */ +//! An enhanced buffer supporting I/O reading and writing. class IOBuffer : public Buffer { public: using Buffer::Buffer; diff --git a/include/containers/epoller.h b/include/containers/epoller.h index c3b8567..86e2130 100644 --- a/include/containers/epoller.h +++ b/include/containers/epoller.h @@ -24,7 +24,10 @@ namespace ws { /** + * @brief * The I/O event notification facility. + * + * @details * It monitors multiple file descriptors to see if I/O is possible on any of them. */ class Epoller { @@ -34,7 +37,7 @@ class Epoller { /** * @brief Create an epoller. * - * @param capacity The maximum number of file descriptors to be monitored. + * @param capacity The maximum number of file descriptors to be monitored. * * @exception std::system_error Creation failed. */ @@ -65,7 +68,7 @@ class Epoller { /** * @brief Wait for events. * - * @param time_out The maximum time to wait. + * @param time_out The maximum time to wait. * @return * The number of file descriptors ready for the requested I/O, * or zero if getting a time-out. @@ -94,8 +97,8 @@ class Epoller { /** * @brief Perform control operations on a file descriptor. * - * @param ctl Addition, deletion or modification. - * @param fd A file descriptor. + * @param ctl Addition, deletion or modification. + * @param fd A file descriptor. * @param events * The event associated with the file descriptor. * It can be @p std::nullopt if the operation is deletion. diff --git a/include/containers/heap_timer.h b/include/containers/heap_timer.h index 7b7152a..aea80ad 100644 --- a/include/containers/heap_timer.h +++ b/include/containers/heap_timer.h @@ -32,10 +32,12 @@ namespace ws { /** * @brief * The timer system based on a min-heap. + * + * @details * Timers are maintained in a min-heap ordered by expiration time. * When a timer expires, its callback will be invoked. * - * @tparam Key The type of node keys. + * @tparam Key The type of node keys. */ template class HeapTimer { @@ -63,8 +65,8 @@ class HeapTimer { /** * @brief Adjust a node's expiration time. * - * @param key A key. - * @param expiration A new duration from now to its expiration time. + * @param key A key. + * @param expiration A new duration from now to its expiration time. * * @exception std::out_of_range The timer system does not contain any node with the specific key. */ @@ -73,8 +75,8 @@ class HeapTimer { /** * @brief Adjust a node's expiration time. * - * @param key A key. - * @param expiration A new expiration time. + * @param key A key. + * @param expiration A new expiration time. * * @exception std::out_of_range The timer system does not contain any node with the specific key. */ @@ -83,9 +85,9 @@ class HeapTimer { /** * @brief Push a node into the timer system. * - * @param key A key. - * @param expiration A duration from now to its expiration time. - * @param callback A time-out callback that will be invoked when the node expires. + * @param key A key. + * @param expiration A duration from now to its expiration time. + * @param callback A time-out callback that will be invoked when the node expires. */ void Push(const Key& key, Clock::duration expiration, TimeOutCallback callback) noexcept; @@ -93,9 +95,9 @@ class HeapTimer { /** * @brief Push a node into the timer system. * - * @param key A key. - * @param expiration An expiration time. - * @param callback A time-out callback that will be invoked when the node expires. + * @param key A key. + * @param expiration An expiration time. + * @param callback A time-out callback that will be invoked when the node expires. */ void Push(const Key& key, Clock::time_point expiration, TimeOutCallback callback) noexcept; @@ -212,6 +214,7 @@ class HeapTimer { std::optional Parent(std::size_t idx) const noexcept; /** + * @brief * Get the index of a node's child that has a shorter expiration time, * or @p std::nullopt if it does not exist. */ diff --git a/include/containers/thread_pool.h b/include/containers/thread_pool.h index a1bdd7b..335ae03 100644 --- a/include/containers/thread_pool.h +++ b/include/containers/thread_pool.h @@ -26,9 +26,7 @@ namespace ws { -/** - * The thread pool. - */ +//! The thread pool. class ThreadPool { public: using Task = std::function; @@ -62,15 +60,16 @@ class ThreadPool { void Push(Task task) noexcept; /** - * Close the thread pool. + * @brief Close the thread pool. + * + * @details * The remaining tasks will not be executed. */ void Close() noexcept; private: /** - * @brief - * Continually pop and execute tasks. + * @brief Continually pop and execute tasks. * * @warning * Any exceptions raised in callbacks will not be rethrown. diff --git a/include/http.h b/include/http.h index 05265b1..1a7005f 100644 --- a/include/http.h +++ b/include/http.h @@ -69,6 +69,7 @@ std::ostream& operator<<(std::ostream& os, Method method) noexcept; inline constexpr std::string_view new_line {"\r\n"}; /** + * @brief * Get a file's content type. * @p application/octet-stream is used to indicate that a file contains arbitrary binary data. */ @@ -93,6 +94,7 @@ char DecodeURLEncodedCharacter(const std::string& str); std::string DecodeURLEncodedString(const std::string& str); /** + * @brief * Get the HTML placeholder for an HTTP parameter. * It can be used to insert actual data into an HTML page. */ @@ -188,9 +190,7 @@ class ConnectionImpl { MappedReadOnlyFile file_; }; -/** - * The HTTP connection. - */ +//! The HTTP connection. template class Connection : public ConnectionImpl { public: diff --git a/include/io.h b/include/io.h index bf5eef6..420e69c 100644 --- a/include/io.h +++ b/include/io.h @@ -25,10 +25,7 @@ class Buffer; namespace io { -/** - * @interface IReader - * @brief An I/O reading interface interacting with buffers. - */ +//! An I/O reading interface interacting with buffers. class IReader { public: virtual ~IReader() noexcept = default; @@ -37,10 +34,7 @@ class IReader { virtual std::size_t ReadFrom(Buffer& buf) = 0; }; -/** - * @interface IWriter - * @brief An I/O writing interface interacting with buffers. - */ +//! An I/O writing interface interacting with buffers. class IWriter { public: virtual ~IWriter() noexcept = default; @@ -49,14 +43,13 @@ class IWriter { virtual std::size_t WriteTo(Buffer& buf) = 0; }; -/** - * @interface IReadWriter - * @brief An I/O interface interacting with buffers. - */ +//! An I/O interface interacting with buffers. class IReadWriter : public virtual IReader, public virtual IWriter {}; /** - * Null I/O. + * @brief Null I/O. + * + * @details * It simply consumes a buffer's all readable or writable space, * without reading or writing anything. */ @@ -67,9 +60,7 @@ class Null : public virtual IReadWriter { std::size_t ReadFrom(Buffer& buf) noexcept override; }; -/** - * I/O for string streams. - */ +//! I/O for string streams. class StringStream : public virtual IReadWriter { public: /** @@ -105,9 +96,7 @@ class StringStream : public virtual IReadWriter { std::ostream& write_; }; -/** - * I/O for file descriptors. - */ +//! I/O for file descriptors. class FileDescriptor : public virtual IReadWriter { public: /** @@ -135,14 +124,8 @@ class FileDescriptor : public virtual IReadWriter { FileDescriptor& operator=(FileDescriptor&&) = delete; - /** - * @exception std::system_error Failed to read data from the descriptor. - */ std::size_t WriteTo(Buffer& buf) override; - /** - * @exception std::system_error Failed to write data to the descriptor. - */ std::size_t ReadFrom(Buffer& buf) override; private: diff --git a/include/ip.h b/include/ip.h index 3784e45..9044f21 100644 --- a/include/ip.h +++ b/include/ip.h @@ -20,10 +20,7 @@ namespace ws { -/** - * @interface IPAddr - * @brief The interface of IP address. - */ +//! The interface of IP address. class IPAddr { public: virtual ~IPAddr() noexcept = default; @@ -42,9 +39,7 @@ class IPAddr { virtual std::string IPAddress() const noexcept = 0; }; -/** - * The IPv4 address. - */ +//! The IPv4 address. class IPv4Addr : public IPAddr { public: static constexpr int version {AF_INET}; @@ -76,9 +71,7 @@ class IPv4Addr : public IPAddr { sockaddr_in raw_ {}; }; -/** - * The IPv6 address. - */ +//! The IPv6 address. class IPv6Addr : public IPAddr { public: static constexpr int version {AF_INET6}; @@ -110,12 +103,6 @@ class IPv6Addr : public IPAddr { sockaddr_in6 raw_ {}; }; -/** - * @concept ValidIPAddr - * @brief A valid IP address. - * - * @tparam T @p IPv4Addr or @p IPv6Addr. - */ template concept ValidIPAddr = std::same_as || std::same_as; diff --git a/include/log.h b/include/log.h index c07254e..3f40f1d 100644 --- a/include/log.h +++ b/include/log.h @@ -1,6 +1,7 @@ /** * @file log.h * @brief The logging system. + * * @details * The supported tags and corresponding fields. * - @p m: Dispaly the event message. @@ -79,9 +80,7 @@ std::ostream& operator<<(std::ostream& os, AppenderType type) noexcept; */ AppenderType StringToAppenderType(std::string str); -/** - * The log event. - */ +//! The log event. class Event { public: using Ptr = std::shared_ptr; @@ -91,10 +90,10 @@ class Event { /** * @brief Create an event. * - * @param level The event level. - * @param location The event location. + * @param level The event level. + * @param location The event location. * @param thread_id The ID of the thread where the event occurred. - * @param time The event time. + * @param time The event time. * * @todo Replace @p std::experimental::source_location with @p std::source_location. */ @@ -145,9 +144,7 @@ class Event { Event::Ptr operator<<(Event::Ptr event, std::string_view msg) noexcept; -/** - * The event formatter. - */ +//! The event formatter. class Formatter { public: using Ptr = std::shared_ptr; @@ -155,7 +152,6 @@ class Formatter { static Formatter::Ptr Default() noexcept; /** - * @interface Field * @brief * The field formatter for different information. * A formatter usually needs multiple field formatters, such as for thread ID and time. @@ -169,7 +165,7 @@ class Formatter { /** * @brief Create a field formatter. * - * @param format An optional format required for some fields. + * @param format An optional format required for some fields. */ explicit Field(std::string_view format = "") noexcept; @@ -180,6 +176,7 @@ class Formatter { const Event& event) noexcept = 0; /** + * @brief * Get the tag representing a field. * The tag does not contain the preceding symbol @p %. */ @@ -189,7 +186,7 @@ class Formatter { /** * @brief Create a formatter. * - * @param pattern A format pattern, consisting of multiple fields and their format. + * @param pattern A format pattern, consisting of multiple fields and their format. * * @exception std::invalid_argument The pattern is invalid. */ @@ -205,9 +202,7 @@ class Formatter { std::list fields_; }; -/** - * The appender that writes events to a specific place. - */ +//! The appender that writes events to a specific place. class Appender { public: using Ptr = std::shared_ptr; @@ -253,9 +248,7 @@ class Appender { Formatter::Ptr formatter_; }; -/** - * The appender that writes events to the standard output stream. - */ +//! The appender that writes events to the standard output stream. class StdOutAppender : public Appender { public: using Ptr = std::shared_ptr; @@ -267,9 +260,7 @@ class StdOutAppender : public Appender { std::string ToYamlString() const noexcept override; }; -/** - * The appender that writes events to a file. - */ +//! The appender that writes events to a file. class FileAppender : public Appender { public: using Ptr = std::shared_ptr; @@ -295,6 +286,7 @@ class FileAppender : public Appender { }; /** + * @brief * The logger, containing a list of appenders. * It can work synchronously or asynchronously. */ @@ -305,7 +297,7 @@ class Logger { /** * @brief Create a logger. * - * @param name A name. + * @param name A name. * @param level * The lowest event level. * Any event with a level lower than it will not be processed. @@ -343,7 +335,10 @@ class Logger { Formatter::Ptr GetDefaultFormatter() const noexcept; /** + * @brief * Set a default formatter. + * + * @details * If a newly added appender does not provide a formatter, * the default formatter will be used. */ @@ -392,6 +387,7 @@ Logger::Ptr operator<<(Logger::Ptr logger, Event::Ptr event) noexcept; * * @details * It can be used as follows: + * * @code {.cpp} * EventWriter {logger, event}.MessageStream() << "A message"; * @endcode @@ -417,9 +413,7 @@ class EventWriter { Event::Ptr event_; }; -/** - * The logger manager, maintaining a collection of loggers. - */ +//! The logger manager, maintaining a collection of loggers. class Manager { public: /** diff --git a/include/test_util.h b/include/test_util.h index 5bd3583..5d9fd41 100644 --- a/include/test_util.h +++ b/include/test_util.h @@ -25,6 +25,7 @@ namespace ws::test { * * @details * The format is @p SuiteName.CaseName. + * * @code {.cpp} * TEST(SuiteName, CaseName) { * // ... diff --git a/include/util.h b/include/util.h index 3ecf55c..87d619c 100644 --- a/include/util.h +++ b/include/util.h @@ -59,8 +59,8 @@ std::vector SplitStringToLines(const std::string& str) noexcept; /** * @brief Load a @p YAML node from a string. * - * @param str A @p YAML string. - * @param required_fields Required fields. + * @param str A @p YAML string. + * @param required_fields Required fields. * * @exception std::invalid_argument The node does not contain all required fields. */ @@ -97,9 +97,9 @@ std::uint32_t CurrentThreadId() noexcept; /** * @brief Get a backtrace for the calling program. * - * @param[out] stack An address array. - * @param size The maximum number of addresses. - * @param skip The number of addresses to ignore. + * @param[out] stack An address array. + * @param size The maximum number of addresses. + * @param skip The number of addresses to ignore. */ void Backtrace(std::vector& stack, std::size_t size, std::size_t skip = 0) noexcept; @@ -107,8 +107,8 @@ void Backtrace(std::vector& stack, std::size_t size, /** * @brief Get a backtrace for the calling program. * - * @param size The maximum number of addresses. - * @param skip The number of addresses to ignore. + * @param size The maximum number of addresses. + * @param skip The number of addresses to ignore. * @return A string containing the backtrace. */ std::string Backtrace(std::size_t size, std::size_t skip = 0, @@ -117,7 +117,7 @@ std::string Backtrace(std::size_t size, std::size_t skip = 0, /** * @brief The singleton pattern interface for references. * - * @tparam T A type using the singleton pattern. + * @tparam T A type using the singleton pattern. * @tparam Args The arguments of the singleton instance, referring to one of its constructors. */ template @@ -138,7 +138,7 @@ class Singleton { /** * @brief The singleton pattern interface for smart points. * - * @tparam T A type using the singleton pattern. + * @tparam T A type using the singleton pattern. * @tparam Args The argument types of the singleton instance, referring to one of its constructors. */ template @@ -164,8 +164,8 @@ class RAII { /** * @brief Create a RAII for an object. * - * @param obj An object needing to be cleaned. - * @param cleaner A cleaner. + * @param obj An object needing to be cleaned. + * @param cleaner A cleaner. */ explicit RAII(T obj, Cleaner cleaner) noexcept : obj_ {std::move(obj)}, cleaner_ {std::move(cleaner)} {} @@ -192,7 +192,10 @@ class RAII { }; /** + * @brief * RAII for a read-only file that has been mapped into memory. + * + * @details * It encapsulates @p stat, @p mmap and @p munmap of Linux system. */ class MappedReadOnlyFile { @@ -213,8 +216,8 @@ class MappedReadOnlyFile { * @brief Map a file into memory. * * @exception std::invalid_argument The path refers to a directory. - * @exception std::runtime_error No permission to access the file. - * @exception std::system_error Failed to map the file. + * @exception std::runtime_error No permission to access the file. + * @exception std::system_error Failed to map the file. */ std::byte* Map(std::string path); @@ -235,8 +238,8 @@ class MappedReadOnlyFile { * @brief Check the file. * * @exception std::invalid_argument The path refers to a directory. - * @exception std::runtime_error No permission to access the file. - * @exception std::system_error Other system errors. + * @exception std::runtime_error No permission to access the file. + * @exception std::system_error Other system errors. */ void Check(); diff --git a/include/web_server.h b/include/web_server.h index a6b0df1..cfdff88 100644 --- a/include/web_server.h +++ b/include/web_server.h @@ -53,7 +53,7 @@ class WebServer { /** * @brief Create a web server. * - * @param port A listening port. + * @param port A listening port. * @param alive_time * A maximum alive time for client timers. * A client's timer will be refreshed if it sends or receives data. @@ -385,9 +385,7 @@ class WebServer { log::Logger::Ptr logger_; }; -/** - * The builder for web servers. - */ +//! The builder for web servers. template class WebServerBuilder { public: diff --git a/src/config/config.cpp b/src/config/config.cpp index 59814d6..2251855 100644 --- a/src/config/config.cpp +++ b/src/config/config.cpp @@ -13,19 +13,21 @@ namespace { * @details * The return value recursively contains members on every level, not just leaves. * For example, for the following @p YAML file: + * * @code {.yaml} * system: * port: 80 * ip: "127.0.0.1" * @endcode + * * This method will return a list of fours items: * - A node with an empty name representing the entire node. * - A node with named @p system representing the port and ip address. * - A node with named @p system.port representing the port. * - A node with named @p system.ip representing the ip address. * - * @param node A @p YAML node. - * @param prefix A prefix representing the node level. + * @param node A @p YAML node. + * @param prefix A prefix representing the node level. * @return A list of members and names representing their levels. */ std::list> ExtractMembers( diff --git a/src/http/request.cpp b/src/http/request.cpp index 5df6843..b0683d8 100644 --- a/src/http/request.cpp +++ b/src/http/request.cpp @@ -8,10 +8,7 @@ namespace ws::http { -/** - * @interface State - * @brief The interface of parsing state. - */ +//! The interface of parsing state. class Request::State { public: explicit State(Request& parser) noexcept : parser_ {parser} {} diff --git a/src/http/request.h b/src/http/request.h index 658bf78..68fb3e7 100644 --- a/src/http/request.h +++ b/src/http/request.h @@ -21,9 +21,7 @@ namespace ws::http { -/** - * The HTTP request parser. - */ +//! The HTTP request parser. class Request { public: class State; diff --git a/src/http/response.h b/src/http/response.h index 28d0b4d..710673e 100644 --- a/src/http/response.h +++ b/src/http/response.h @@ -22,9 +22,7 @@ namespace ws::http { -/** - * The HTTP response builder. - */ +//! The HTTP response builder. class Response { public: /** @@ -53,8 +51,8 @@ class Response { /** * @brief Build an HTTP response from a file request. * - * @param[out] buf An output buffer where the response content will be written to. - * @param file A file path. If it is a relative path, it will be relative to the root directory. + * @param[out] buf An output buffer where the response content will be written to. + * @param file A file path. If it is a relative path, it will be relative to the root directory. * @param[out] code The HTTP status code representing the file request. * @return * A read-only mapped file. @p std::nullopt if the file request failed. @@ -68,7 +66,7 @@ class Response { /** * @brief Build an HTTP response from a file request. * - * @param[out] buf An output buffer where the response content will be written to. + * @param[out] buf An output buffer where the response content will be written to. * @param html * The path of an HTML page. * If it is a relative path, it will be relative to the root directory. @@ -87,9 +85,9 @@ class Response { /** * @brief Build a response from HTTP status. * - * @param[out] buf An output buffer where the response content will be written to. - * @param code An HTTP status code. - * @param msg An optional message. + * @param[out] buf An output buffer where the response content will be written to. + * @param code An HTTP status code. + * @param msg An optional message. */ void Build(Buffer& buf, StatusCode code, std::string msg = "") noexcept; diff --git a/src/log/config_init.h b/src/log/config_init.h index 9bd8256..f3b1a2a 100644 --- a/src/log/config_init.h +++ b/src/log/config_init.h @@ -5,6 +5,7 @@ * @details * @p YAML configuration. * An example is shown below: + * * @code {.yaml} * loggers: * - name: root @@ -37,9 +38,7 @@ namespace ws::log { -/** - * The appender configuration. - */ +//! The appender configuration. struct AppenderConfig { AppenderType type; @@ -54,9 +53,7 @@ bool operator==(const AppenderConfig&, const AppenderConfig&) noexcept; bool operator!=(const AppenderConfig&, const AppenderConfig&) noexcept; -/** - * The logger configuration. - */ +//! The logger configuration. struct LoggerConfig { std::string name; @@ -77,9 +74,7 @@ bool operator!=(const LoggerConfig&, const LoggerConfig&) noexcept; } // namespace ws::log -/** - * The hash for unordered sets. - */ +//! The hash for unordered sets. template <> struct std::hash { std::size_t operator()(const ws::log::LoggerConfig& logger) const noexcept { @@ -192,8 +187,8 @@ namespace log { /** * @brief Set the listener callback for a logger configuration. * - * @param loggers A logger configuration. - * @param manager A logger manager. It will adjust its loggers when the configuration changes. + * @param loggers A logger configuration. + * @param manager A logger manager. It will adjust its loggers when the configuration changes. */ cfg::Var>::Ptr SetListener( cfg::Var>::Ptr loggers, diff --git a/src/log/field.h b/src/log/field.h index a4062d0..65286a1 100644 --- a/src/log/field.h +++ b/src/log/field.h @@ -149,7 +149,9 @@ class LoggerName : public Formatter::Field { }; /** - * The raw field. + * @brief The raw field. + * + * @details * It is an internal structure for conversion between field tags and sub-formatters. */ struct RawField { @@ -157,13 +159,18 @@ struct RawField { bool raw_str; /** + * @brief A raw string. + * + * @details * If the raw field is a raw string, this field will save its content. * Otherwise this field is a tag. For example, @p t means a thread ID. */ std::string content; /** - * An optional format. + * @brief An optional format. + * + * @details * For example, @p %Y-%m-%d can be used for date display. * If the raw field is a raw string, this field will be empty. */ diff --git a/src/log/log.cpp b/src/log/log.cpp index f77c3f8..b68b866 100644 --- a/src/log/log.cpp +++ b/src/log/log.cpp @@ -205,9 +205,6 @@ void Logger::AddAppender(const Appender::Ptr appender) noexcept { appenders_.push_back(appender); } -/** - * @todo Replace @p std::remove_if with @p std::ranges::remove_if. - */ void Logger::RemoveAppender(const Appender::Ptr appender) noexcept { const std::lock_guard locker {mtx_}; std::remove_if( diff --git a/src/main.cpp b/src/main.cpp index ffa54bf..30c0a69 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,8 +33,8 @@ cfg::Config::Ptr InitDefaultConfig() noexcept { /** * @brief Load a local configuration. * - * @param config An existing configuration. - * @param file A configuration file. + * @param config An existing configuration. + * @param file A configuration file. */ cfg::Config::Ptr LoadConfig(const cfg::Config::Ptr config, const std::string& file) { diff --git a/tests/log_test.cpp b/tests/log_test.cpp index cda8ce3..c9f7e2c 100644 --- a/tests/log_test.cpp +++ b/tests/log_test.cpp @@ -7,9 +7,7 @@ using namespace ws::log; -/** - * The fake appender that writes events to a string stream. - */ +//! The fake appender that writes events to a string stream. class FakeAppender : public Appender { public: using Ptr = std::shared_ptr;