libfossil
fsl::Deck::FCardIterator Class Reference

An STL-style iterator class for use with traversing the F-cards in a Deck object. More...

#include "fossil.hpp"

Public Member Functions

 FCardIterator (Deck &d, bool skipDeletedFiles=false)
 Rewinds d's F-card list and initializes this iterator to point to the first F-card in d. More...
 
 FCardIterator () throw ()
 Constructs an "end" iterator. More...
 
 ~FCardIterator () throw ()
 
bool operator!= (FCardIterator const &rhs) const throw ()
 Compares this object and rhs by name. More...
 
fsl_card_F const * operator* ()
 The current F-card, or NULL at the end of the list. More...
 
FCardIteratoroperator++ ()
 Prefix increment: advances iterator and returns the new value. More...
 
fsl_card_F const * operator-> ()
 Convenience operator. More...
 
bool operator< (FCardIterator const &rhs) const throw ()
 Compares this object and rhs by name. More...
 
bool operator== (FCardIterator const &rhs) const throw ()
 Compares this object and rhs by name. More...
 

Detailed Description

An STL-style iterator class for use with traversing the F-cards in a Deck object.

Because of how delta manifests work, F-cards have rather intricate traversal rules. This class helps hide those from the client (the only one it exposes is that F-cards are required to be in strict lexical order).

Reminder: client code must be prepared to handle F-cards with NULL UUIDs. They appear when a file is removed between a baseline manifest and its delta. The delta marks deletions with a NULL UUID. A baseline manifest marks deletions by simply not including the file in the manifest (no F-card). The library "could" skip such entries when iterating, but knowing about deleted entries is useful at times.

Potential TODO: a flag to this class which tells it to skip over deleted entries.

Definition at line 1842 of file fossil.hpp.

Constructor & Destructor Documentation

fsl::Deck::FCardIterator::FCardIterator ( Deck d,
bool  skipDeletedFiles = false 
)
explicit

Rewinds d's F-card list and initializes this iterator to point to the first F-card in d.

Remember that only decks of type FSL_CATYPE_CHECKIN have F-cards. Throws if rewinding fails (it only fails if lazy loading of a baseline manifest fails).

fsl::Deck::FCardIterator::FCardIterator ( )
throw (
)

Constructs an "end" iterator.

fsl::Deck::FCardIterator::~FCardIterator ( )
throw (
)

Member Function Documentation

bool fsl::Deck::FCardIterator::operator!= ( FCardIterator const &  rhs) const
throw (
)

Compares this object and rhs by name.

fsl_card_F const* fsl::Deck::FCardIterator::operator* ( )

The current F-card, or NULL at the end of the list.

FCardIterator& fsl::Deck::FCardIterator::operator++ ( )

Prefix increment: advances iterator and returns the new value.

A no-op for an "end" iterator.

If the skip-deleted flag was passed to the constructor then F-cards which represent deleted entries are skipped during traversal.

fsl_card_F const* fsl::Deck::FCardIterator::operator-> ( )

Convenience operator.

Throws for an "end" iterator.

bool fsl::Deck::FCardIterator::operator< ( FCardIterator const &  rhs) const
throw (
)

Compares this object and rhs by name.

bool fsl::Deck::FCardIterator::operator== ( FCardIterator const &  rhs) const
throw (
)

Compares this object and rhs by name.


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