Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::css::InvalidRule Struct Reference

InvalidRule is used to represent a rule which could not be parsed, such as an invalid at-rule. More...

#include "donner/css/Rule.h"

Public Types

enum class  Type {
  Default ,
  ExtraInput
}
 Type of the invalid rule. More...
 

Public Member Functions

 InvalidRule (Type type=Type::Default)
 Construct an InvalidRule with the given type.
 
bool operator== (const InvalidRule &other) const
 Equality operator.
 

Public Attributes

Type type
 Type of the invalid rule.
 

Friends

std::ostream & operator<< (std::ostream &os, const InvalidRule &invalidRule)
 Output a human-readable parsed representation of InvalidRule to the given stream.
 

Detailed Description

InvalidRule is used to represent a rule which could not be parsed, such as an invalid at-rule.

For example, the following is an invalid at-rule:

@charset "123"

The @charset is a valid at-rule, but it is missing a semicolon at the end, so it is invalid.

The InvalidRule may have a more specific type, such as ExtraInput, depending on how the error was triggered.

Member Enumeration Documentation

◆ Type

enum class donner::css::InvalidRule::Type
strong

Type of the invalid rule.

Enumerator
Default 

Default type, no specific information.

ExtraInput 

The rule had extra input after the end of the rule.

Constructor & Destructor Documentation

◆ InvalidRule()

donner::css::InvalidRule::InvalidRule ( Type type = Type::Default)
inlineexplicit

Construct an InvalidRule with the given type.

Parameters
typeType of the invalid rule.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const InvalidRule & invalidRule )
friend

Output a human-readable parsed representation of InvalidRule to the given stream.

For example, InvalidRule or InvalidRule(ExtraInput).

Parameters
osOutput stream.
invalidRuleInvalidRule to output.

The documentation for this struct was generated from the following file: