LibrePCB Developers Documentation
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() [1/3]

VersionFile ( )
delete
+ Here is the caller graph for this function:

◆ VersionFile() [2/3]

VersionFile ( const VersionFile other)
default

◆ VersionFile() [3/3]

VersionFile ( const Version version)
noexcept

The constructor to create a new version file.

Parameters
versionThe file version

◆ ~VersionFile()

~VersionFile ( )
noexcept

Destructor

Member Function Documentation

◆ getVersion()

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:

◆ setVersion()

void setVersion ( const Version version)
inlinenoexcept

Set the version of the file.

Parameters
versionThe new version of the file

◆ toByteArray()

QByteArray toByteArray ( ) const
noexcept

Export file content as byte array.

+ Here is the call graph for this function:

◆ fromByteArray()

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:

◆ operator=()

VersionFile & operator= ( const VersionFile rhs)
delete

Member Data Documentation

◆ mVersion

Version mVersion
private

The version number of the file.


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