cWebshots::cWebshotsPicture Class Reference

#include <cWebshots.h>

List of all members.


Detailed Description

Contains a webshots picture and its meta informations.

Definition at line 75 of file cWebshots.h.

Public Member Functions

 ~cWebshotsPicture (void)
 Destructor.
 cWebshotsPicture (void)
 Constructor.
 cWebshotsPicture (const cWebshotsPicture &source)
 Copy Constructor.
cWebshotsPictureoperator= (const cWebshotsPicture &source)
 Operator =.
void Clear ()
 Clears the picture.
void LoadFromFile (string File)
 Loads a picture from a file (WBZ/WB1/JPG).
void LoadFromMemory (const char *data, long size)
 Loads a picture from memory (WB1/JPG).
void SaveToFile (string file, Webshots_Formats format=JPG) const
 Saves the JPEG picture to a file.
char * PicturePtr () const
 Returns a pointer to the picture in memory (jpeg).
long PictureSize () const
 Returns the size of the picture.
char * ThumbnailPtr () const
 Returns a pointer to the thumbnail (bitmap).
long ThumbnailSize () const
 Returns the size of the thumbnail.

Public Attributes

long ID
 Picture ID.
string Original_Filename
 Picture original filename.
string Title
 Picture Title.
string Caption
 Picture caption.
string Credits
 Picture Credits.
string Category
 Picture Category.
string Album
 Picture Album.
string AlbumID
 Category ID.
string Source
 Picture source.
long DailyDate
 Date when the picture was published as the daily picture on the Webshots website.
long AdditionDate
 Date when the picture was added to the collection (if the picture is a part of a collection).

Private Member Functions

void LoadWB1 (ifstream &in_file)
 Loads a WB1/JPG file.
void LoadMetaDataTXT (string file)
 Loads metadata about a WB1 file from photos.txt.

Private Attributes

char * JPGFile
 Pointer to an array containing the JPG picture (if avaible).
long JPGFile_Size
 Size of the JPG picture.
char * BMPThumbnail
 Pointer to an array containing the BMP thumbnail (if avaible).
long BMPThumbnail_Size
 Size of the BMP thumbnail.


Constructor & Destructor Documentation

cWebshots::cWebshotsPicture::~cWebshotsPicture void   ) 
 

Destructor.

Definition at line 83 of file cWebshotsPicture.cpp.

cWebshots::cWebshotsPicture::cWebshotsPicture void   ) 
 

Constructor.

Definition at line 70 of file cWebshotsPicture.cpp.

cWebshots::cWebshotsPicture::cWebshotsPicture const cWebshotsPicture source  ) 
 

Copy Constructor.

Parameters:
[in] source Source cWebshotsPicture

Definition at line 98 of file cWebshotsPicture.cpp.


Member Function Documentation

void cWebshots::cWebshotsPicture::Clear  ) 
 

Clears the picture.

Definition at line 433 of file cWebshotsPicture.cpp.

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

void cWebshots::cWebshotsPicture::LoadFromFile string  File  ) 
 

Loads a picture from a file (WBZ/WB1/JPG).

Parameters:
[in] File Complete path to the file to load
Exceptions:
Exceptions::UnknownFormat Thrown if the file has an unknown format
Exceptions::FileSystemError Thrown if the file cannot be opened for reading

Definition at line 212 of file cWebshotsPicture.cpp.

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

void cWebshots::cWebshotsPicture::LoadFromMemory const char *  data,
long  size
 

Loads a picture from memory (WB1/JPG).

Parameters:
[in] data Pointer to the picture
[in] size Size of the picture in bytes
Exceptions:
Exceptions::UnknownFormat Thrown if the file has an unknown format

Definition at line 298 of file cWebshotsPicture.cpp.

Referenced by cWebshots::cWebshotsCollection::LoadWBCFile(), and cWebshots::cWebshotsCollection::LoadWBZFile().

void cWebshots::cWebshotsPicture::LoadMetaDataTXT string  file  )  [private]
 

Loads metadata about a WB1 file from photos.txt.

Parameters:
[in] file Complete path to the concerned wb1 file

Definition at line 354 of file cWebshotsPicture.cpp.

void cWebshots::cWebshotsPicture::LoadWB1 ifstream &  in_file  )  [private]
 

Loads a WB1/JPG file.

Parameters:
[in] in_file Reference to the stream of the file to load

Definition at line 261 of file cWebshotsPicture.cpp.

cWebshotsPicture & cWebshots::cWebshotsPicture::operator= const cWebshotsPicture source  ) 
 

Operator =.

Definition at line 110 of file cWebshotsPicture.cpp.

char * cWebshots::cWebshotsPicture::PicturePtr  )  const
 

Returns a pointer to the picture in memory (jpeg).

Returns:
a pointer to the picture

Definition at line 165 of file cWebshotsPicture.cpp.

long cWebshots::cWebshotsPicture::PictureSize  )  const
 

Returns the size of the picture.

Returns:
the size of the picture

Definition at line 175 of file cWebshotsPicture.cpp.

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

void cWebshots::cWebshotsPicture::SaveToFile string  file,
Webshots_Formats  format = JPG
const
 

Saves the JPEG picture to a file.

Parameters:
[in] file Complete path to the destination file
[in] format Format in which the file will be saved : JPG or WB1
Exceptions:
Exceptions::FileSystemError Thrown if the file can't be opened for writing.

Definition at line 390 of file cWebshotsPicture.cpp.

char * cWebshots::cWebshotsPicture::ThumbnailPtr  )  const
 

Returns a pointer to the thumbnail (bitmap).

Returns:
a pointer to the thumbnail

Definition at line 185 of file cWebshotsPicture.cpp.

long cWebshots::cWebshotsPicture::ThumbnailSize  )  const
 

Returns the size of the thumbnail.

Returns:
the size of the thumbnail

Definition at line 195 of file cWebshotsPicture.cpp.


Member Data Documentation

long cWebshots::cWebshotsPicture::AdditionDate
 

Date when the picture was added to the collection (if the picture is a part of a collection).

Definition at line 117 of file cWebshots.h.

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

string cWebshots::cWebshotsPicture::Album
 

Picture Album.

Definition at line 112 of file cWebshots.h.

Referenced by cWebshots::cWebshotsCollection::LoadFromFolder(), cWebshots::cWebshotsCollection::LoadWBCFile(), and cWebshots::cWebshotsCollection::SaveWBZFile().

string cWebshots::cWebshotsPicture::AlbumID
 

Category ID.

Definition at line 113 of file cWebshots.h.

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

char* cWebshots::cWebshotsPicture::BMPThumbnail [private]
 

Pointer to an array containing the BMP thumbnail (if avaible).

Definition at line 80 of file cWebshots.h.

long cWebshots::cWebshotsPicture::BMPThumbnail_Size [private]
 

Size of the BMP thumbnail.

Definition at line 81 of file cWebshots.h.

string cWebshots::cWebshotsPicture::Caption
 

Picture caption.

Definition at line 108 of file cWebshots.h.

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

string cWebshots::cWebshotsPicture::Category
 

Picture Category.

Definition at line 111 of file cWebshots.h.

Referenced by cWebshots::cWebshotsCollection::LoadFromFolder(), cWebshots::cWebshotsCollection::LoadWBCFile(), and cWebshots::cWebshotsCollection::SaveWBZFile().

string cWebshots::cWebshotsPicture::Credits
 

Picture Credits.

Definition at line 109 of file cWebshots.h.

Referenced by cWebshots::cWebshotsCollection::LoadFromFolder(), cWebshots::cWebshotsCollection::LoadWBCFile(), and cWebshots::cWebshotsCollection::SaveWBZFile().

long cWebshots::cWebshotsPicture::DailyDate
 

Date when the picture was published as the daily picture on the Webshots website.

Definition at line 116 of file cWebshots.h.

Referenced by cWebshots::cWebshotsCollection::LoadWBCFile(), and cWebshots::cWebshotsCollection::SaveWBZFile().

long cWebshots::cWebshotsPicture::ID
 

Picture ID.

Definition at line 105 of file cWebshots.h.

Referenced by cWebshots::cWebshotsCollection::LoadFromFolder(), cWebshots::cWebshotsCollection::LoadWBCFile(), and cWebshots::cWebshotsCollection::SaveWBZFile().

char* cWebshots::cWebshotsPicture::JPGFile [private]
 

Pointer to an array containing the JPG picture (if avaible).

Definition at line 78 of file cWebshots.h.

long cWebshots::cWebshotsPicture::JPGFile_Size [private]
 

Size of the JPG picture.

Definition at line 79 of file cWebshots.h.

string cWebshots::cWebshotsPicture::Original_Filename
 

Picture original filename.

Definition at line 106 of file cWebshots.h.

Referenced by cWebshots::cWebshotsCollection::LoadFromFolder(), cWebshots::cWebshotsCollection::LoadWBCFile(), and cWebshots::cWebshotsCollection::SaveWBZFile().

string cWebshots::cWebshotsPicture::Source
 

Picture source.

Definition at line 115 of file cWebshots.h.

Referenced by cWebshots::cWebshotsCollection::LoadFromFolder(), cWebshots::cWebshotsCollection::LoadWBCFile(), and cWebshots::cWebshotsCollection::SaveWBZFile().

string cWebshots::cWebshotsPicture::Title
 

Picture Title.

Definition at line 107 of file cWebshots.h.

Referenced by cWebshots::cWebshotsCollection::LoadFromFolder(), cWebshots::cWebshotsCollection::LoadWBCFile(), and cWebshots::cWebshotsCollection::SaveWBZFile().


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