LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VersionFile Class Referencefinal

Class for reading and writing version files from/to QByteArray. More...

#include <versionfile.h>

+ Collaboration diagram for VersionFile:

Public Member Functions

 VersionFile ()=delete
 
 VersionFile (const VersionFile &other)=default
 
 VersionFile (const Version &version) noexcept
 The constructor to create a new version file. More...
 
 ~VersionFile () noexcept
 
const VersiongetVersion () const noexcept
 Get the content of the file. More...
 
void setVersion (const Version &version) noexcept
 Set the version of the file. More...
 
QByteArray toByteArray () const noexcept
 Export file content as byte array. More...
 
VersionFileoperator= (const VersionFile &rhs)=delete
 

Static Public Member Functions

static VersionFile fromByteArray (const QByteArray &content)
 Load version file from byte array. More...
 

Private Attributes

Version mVersion
 The version number of the file. More...
 

Detailed Description

Class for reading and writing version files from/to QByteArray.

See File Format Versioning for details what version files are used for and how they work.

See Also
File Format Versioning

Constructor & Destructor Documentation

VersionFile ( )
delete

+ Here is the caller graph for this function:

VersionFile ( const VersionFile other)
default
VersionFile ( const Version version)
noexcept

The constructor to create a new version file.

Parameters
versionThe file version
~VersionFile ( )
noexcept

Destructor

Member Function Documentation

const Version& getVersion ( ) const
inlinenoexcept

Get the content of the file.

Returns
The version contained in the file

+ Here is the caller graph for this function:

void setVersion ( const Version version)
inlinenoexcept

Set the version of the file.

Parameters
versionThe new version of the file
QByteArray toByteArray ( ) const
noexcept

Export file content as byte array.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VersionFile fromByteArray ( const QByteArray &  content)
static

Load version file from byte array.

Parameters
contentThe raw file content
Returns
A new VersionFile object
Exceptions
Exceptionif the content is invalid

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VersionFile& operator= ( const VersionFile rhs)
delete

Member Data Documentation

Version mVersion
private

The version number of the file.


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