|
qi3pc 0.4.1
Qt based library to communicate with i3wm via its IPC API
|
The Err struct contains the attributes of a parsing error from i3wm when trying to run an unparsable command;. More...
#include <qi3pc.h>
Public Member Functions | |
| QString | toString () const |
| Convert to a json like string. | |
| bool | operator== (const ParseError &other) const |
| Memberwise comparison of this ParseError and another. | |
Static Public Member Functions | |
| static std::optional< ParseError > | FromJSON (const QJsonObject &json) |
| Build an optional ParseError from a QJsonObject. | |
Public Attributes | |
| 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. | |
Private Types | |
| using | QStringMemberPtr = QString ParseError::* |
| QString member pointer of ParseError. | |
Static Private Attributes | |
| static constexpr auto | _MEMBERS |
| Mapping of i3wm's parse error reply's attributes to members of ParseError. | |
The Err struct contains 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.
|
private |
QString member pointer of ParseError.
| QString qi3pc::ParseError::toString | ( | ) | const |
Convert to a json like string.
The resulting string is in the form "{member:'member'}{member2:'member2'}".
Definition at line 760 of file qi3pc.cpp.
References _MEMBERS.
| bool qi3pc::ParseError::operator== | ( | const ParseError & | other | ) | const |
Memberwise comparison of this ParseError and another.
| other | The second object to compare. |
Definition at line 753 of file qi3pc.cpp.
References error, errorPosition, and input.
|
static |
Build an optional ParseError from a QJsonObject.
| json | JSON object with structure matching ParseError::_MEMBERS. |
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 737 of file qi3pc.cpp.
References _MEMBERS.
| QString qi3pc::ParseError::error |
| QString qi3pc::ParseError::input |
| QString qi3pc::ParseError::errorPosition |
|
inlinestaticconstexprprivate |
Mapping of i3wm's parse error reply's attributes to members of ParseError.