Container for the attributes of a parsing error from i3wm when trying to run an unparsable command.
More...
#include <qi3pc.h>
|
| QString | error |
| | Human readble error message.
|
| QString | input |
| | The command that failed to run.
|
| QString | errorPosition |
| | The position where the error was detected in the input.
|
|
| static constexpr auto | _MEMBERS |
| | Mapping of i3wm's parse error reply's attributes to members of ParseError.
|
Container for the attributes of a parsing error from i3wm when trying to run an unparsable command.
This is the processed reply for a qi3pc::IpcType::Command reply.
Definition at line 201 of file qi3pc.h.
◆ QStringMemberPtr
◆ toString()
| QString qi3pc::ParseError::toString |
( |
| ) |
const |
Convert to a json like string.
- Returns
- QString representation of the ParseError
The resulting string is in the form "{member:'member'}{member2:'member2'}".
- Note
- This is NOT valid JSON. Notice the lack of commas between elements.
Definition at line 775 of file qi3pc.cpp.
References _MEMBERS.
◆ operator==()
| bool qi3pc::ParseError::operator== |
( |
const ParseError & | other | ) |
const |
◆ FromJSON()
| qi3pc::Error qi3pc::ParseError::FromJSON |
( |
const QJsonObject & | json | ) |
|
|
static |
Build an optional ParseError from a QJsonObject.
- Parameters
-
- Returns
- A ParseError or a nullopt.
At least "parse_error" should be in the JSON. If it's not present, a nullopt is returned. If only that key and none of the other checked ones exist, a default initialized ParseError is returned. Otherwise for each of the checked keys found, the corresponding member is initialized. Values in the JSON are expected to be of string type.
Definition at line 752 of file qi3pc.cpp.
References _MEMBERS.
◆ error
| QString qi3pc::ParseError::error |
Human readble error message.
Definition at line 203 of file qi3pc.h.
◆ input
| QString qi3pc::ParseError::input |
The command that failed to run.
Definition at line 206 of file qi3pc.h.
◆ errorPosition
| QString qi3pc::ParseError::errorPosition |
The position where the error was detected in the input.
This is a string of the same length as the input. Spaces ' ' represent the parsable part of the input. Starting from where the error was detected, the rest is represented with carets '^'.
Definition at line 216 of file qi3pc.h.
◆ _MEMBERS
| auto qi3pc::ParseError::_MEMBERS |
|
inlinestaticconstexprprivate |
Initial value: = std::to_array<std::pair<const char*, QStringMemberPtr>>
({
})
QString errorPosition
The position where the error was detected in the input.
QString input
The command that failed to run.
QString error
Human readble error message.
Mapping of i3wm's parse error reply's attributes to members of ParseError.
Definition at line 253 of file qi3pc.h.
The documentation for this struct was generated from the following files: