Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

CollectionHolder Class Reference

This class holds the collections. More...

#include <collection_holder.h>

List of all members.

Static Public Methods

void load ()
void save ()
int numberOfCollections ()
int numberOfPermanentCollections ()
int numberOfTemporaryCollections ()
int indexFromName (QString const &name)
Collectioncollection (int index)
bool isTemporary (int index)
void setTemporary (int index, bool temporary)
int addCollection (Collection *collection, bool temporary)
void removeCollection (int index)
void setModified ()
void findCompressedMap (CompressedMap const &compressed_map, int &collection_nr, int &level_nr)
bool updateCollections (QDateTime const &min_date, bool show_trival_changes)

Static Private Methods

void getCollections (QString const &filename)
void getCollections (QStringList const &files)

Static Private Attributes

std::vector< Collection *> s_collections
std::vector< int > s_temporary
bool s_modified
bool s_initialized

Detailed Description

This class holds the collections.

Ralf Schmelter (

Member Function Documentation

int CollectionHolder::addCollection Collection * collection,
bool temporary

Adds a new collection.

If a collection with the same name exists, it will be deleted!

This object takes over ownership of the collection.

collection   The new collection.
temporary   If true, the collection is only temporary and will not be saved.
The index of the collection.

Collection* CollectionHolder::collection int index [static]

Returns a pointer to the given collection.

index   The index of the collection.

void CollectionHolder::findCompressedMap CompressedMap const & compressed_map,
int & collection_nr,
int & level_nr

Gets the index of the collection and level of a compressed map.

If the compressed map is not found, collection_nr will be set to -1.

compressed_map   The compressed to search.
collection_nr   Here we store the colleciton number.
level_nr   Here we store the level number.

void CollectionHolder::getCollections QStringList const & files [static, private]

Loads the collections from the given xsb-files.

files   The files from which to load the collections.

void CollectionHolder::getCollections QString const & filename [static, private]

Loads the collections from the given compiled file.

filename   The file to use.

int CollectionHolder::indexFromName QString const & name [static]

Returns the index of the collection with the given name or -1 if it does not exists.

name   The name of the collection.

bool CollectionHolder::isTemporary int index [static]

Returns true, if the given collection is only temporary.

index   The index of the collection.

void CollectionHolder::load [static]

Loads the collections.

Call this first and only once!

int CollectionHolder::numberOfCollections [static]

Returns the number of collections.

int CollectionHolder::numberOfPermanentCollections [static]

Returns the number of non temporary collections.

int CollectionHolder::numberOfTemporaryCollections [static]

Returns the number of temporary collections.

void CollectionHolder::removeCollection int index [static]

Removes the collection with the given index.

The collection must be modifyable.

index   The index of the collection to remove.

void CollectionHolder::save [static]

Saves the collections, if they were modified.

void CollectionHolder::setModified [static]

Marks a collection as modified.

void CollectionHolder::setTemporary int index,
bool temporary

Makes the current collection temporary or not.

index   The index of the collection.
temporary   If true the collection will be temporary.

bool CollectionHolder::updateCollections QDateTime const & min_date,
bool show_trival_changes

Searches for updated or new collections.

min_date   The minimum date of collections to consider.
show_trival_changes   If false, trivial changes are not shown but simply applied.
True, if at least one changed or new collection was found.

Member Data Documentation

std::vector<Collection *> CollectionHolder::s_collections [static, private]

The collections.

bool CollectionHolder::s_initialized [static, private]

If true, load was called.

bool CollectionHolder::s_modified [static, private]

If true, the collection was modified.

std::vector<int> CollectionHolder::s_temporary [static, private]

The flags, if the level are only temporary.

The documentation for this class was generated from the following file:
Generated at Sun Jan 6 18:49:10 2002 for EasySok by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001