File indexing completed on 2024-04-28 05:11:04

0001 /*
0002     This file is part of Akregator.
0003 
0004     SPDX-FileCopyrightText: 2005 Frank Osterfeld <osterfeld@kde.org>
0005 
0006     SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
0007 */
0008 
0009 #pragma once
0010 
0011 #include "akregator_export.h"
0012 #include <QString>
0013 using uint = unsigned int;
0014 
0015 namespace Akregator
0016 {
0017 class AKREGATOR_EXPORT Utils
0018 {
0019 public:
0020     /** removes HTML/XML tags (everything between &lt; and &gt;) from a string.  "<p><strong>foo</strong> bar</p>" becomes "foo bar" */
0021     static QString stripTags(QString str);
0022 
0023     /** taken from some website... -fo
0024      * djb2
0025      * This algorithm was first reported by Dan Bernstein
0026      * many years ago in comp.lang.c
0027      */
0028 
0029     static uint calcHash(const QString &str);
0030 
0031     static QString convertHtmlTags(const QString &title);
0032 };
0033 } // namespace Akregator