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 iContentOwner
 
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

◆ LocalStorageStatus

enum for storing information if we have file locally or not

Enumerator
FileIsLocallyStored 
FileIsNotLocallyStored 
LocalStorageStatusUnknown 

Constructor & Destructor Documentation

◆ BinaryFile()

BinaryFile::BinaryFile ( const Hash aHash)

constructor

◆ ~BinaryFile()

BinaryFile::~BinaryFile ( )

destructor

Member Function Documentation

◆ asJSon()

QByteArray BinaryFile::asJSon ( const MController aController) const

returns file data as JSon stream

◆ displayName()

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

◆ fromJSon()

bool BinaryFile::fromJSon ( const QByteArray &  aJSonBytes,
const MController aController 
)

parses json into members

Member Data Documentation

◆ iContentOwner

QString BinaryFile::iContentOwner

if someone owns the content, name or SHA1 fp

◆ iDescription

QString BinaryFile::iDescription

what is inside

◆ iFileName

QString BinaryFile::iFileName

name of the file-system file

◆ iFingerPrint

const Hash BinaryFile::iFingerPrint

file hash

◆ iIsCompressed

bool BinaryFile::iIsCompressed

needs to be in DB, not in JSon

◆ iIsEncrypted

bool BinaryFile::iIsEncrypted

◆ iLicense

QString BinaryFile::iLicense

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

◆ iLocalStorageStatus

LocalStorageStatus BinaryFile::iLocalStorageStatus

◆ iMimeType

QString BinaryFile::iMimeType

what kind of data

◆ iOwner

QString BinaryFile::iOwner

fingerprint of publisher

◆ iTimeOfPublish

quint32 BinaryFile::iTimeOfPublish

seconds since 1-jan-1970


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