Libksieve

response.h
1/*
2 SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
3 SPDX-FileContributor: Volker Krause <volker.krause@kdab.com>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#pragma once
9
10#include <QByteArray>
11
12namespace KManageSieve
13{
14/** A response from a managesieve server.
15 * @internal
16 */
18{
19public:
20 enum Type {
21 None,
22 KeyValuePair,
23 Action,
24 Quantity
25 };
26
27 Response() = default;
28
29 [[nodiscard]] Type type() const;
30 [[nodiscard]] QByteArray action() const;
31 [[nodiscard]] uint quantity() const;
32 [[nodiscard]] QByteArray key() const;
33 [[nodiscard]] QByteArray value() const;
34 [[nodiscard]] QByteArray extra() const;
35
36 enum Result {
37 Ok,
38 No,
39 Bye,
40 Other,
41 };
42
43 [[nodiscard]] Result operationResult() const;
44 [[nodiscard]] bool operationSuccessful() const;
45
46 void clear();
47 [[nodiscard]] bool parseResponse(const QByteArray &line);
48
49private:
50 Type m_type = None;
51 uint m_quantity = 0;
52 QByteArray m_key;
53 QByteArray m_value;
54 QByteArray m_extra;
55};
56}
A response from a managesieve server.
Definition response.h:18
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:14:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.