mumble/src/HTMLFilter.h
Robert 56db3410c5 MAINT: Update copyright notice to 2021 (Part II)
Apparently the first commit (59ae429972)
did not include all files.

Furthermore the used script tended to produce funny results in certain
cases. This has been fixed and as a result thereof a few more changes
were made in this second run.
2021-04-09 15:41:49 +02:00

39 lines
1.1 KiB
C++

// Copyright 2016-2021 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
#ifndef MUMBLE_HTMLFILTER_H_
#define MUMBLE_HTMLFILTER_H_
#include <QString>
/// HTMLFilter provides utilitites for
/// creating a plain text representaton
/// of a HTML document.
///
/// It is used for converting Mumble
/// text messages, comments, and more
/// to plain text when a server is
/// configured to disallow HTML.
class HTMLFilter {
/// escapeTags returns the in HTML document
/// with all occurrences of > and <
/// replaced by &lt; and &gt;.
static QString escapeTags(const QString &in);
public:
/// filter does a best-effort conversion of the
/// in HTML document to a plain-text representation.
///
/// If the filtering process succeeded, the function
/// writes the filtered document as plain text to
/// out, and returns true.
///
/// If the filtering failed, the function returns false
/// and out is left unchanged.
static bool filter(const QString &in, QString &out);
};
#endif