|
LibSWOC++ 1.5.14
Solid Wall of C++
|
#include <Errata.h>

Classes | |
| class | Annotation |
| struct | AutoText |
| Used to indicate automatically generated annotation text. | |
| struct | Data |
| Implementation class. More... | |
| struct | Severity |
| class | Sink |
| struct | SinkWrapper |
| Convenience wrapper class to enable using functions directly for sinks. More... | |
Public Types | |
| using | code_type = std::error_code |
| Type for message code. | |
| using | severity_type = uint8_t |
Underlying type for Severity. | |
| using | iterator = Container::iterator |
| using | const_iterator = Container::const_iterator |
| using | SinkHandler = std::function<void(Errata const &)> |
| Register a function as a sink. | |
Public Member Functions | |
| Errata ()=default | |
| Default constructor - empty errata, very fast. | |
| Errata (self_type const &that)=delete | |
| No copy construction. | |
| Errata (self_type &&that) noexcept | |
| Move constructor. | |
| self_type & | operator= (self_type const &that)=delete |
| self_type & | operator= (self_type &&that) |
| Move assignment. | |
| ~Errata () | |
| Destructor. | |
| Errata (code_type const &ec) | |
| Errata (code_type const &ec, AutoText) | |
| Errata (Severity severity) | |
| Errata (Severity severity, AutoText) | |
| Errata (code_type const &ec, Severity severity) | |
| Errata (code_type const &ec, Severity severity, AutoText auto_text) | |
| Errata (code_type const &code, Severity severity, std::string_view const &text) | |
| Errata (Severity severity, std::string_view const &text) | |
| Errata (code_type const &code, std::string_view const &text) | |
| Errata (std::string_view const &text) | |
| template<typename... Args> | |
| Errata (code_type const &code, Severity severity, std::string_view fmt, Args &&...args) | |
| template<typename... Args> | |
| Errata (code_type const &type, std::string_view fmt, Args &&...args) | |
| template<typename... Args> | |
| Errata (Severity severity, std::string_view fmt, Args &&...args) | |
| template<typename... Args> | |
| Errata (std::string_view fmt, Args &&...args) | |
| self_type & | note (std::string_view text) |
| self_type & | note (Severity severity, std::string_view text) |
| self_type & | note (Severity severity) |
| self_type & | note (code_type const &ec) |
| self_type & | note (code_type const &code, Severity severity) |
| self_type & | note_s (std::optional< Severity > severity, std::string_view text) |
| template<typename... Args> | |
| self_type & | note (std::string_view fmt, Args &&...args) |
| template<typename... Args> | |
| self_type & | note_v (std::string_view fmt, std::tuple< Args... > const &args) |
| template<typename... Args> | |
| self_type & | note (Severity severity, std::string_view fmt, Args &&...args) |
| template<typename... Args> | |
| self_type & | note_v (Severity severity, std::string_view fmt, std::tuple< Args... > const &args) |
| template<typename... Args> | |
| self_type & | note_sv (std::optional< Severity > severity, std::string_view fmt, std::tuple< Args... > const &args) |
| self_type & | note (self_type const &that) |
| self_type & | note (self_type &&that) |
| self_type & | clear () |
| self_type & | sink () |
| operator bool () const | |
| bool | operator! () const |
| bool | is_ok () const |
| bool | has_severity () const |
| Severity | severity () const |
| self_type & | assign (Severity severity) |
| self_type & | update (Severity severity) |
| code_type const & | code () const |
| The code for the top message. | |
| self_type & | assign (code_type code) |
| Set the code for this. | |
| size_t | length () const |
| Number of messages in the errata. | |
| bool | empty () const |
| iterator | begin () |
| Reference to top item on the stack. | |
| const_iterator | begin () const |
| Reference to top item on the stack. | |
| iterator | end () |
| Reference one past bottom item on the stack. | |
| const_iterator | end () const |
| Reference one past bottom item on the stack. | |
| const Annotation & | front () const |
| const Annotation & | back () const |
| TextView | annotation_glue_text () const |
| self_type & | assign_annotation_glue_text (TextView text, bool final_glue_p=false) |
| TextView | annotation_severity_glue_text () const |
| self_type & | assign_annotation_severity_glue_text (TextView text) |
| TextView | severity_glue_text () const |
| self_type & | assign_severity_glue_text (TextView text) |
| TextView | indent_text () const |
| self_type & | assign_indent_text (TextView text) |
| std::ostream & | write (std::ostream &out) const |
| template<typename... Args> | |
| Errata & | note_sv (std::optional< Severity > severity, std::string_view fmt, std::tuple< Args... > const &args) |
| template<typename... Args> | |
| Errata & | note_v (std::string_view fmt, std::tuple< Args... > const &args) |
| template<typename... Args> | |
| Errata & | note_v (Severity severity, std::string_view fmt, std::tuple< Args... > const &args) |
| template<typename... Args> | |
| Errata & | note (std::string_view fmt, Args &&...args) |
| template<typename... Args> | |
| Errata & | note (Severity severity, std::string_view fmt, Args &&...args) |
Static Public Member Functions | |
| static void | register_sink (Sink::Handle const &s) |
| Register a sink for discarded erratum. | |
| static void | register_sink (SinkHandler const &f) |
| Register a sink function for abandonded erratum. | |
| static void | register_sink (SinkHandler &&f) |
| Register a sink function for abandonded erratum. | |
Static Public Attributes | |
| static const code_type | DEFAULT_CODE |
| Code used if not specified. | |
| static Severity | DEFAULT_SEVERITY |
| Severity reported if severity not set. | |
| static Severity | FAILURE_SEVERITY |
| Severity level at which the instance is a failure of some sort. | |
| static Severity | FILTER_SEVERITY |
| static TextView | AUTOTEXT_SEVERITY = "{}" |
| Format for auto generated annotation with severity. | |
| static TextView | AUTOTEXT_CODE = "{}" |
| Format for auto generated annotation with error code. | |
| static TextView | AUTOTEXT_SEVERITY_CODE = "{}: {}" |
| Format for auto generate annotation with error code and severity. | |
| static MemSpan< TextView const > | SEVERITY_NAMES {Severity_Names.data(), Severity_Names.size()} |
| static constexpr struct swoc::Errata::AutoText | AUTO |
| static TextView | DEFAULT_ANNOTATION_GLUE_TEXT = "\n" |
| Default glue value (a newline) for text rendering. | |
| static TextView | DEFAULT_SEVERITY_GLUE_TEXT = ": " |
| Default glue text for use after the severity name. | |
| static TextView | DEFAULT_INDENT_TEXT = " " |
Protected Types | |
| using | self_type = Errata |
| using | Container = IntrusiveDList<Annotation::Linkage> |
Protected Member Functions | |
| Data * | data () |
| MemSpan< char > | alloc (size_t n) |
| self_type & | note_localized (std::string_view const &text, std::optional< Severity > severity=std::optional< Severity >{}) |
Add Annotation with already localized text. | |
Protected Attributes | |
| Data * | _data = nullptr |
Static Protected Attributes | |
| static Annotation const | NIL_NOTE |
| Used for returns when no data is present. | |
Friends | |
| struct | Data |
| class | Item |
| std::ostream & | operator<< (std::ostream &os, self_type const &err) |
| BufferWriter & | bwformat (BufferWriter &bw, bwf::Spec const &spec, Errata const &errata) |
Class to hold a stack of error messages (the "errata"). This is a smart handle class, which wraps the actual data and can therefore be treated a value type with cheap copy semantics. Default construction is very cheap.
| using swoc::Errata::code_type = std::error_code |
| using swoc::Errata::const_iterator = Container::const_iterator |
|
protected |
|
protected |
| using swoc::Errata::severity_type = uint8_t |
| using swoc::Errata::SinkHandler = std::function<void(Errata const &)> |
|
inlinenoexcept |
|
inlineexplicit |
|
inlineexplicit |
Construct with an error code and generated annotation.
| ec | Error code |
An annotation is created using the format AUTOTEXT_CODE with ec as the argument.
|
inlineexplicit |
|
inlineexplicit |
Construct with a severity.
| severity | Severity. |
An annotation is created using the format AUTO_TEXT_SEVERITY with severity as the argument.
Construct with a severity and error code.
| severity | Severity. |
| ec | Error code. |
| auto_text | If present, generate an annotation. |
The annotation uses the format AUTOTEXT_SEVERITY_CODE with arguments severity , ec
|
inline |
Constructor.
| code | Error code. |
| severity | Severity. |
| text | Annotation text. |
Constructs with error code and severity. An annotation with text.
|
inline |
Constructor.
| severity | Severity. |
| text | Annotation text. |
Constructs with severity and an annotation with text.
|
inline |
|
inlineexplicit |
| swoc::Errata::Errata | ( | code_type const & | code, |
| Severity | severity, | ||
| std::string_view | fmt, | ||
| Args &&... | args ) |
Constructor.
| Args | Format argument types. |
| code | Error code. |
| severity | Severity. |
| fmt | Annotation format. |
| args | Annotation format arguments. |
Cosntructs with error code and severity and an formatted annotation.
| swoc::Errata::Errata | ( | code_type const & | type, |
| std::string_view | fmt, | ||
| Args &&... | args ) |
| swoc::Errata::Errata | ( | Severity | severity, |
| std::string_view | fmt, | ||
| Args &&... | args ) |
|
explicit |
|
protected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Append an Annotation to the top based on error code code with severity.
| severity | Local severity. |
| code | Error code. |
The annotation uses the format AUTOTEXT_SEVERITY_CODE with the argument severity.
Add an Annotation to the top based on error code code.
| code | Error code. |
The annotation uses the format AUTOTEXT_CODE with the argument ec.
Errata error code is unchanged. Add an Annotation to the top with text and local severity.
| severity | The local severity. |
The annotation uses the format AUTOTEXT_SEVERITY with the argument severity.
| self_type & swoc::Errata::note | ( | Severity | severity, |
| std::string_view | fmt, | ||
| Args &&... | args ) |
Append an Annotation.
| severity | Local severity. |
| fmt | Format string (BufferWriter style). |
| args | Arguments for values in fmt. |
The severity is updated to severity if the latter is more severe.
Add an Annotation to the top with text and local severity.
| severity | The local severity. |
| text | Text of the message. |
text is localized to this and does not need to be persistent. The severity is updated to severity if the latter is more severe.
| self_type & swoc::Errata::note | ( | std::string_view | fmt, |
| Args &&... | args ) |
Append an Annotation.
| fmt | Format string (BufferWriter style). |
| args | Arguments for values in fmt. |
| Errata & swoc::Errata::note | ( | std::string_view | fmt, |
| Args &&... | args ) |
|
inline |
Add an Annotation to the top with text.
| text | Text of the message. |
The error code is set to the default. text is localized to this and does not need to be persistent.
|
protected |
Add Annotation with already localized text.
Append an Annotation to the top based with optional severity.
| severity | Local severity. |
| text | Annotation text. |
This is a unified interface for other fixed text note methods which all forward to this method. If severity does not have a value then the annotation is never filtered.
The severity is updated to severity if the latter is set and more severe.
| self_type & swoc::Errata::note_sv | ( | std::optional< Severity > | severity, |
| std::string_view | fmt, | ||
| std::tuple< Args... > const & | args ) |
Append an Annotation.
| severity | Local severity. |
| fmt | Format string (BufferWriter style). |
| args | Arguments for values in fmt. |
The severity is updated to severity if the latter is set and more severe.
This the effective implementation method for all variadic styles of the note method.
| self_type & swoc::Errata::note_v | ( | Severity | severity, |
| std::string_view | fmt, | ||
| std::tuple< Args... > const & | args ) |
Append an Annotation.
| severity | Local severity. |
| fmt | Format string (BufferWriter style). |
| args | Arguments for values in fmt. |
This is intended for use by external "helper" methods that pass their own arguments to this using forward_as_tuple.
The severity is updated to severity if the latter is more severe.
| self_type & swoc::Errata::note_v | ( | std::string_view | fmt, |
| std::tuple< Args... > const & | args ) |
Append an Annotation.
| fmt | Format string (BufferWriter style). |
| args | Arguments for values in fmt. |
This is intended for use by external "helper" methods that pass their own arguments to this using forward_as_tuple.
| Errata & swoc::Errata::note_v | ( | std::string_view | fmt, |
| std::tuple< Args... > const & | args ) |
|
inlineexplicit |
|
inline |
|
inline |
|
static |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
| Errata & swoc::Errata::sink | ( | ) |
Log and clear this.
The content is sent to the defined Sink instances then reset to the default state.
| auto swoc::Errata::update | ( | Severity | severity | ) |
| std::ostream & swoc::Errata::write | ( | std::ostream & | out | ) | const |
|
friend |
|
friend |
|
protected |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
static |
Minimum severity level for an Annotation. If an Annotation is added with an explicit Severity that is smaller the Annotation is discarded instead of added. This defaults to zero and no filtering is done unless it is overwritten.
|
staticprotected |
|
static |