Cute Chess  0.1
Public Types | Public Member Functions | List of all members
PgnGameEntry Class Reference

An entry in a PGN collection. More...

#include <pgngameentry.h>

Public Types

enum  TagType {
  EventTag, SiteTag, DateTag, RoundTag,
  WhiteTag, BlackTag, ResultTag, VariantTag
}
 

Public Member Functions

void clear ()
 
qint64 lineNumber () const
 
bool match (const PgnGameFilter &filter) const
 
 PgnGameEntry ()
 
qint64 pos () const
 
bool read (PgnStream &in)
 
bool read (QDataStream &in)
 
QString tagValue (TagType type) const
 
void write (QDataStream &out) const
 

Detailed Description

An entry in a PGN collection.

A PgnGameEntry object contains the tags of a PGN game, and the position and line number in a PGN stream. This class was designed for high-performance and low memory consumption, which is useful for quickly loading large game collections.

See also
PgnGame, PgnStream

Member Enumeration Documentation

A PGN tag's type.

Enumerator
EventTag 

The name of the tournament or match event.

SiteTag 

The location of the event.

DateTag 

The starting date of the game.

RoundTag 

The playing round ordinal of the game.

WhiteTag 

The player of the white pieces.

BlackTag 

The player of the black pieces.

ResultTag 

The result of the game.

VariantTag 

The chess variant of the game.

Constructor & Destructor Documentation

PgnGameEntry::PgnGameEntry ( )

Creates a new empty PgnGameEntry object.

Member Function Documentation

void PgnGameEntry::clear ( )

Resets the entry to an empty default.

qint64 PgnGameEntry::lineNumber ( ) const

Returns the line number where the game begins.

bool PgnGameEntry::match ( const PgnGameFilter filter) const

Returns true if the PGN tags match filter. The matching is case insensitive.

qint64 PgnGameEntry::pos ( ) const

Returns the stream position where the game begins.

bool PgnGameEntry::read ( PgnStream in)

Reads an entry from a PGN stream. Returns true if successful; otherwise returns false.

bool PgnGameEntry::read ( QDataStream in)

Reads an entry from data stream. Returns true if successful; otherwise returns false.

QString PgnGameEntry::tagValue ( TagType  type) const

Returns the tag value corresponding to type.

void PgnGameEntry::write ( QDataStream out) const

Writes an entry to data stream.


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