Classified ads
Public Types | Public Member Functions | Public Attributes | List of all members
BinaryFile Class Reference

Carrier-class for binary blob. More...

#include <binaryfile.h>

Collaboration diagram for BinaryFile:
Collaboration graph
[legend]

Public Types

enum  LocalStorageStatus { FileIsLocallyStored, FileIsNotLocallyStored, LocalStorageStatusUnknown }
 

Public Member Functions

 BinaryFile (const Hash &aHash)
 
 ~BinaryFile ()
 
QString displayName () const
 
QByteArray asJSon (const MController &aController) const
 
bool fromJSon (const QByteArray &aJSonBytes, const MController &aController)
 

Public Attributes

const Hash iFingerPrint
 
QString iMimeType
 
QString iDescription
 
QString iOwner
 
QString iLicense
 
QString iFileName
 
quint32 iTimeOfPublish
 
bool iIsEncrypted
 
bool iIsCompressed
 
LocalStorageStatus iLocalStorageStatus
 

Detailed Description

Carrier-class for binary blob.

Instances of this class are stored and retrieved using BinaryFileModel. Lets decide that this class carries the metadata only, actual octet-stream of the file is retrieved using a QByteArray only, there is method for that in the model.

Member Enumeration Documentation

enum for storing information if we have file locally or not

Enumerator
FileIsLocallyStored 
FileIsNotLocallyStored 
LocalStorageStatusUnknown 

Constructor & Destructor Documentation

BinaryFile::BinaryFile ( const Hash aHash)

constructor

BinaryFile::~BinaryFile ( )

destructor

Member Function Documentation

QByteArray BinaryFile::asJSon ( const MController aController) const

returns file data as JSon stream

QString BinaryFile::displayName ( ) const

method for string that is shown to user about the file. Most often could be original name from filesystem but other explanation too..

Returns
string to display to user
bool BinaryFile::fromJSon ( const QByteArray &  aJSonBytes,
const MController aController 
)

parses json into members

Member Data Documentation

QString BinaryFile::iDescription

what is inside

QString BinaryFile::iFileName

name of the file-system file

const Hash BinaryFile::iFingerPrint

file hash

bool BinaryFile::iIsCompressed

needs to be in DB, not in JSon

bool BinaryFile::iIsEncrypted
QString BinaryFile::iLicense

restriction in usage;PD or GPL or C-C or anything?

LocalStorageStatus BinaryFile::iLocalStorageStatus
QString BinaryFile::iMimeType

what kind of data

QString BinaryFile::iOwner

if someone owns the content ; most naturally this could be profile-fingerprint

quint32 BinaryFile::iTimeOfPublish

seconds since 1-jan-1970


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