cWebshots::cWebshotsTXT Class Reference

#include <cWebshots.h>

Collaboration diagram for cWebshots::cWebshotsTXT:

Collaboration graph
[legend]
List of all members.

Detailed Description

Contains informations about a collection and its pictures, read from photos.txt / album.txt files.

Definition at line 156 of file cWebshots.h.

Public Member Functions

 cWebshotsTXT (void)
 Constructor.
 cWebshotsTXT (string directory)
 Constructor.
 ~cWebshotsTXT (void)
 Destructor.
void Load (string directory)
 Load photos.txt and/or album.txt from a directory.
sPhotosTXTPicture (int index)
 Return a record, given its index.
int PictureCount ()
 Return the number of records.
int IndexFromFileName (string filename, bool case_sensitive=false)
 Return the index of a record, given the filename.

Public Attributes

sAlbumTXT Album
 sAlbumTXT structure which contains informations about the collection

Static Public Attributes

static const int IndexNotFound = -1
 Returned by IndexFromFileName when the index is not found.

Private Attributes

sPhotosTXTPictures
 Pointer to an array of sPhotosTXT sturctures which contains informations about pictures.
int Count
 Number of picture information records.


Constructor & Destructor Documentation

cWebshots::cWebshotsTXT::cWebshotsTXT void   ) 
 

Constructor.

Definition at line 37 of file cWebshotsTXT.cpp.

References Count.

cWebshots::cWebshotsTXT::cWebshotsTXT string  directory  ) 
 

Constructor.

Parameters:
[in] directory Complete path to the directory which contains photos.txt and/or album.txt file(s).

Definition at line 47 of file cWebshotsTXT.cpp.

References Count, and Load().

cWebshots::cWebshotsTXT::~cWebshotsTXT void   ) 
 

Destructor.

Definition at line 56 of file cWebshotsTXT.cpp.

References Count, and Pictures.


Member Function Documentation

int cWebshots::cWebshotsTXT::IndexFromFileName string  filename,
bool  case_sensitive = false
 

Return the index of a record, given the filename.

Parameters:
[in] filename File name of the picture
[in] case_sensitive Define if the search is case-sensitive or not
Returns:
The index of the record or cWebshotsTXT::IndexNotFound if no record was found with the given filename
Todo:
Make a case insensitive tring comparison

Definition at line 286 of file cWebshotsTXT.cpp.

References Count, IndexNotFound, and Pictures.

void cWebshots::cWebshotsTXT::Load string  directory  ) 
 

Load photos.txt and/or album.txt from a directory.

Parameters:
[in] directory Complete path to the directory which contains photos.txt and/or album.txt file(s).

Definition at line 68 of file cWebshotsTXT.cpp.

References Album, cWebshots::sPhotosTXT::caption, Count, cWebshots::sAlbumTXT::create_date, cWebshots::sPhotosTXT::credit, cWebshots::sAlbumTXT::description, cWebshots::sAlbumTXT::edit_date, cWebshots::sPhotosTXT::id, cWebshots::sAlbumTXT::id, cWebshots::sAlbumTXT::in_use, cWebshots::sAlbumTXT::photo_count, Pictures, cWebshots::sPhotosTXT::position, cWebshots::sPhotosTXT::source, cWebshots::sPhotosTXT::title, cWebshots::sAlbumTXT::title, cWebshots::sAlbumTXT::topic_name, cWebshots::sPhotosTXT::url_photo, and cWebshots::sPhotosTXT::url_thumb.

Referenced by cWebshotsTXT(), and cWebshots::cWebshotsCollection::LoadFromFolder().

sPhotosTXT & cWebshots::cWebshotsTXT::Picture int  index  ) 
 

Return a record, given its index.

Parameters:
[in] index Index of the record
Returns:
The record number index

Definition at line 261 of file cWebshotsTXT.cpp.

References Pictures.

Referenced by cWebshots::cWebshotsCollection::LoadFromFolder().

int cWebshots::cWebshotsTXT::PictureCount  ) 
 

Return the number of records.

Returns:
The number of records

Definition at line 271 of file cWebshotsTXT.cpp.

References Count.

Referenced by cWebshots::cWebshotsCollection::LoadFromFolder().


Member Data Documentation

sAlbumTXT cWebshots::cWebshotsTXT::Album
 

sAlbumTXT structure which contains informations about the collection

Definition at line 174 of file cWebshots.h.

Referenced by Load(), and cWebshots::cWebshotsCollection::LoadFromFolder().

int cWebshots::cWebshotsTXT::Count [private]
 

Number of picture information records.

Definition at line 160 of file cWebshots.h.

Referenced by cWebshotsTXT(), IndexFromFileName(), Load(), PictureCount(), and ~cWebshotsTXT().

const int cWebshots::cWebshotsTXT::IndexNotFound = -1 [static]
 

Returned by IndexFromFileName when the index is not found.

Definition at line 176 of file cWebshots.h.

Referenced by IndexFromFileName().

sPhotosTXT* cWebshots::cWebshotsTXT::Pictures [private]
 

Pointer to an array of sPhotosTXT sturctures which contains informations about pictures.

Definition at line 159 of file cWebshots.h.

Referenced by IndexFromFileName(), Load(), Picture(), and ~cWebshotsTXT().


The documentation for this class was generated from the following files:
Generated on Tue Oct 25 14:36:31 2005 for cWebshots by  doxygen 1.4.5