#include <metadata.h>
Collaboration diagram for MetaData:

By default none of the memory-heavy structures are created - they are stored as smart pointers.
This class also submits events when file names, hashests and so on are added to it. Refer to MDEvt documentation on event types submitted from this class, and EventTable documentation on how to handle events.
The objects of this class are owned by MetaDb and the destructor has been protected. As such, you cannot create MetaData objects on stack, and if you create them on heap, you MUST submit them to MetaDb because you are not able to delete them yourself.
Definition at line 443 of file metadata.h.
Public Member Functions | |
| DECLARE_EVENT_TABLE (MetaData *, int) | |
| MetaData (uint64_t fileSize, FileType type=FT_UNKNOWN, bool typeGuessed=true) | |
| Constructor. | |
| MetaData (std::istream &ifs) | |
| Construct by reading data from input stream. | |
| MetaData () | |
| Default constructor. | |
| ~MetaData () | |
| Destructor is exposed to allow more generic usage of the object. | |
Setters | |
| void | addVideoData (VideoMetaData *vmd) |
| void | addAudioData (AudioMetaData *amd) |
| void | setArchiveData (ArchiveMetaData *amd) |
| void | setImageData (ImageMetaData *imd) |
| void | addFileName (const std::string &name) |
| void | addHashSet (HashSetBase *hashset) |
| void | setFileSize (uint64_t size) |
| void | setModDate (uint32_t date) |
| void | setFileType (FileType type) |
| void | setTypeGuessed (bool guessed) |
Getters | |
| uint32_t | getVideoDataCount () const |
| VideoMetaData *const | getVideoData (uint32_t num) |
| uint32_t | getAudioDataCount () const |
| AudioMetaData *const | getAudioData (uint32_t num) const |
| ArchiveMetaData *const | getArchiveData () const |
| ImageMetaData *const | getImageData () const |
| uint32_t | getHashSetCount () const |
| HashSetBase *const | getHashSet (uint32_t num) const |
| uint32_t | getFileNameCount () const |
| std::string | getFileName (uint32_t num) const |
| uint64_t | getFileSize () const |
| uint32_t | getModDate () const |
| FileType | getFileType () const |
| bool | getTypeGuessed () const |
Private Types | |
| typedef std::vector< VideoMetaData * >::const_iterator | CVMDIter |
| typedef std::vector< AudioMetaData * >::const_iterator | CAMDIter |
| typedef std::vector< HashSetBase * >::const_iterator | CHIter |
Private Member Functions | |
| MetaData (const MetaData &md) | |
| Copy construct forbidden. | |
| MetaData & | operator= (const MetaData &) |
| Assignment forbidden. | |
Private Attributes | |
| std::vector< VideoMetaData * > | m_videoData |
| Video data streams. | |
| std::vector< AudioMetaData * > | m_audioData |
| Audio data streams. | |
| ArchiveMetaData * | m_archiveData |
| Archive data. | |
| ImageMetaData * | m_imageData |
| Image data. | |
| std::vector< HashSetBase * > | m_hashsets |
| Hash sets. | |
| std::vector< std::string > | m_fileNames |
| All known file names. | |
| uint64_t | m_fileSize |
| File size. | |
| uint32_t | m_modDate |
| File modification date. | |
| FileType | m_fileType |
| File type. | |
| bool | m_typeGuessed |
| If type was guessed. | |
Friends | |
| std::ostream & | operator<< (std::ostream &o, const MetaData &md) |
| Output operator for streams. | |
|
|
Definition at line 559 of file metadata.h. |
|
|
Definition at line 569 of file metadata.h. |
|
|
Definition at line 555 of file metadata.h. |
|
||||||||||||||||
|
Constructor.
Definition at line 716 of file metadata.cpp. |
|
|
Construct by reading data from input stream.
Definition at line 726 of file metadata.cpp. References FT_UNKNOWN, CGComm::loadHashSet(), logError(), logTrace(), logWarning(), m_archiveData, m_audioData, m_fileNames, m_fileSize, m_fileType, m_hashsets, m_imageData, m_modDate, m_typeGuessed, m_videoData, CGComm::OP_AMD, CGComm::OP_ARMD, CGComm::OP_HASHSET, CGComm::OP_IMD, CGComm::OP_MD_FILENAME, CGComm::OP_MD_FILESIZE, CGComm::OP_MD_FILETYPE, CGComm::OP_MD_MODDATE, CGComm::OP_MD_TYPEGUESSED, CGComm::OP_VMD, and TRACE_MD. |
Here is the call graph for this function:

|
|
Default constructor.
Definition at line 722 of file metadata.cpp. References FT_UNKNOWN. |
|
|
Destructor is exposed to allow more generic usage of the object. While the main purpose of this object was to remain hidden inside MetaDb and owned only by MetaDb, practice has shown this object is useful outside the MetaDb context also, and thus the destructor has been exposed. This does open a possibility of abuse though by objects using MetaData pointers given out by MetaDb. Definition at line 822 of file metadata.cpp. References m_archiveData, m_audioData, m_hashsets, m_imageData, and m_videoData. |
|
|
Copy construct forbidden.
|
|
|
Definition at line 479 of file metadata.h. References MD_ADDED_AUDIO. |
|
|
Definition at line 491 of file metadata.h. References MD_ADDED_FILENAME. Referenced by HashWork::finish(). |
|
|
Definition at line 495 of file metadata.h. References MD_ADDED_HASHSET. Referenced by HashWork::finish(). |
|
|
Definition at line 475 of file metadata.h. References MD_ADDED_VIDEO. |
|
||||||||||||
|
|
|
|
Definition at line 519 of file metadata.h. |
|
|
Definition at line 515 of file metadata.h. |
|
|
Definition at line 514 of file metadata.h. |
|
|
Definition at line 539 of file metadata.h. Referenced by PartData::onHashEvent(), and MetaDb::onSharedFileEvent(). |
|
|
Definition at line 538 of file metadata.h. |
|
|
Definition at line 543 of file metadata.h. Referenced by PartData::onHashEvent(). |
|
|
Definition at line 545 of file metadata.h. |
|
|
Definition at line 534 of file metadata.h. Referenced by HashWork::finish(), SharedFile::isDuplicate(), PartData::onHashEvent(), MetaDb::onSharedFileEvent(), PartData::setMetaData(), and PartData::verifyHashSet(). |
|
|
Definition at line 533 of file metadata.h. |
|
|
Definition at line 526 of file metadata.h. |
|
|
Definition at line 544 of file metadata.h. Referenced by SharedFile::read(). |
|
|
Definition at line 546 of file metadata.h. |
|
|
Definition at line 510 of file metadata.h. |
|
|
Definition at line 509 of file metadata.h. |
|
|
Assignment forbidden.
|
|
|
Definition at line 483 of file metadata.h. References MD_ADDED_ARCHIVE. |
|
|
Definition at line 499 of file metadata.h. Referenced by SharedFile::checkFileSize(). |
|
|
Definition at line 501 of file metadata.h. |
|
|
Definition at line 487 of file metadata.h. References MD_ADDED_IMAGE. |
|
|
Definition at line 500 of file metadata.h. Referenced by HashWork::finish(), PartData::flushBuffer(), SharedFile::setLocation(), and SharedFile::updateModDate(). |
|
|
Definition at line 502 of file metadata.h. |
|
||||||||||||
|
Output operator for streams.
Definition at line 843 of file metadata.cpp. |
|
|
Archive data.
Definition at line 562 of file metadata.h. Referenced by MetaData(), and ~MetaData(). |
|
|
Audio data streams.
Definition at line 558 of file metadata.h. Referenced by MetaData(), and ~MetaData(). |
|
|
All known file names.
Definition at line 571 of file metadata.h. Referenced by MetaData(). |
|
|
File size.
Definition at line 572 of file metadata.h. Referenced by MetaData(). |
|
|
File type.
Definition at line 574 of file metadata.h. Referenced by MetaData(). |
|
|
Hash sets.
Definition at line 568 of file metadata.h. Referenced by MetaData(), and ~MetaData(). |
|
|
Image data.
Definition at line 565 of file metadata.h. Referenced by MetaData(), and ~MetaData(). |
|
|
File modification date.
Definition at line 573 of file metadata.h. Referenced by MetaData(). |
|
|
If type was guessed.
Definition at line 575 of file metadata.h. Referenced by MetaData(). |
|
|
Video data streams.
Definition at line 554 of file metadata.h. Referenced by MetaData(), and ~MetaData(). |