Falkon Develop
Cross-platform Qt-based web browser
OpenSearchReader Class Reference

A class reading a search engine description from an external source. More...

#include <opensearchreader.h>

Inheritance diagram for OpenSearchReader:

Public Member Functions

 OpenSearchReader ()
 
OpenSearchEngineread (QIODevice *device)
 

Detailed Description

A class reading a search engine description from an external source.

OpenSearchReader is a class that can be used to read search engine descriptions formed using the OpenSearch format.

It inherits QXmlStreamReader and thus provides additional functions, such as QXmlStreamReader::error(), QXmlStreamReader::hasError() that can be used to make sure the reading procedure succeeded.

For more information see: http://www.opensearch.org/Specifications/OpenSearch/1.1/Draft_4#OpenSearch_description_document

See also
OpenSearchEngine, OpenSearchWriter

Definition at line 45 of file opensearchreader.h.

Constructor & Destructor Documentation

◆ OpenSearchReader()

OpenSearchReader::OpenSearchReader ( )

Constructs a new reader.

Note
One instance can be used to read multiple files, one by one.

Definition at line 64 of file opensearchreader.cpp.

Member Function Documentation

◆ read()

OpenSearchEngine * OpenSearchReader::read ( QIODevice *  device)

Reads an OpenSearch engine from the device and returns an OpenSearchEngine object, filled in with all the data that has been retrieved from the document.

If the device is closed, it will be opened.

To make sure if the procedure succeeded, check QXmlStreamReader::error().

Returns
a new constructed OpenSearchEngine object
Note
The function returns an object of the OpenSearchEngine class even if the document is bad formed or doesn't conform to the specification. It needs to be manually deleted afterwards, if intended.
The lifetime of the returned OpenSearchEngine object is up to the user. The object should be deleted once it is not used anymore to avoid memory leaks.

Definition at line 85 of file opensearchreader.cpp.


The documentation for this class was generated from the following files: