cutelyst 3.9.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
viewjson.h
1/*
2 * SPDX-FileCopyrightText: (C) 2015-2022 Daniel Nicoletti <dantti12@gmail.com>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef VIEWJSON_H
6#define VIEWJSON_H
7
8#include <Cutelyst/cutelyst_global.h>
9#include <Cutelyst/view.h>
10
11namespace Cutelyst {
12
13class ViewJsonPrivate;
14class CUTELYST_VIEW_JSON_EXPORT ViewJson final : public View
15{
17 Q_DECLARE_PRIVATE(ViewJson)
18public:
22 explicit ViewJson(QObject *parent, const QString &name = QString());
23
29 Q_ENUM(JsonFormat)
30
31
35 JsonFormat outputFormat() const;
36
40 void setOutputFormat(JsonFormat format);
41
43 enum ExposeMode { All, String, StringList, RegularExpression };
44 Q_ENUM(ExposeMode)
45
46
50 ExposeMode exposeStashMode() const;
51
56 void setExposeStash(const QString &key);
57
62 void setExposeStash(const QStringList &keys);
63
68 void setExposeStash(const QRegularExpression &re);
69
75 void setXJsonHeader(bool enable);
76
80 bool xJsonHeader() const;
81
82 QByteArray render(Context *c) const final;
83};
84
85} // namespace Cutelyst
86
87#endif // VIEWJSON_H
QString name() const
Definition component.cpp:33
The Cutelyst Context.
Definition context.h:39
ViewJson(QObject *parent, const QString &name=QString())
Definition viewjson.cpp:21
View(QObject *parent, const QString &name)
Definition view.cpp:18
The Cutelyst namespace holds all public Cutelyst API.
Definition Mainpage.dox:8
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
QObject * parent() const const