IP2CParser Class Reference

#include <ip2cparser.h>

+ Inheritance diagram for IP2CParser:

Signals

void parsingFinished (bool bSuccess)
 A signal emitted when parser finishes its job.
 

Public Member Functions

bool isParsing () const
 For multi-threading purposes. If this is true it is not recommended to delete this object nor the underlying IP2C database.
 
const QList< IP2C::IP2CDataparsed () const
 
bool readDatabase (const QString &filePath)
 
void readDatabaseThreaded (const QString &filePath)
 

Detailed Description

Compacted database file format, version 2: (all strings are null terminated) Header:

TYPE LENGTH DESCRIPTION
-----------------------------------------------------
unsigned long 4 'I' 'P' '2' 'C' bytes
unsigned short 2 Version (equal to 2)

Block repeated until EOF:

TYPE LENGTH DESCRIPTION
-----------------------------------------------------
string N/A Country full name, UTF-8
string N/A Country abbreviation (3 letters version)
unsigned long 4 Number of IP Blocks (N_IP_BLOCKS)
-- BLOCK: repeated N_IP_BLOCKS times.
unsigned long 4 Beginning of an IP range
unsigned long 4 End of an IP range
-- END OF BLOCK

Definition at line 55 of file ip2cparser.h.

Member Function Documentation

bool IP2CParser::isParsing ( ) const
inline

For multi-threading purposes. If this is true it is not recommended to delete this object nor the underlying IP2C database.

Definition at line 66 of file ip2cparser.h.

void IP2CParser::parsingFinished ( bool  bSuccess)
signal

A signal emitted when parser finishes its job.

It is not safe to delete IP2CParser object after readDatabase() call and before this signal is emitted.


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