2020-08-25 16:05:56 +02:00
|
|
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
2020-05-30 16:15:03 +02:00
|
|
|
*
|
2020-08-25 16:05:56 +02:00
|
|
|
* SPDX-FileCopyrightText: 2018-2019 Adriaan de Groot <groot@kde.org>
|
2020-05-30 16:15:03 +02:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2020-08-25 16:05:56 +02:00
|
|
|
*
|
|
|
|
* Calamares is Free Software: see the License-Identifier above.
|
2020-05-30 16:15:03 +02:00
|
|
|
*
|
2018-04-12 18:18:43 +02:00
|
|
|
*/
|
|
|
|
|
2019-05-02 11:58:52 +02:00
|
|
|
#ifndef GEOIP_GEOIPXML_H
|
|
|
|
#define GEOIP_GEOIPXML_H
|
2018-04-12 18:18:43 +02:00
|
|
|
|
2019-05-02 13:25:48 +02:00
|
|
|
#include "Interface.h"
|
2018-04-12 18:18:43 +02:00
|
|
|
|
2019-05-13 12:25:14 +02:00
|
|
|
namespace CalamaresUtils
|
|
|
|
{
|
|
|
|
namespace GeoIP
|
2019-05-02 11:58:52 +02:00
|
|
|
{
|
2018-04-12 18:18:43 +02:00
|
|
|
/** @brief GeoIP lookup with XML data
|
|
|
|
*
|
|
|
|
* The data is assumed to be in XML format with a
|
|
|
|
* <Response><TimeZone></TimeZone></Response>
|
|
|
|
* element, which contains the text (string) for the region/zone. This
|
|
|
|
* format is expected by, e.g. the Ubiquity installer.
|
2019-05-02 13:25:48 +02:00
|
|
|
*
|
|
|
|
* @note This class is an implementation detail.
|
2018-04-12 18:18:43 +02:00
|
|
|
*/
|
2019-05-02 13:25:48 +02:00
|
|
|
class GeoIPXML : public Interface
|
2018-04-12 18:18:43 +02:00
|
|
|
{
|
2018-04-16 10:55:37 +02:00
|
|
|
public:
|
2018-04-16 11:27:01 +02:00
|
|
|
/** @brief Configure the element tag which is selected.
|
|
|
|
*
|
|
|
|
* If an empty string is passed in (not a valid element tag),
|
|
|
|
* then "TimeZone" is used.
|
|
|
|
*/
|
|
|
|
explicit GeoIPXML( const QString& element = QString() );
|
2018-04-16 10:55:37 +02:00
|
|
|
|
2019-05-09 16:15:53 +02:00
|
|
|
virtual RegionZonePair processReply( const QByteArray& ) override;
|
2019-08-08 12:32:21 +02:00
|
|
|
virtual QString rawReply( const QByteArray& ) override;
|
|
|
|
};
|
2018-04-12 18:18:43 +02:00
|
|
|
|
2019-08-08 12:32:21 +02:00
|
|
|
} // namespace GeoIP
|
|
|
|
} // namespace CalamaresUtils
|
2018-04-12 18:18:43 +02:00
|
|
|
#endif
|