Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ProjectFormatVersion Struct Referencefinal

A structure that holds the project version. More...

#include <ProjectFormatVersion.h>

Public Member Functions

uint32_t GetPacked () const noexcept
 Returns a version packed to 32-bit integer. More...
 
bool IsValid () const noexcept
 Returns true if version is valid, i.e. Major != 0. More...
 

Static Public Member Functions

static ProjectFormatVersion FromPacked (uint32_t) noexcept
 

Public Attributes

uint8_t Major { 0 }
 
uint8_t Minor { 0 }
 
uint8_t Revision { 0 }
 
uint8_t ModLevel { 0 }
 

Detailed Description

A structure that holds the project version.

aup3 file format stores version as a 32 bit integer. This class is used for easier interop with the user_version field of the project file.

Definition at line 21 of file ProjectFormatVersion.h.

Member Function Documentation

◆ FromPacked()

ProjectFormatVersion ProjectFormatVersion::FromPacked ( uint32_t  packedVersion)
staticnoexcept

Definition at line 32 of file ProjectFormatVersion.cpp.

33{
34 return {
35 static_cast<uint8_t>((packedVersion >> 24) & 0xFF),
36 static_cast<uint8_t>((packedVersion >> 16) & 0xFF),
37 static_cast<uint8_t>((packedVersion >> 8 ) & 0xFF),
38 static_cast<uint8_t>((packedVersion ) & 0xFF),
39 };
40}

Referenced by ProjectFileIO::CheckVersion().

Here is the caller graph for this function:

◆ GetPacked()

uint32_t ProjectFormatVersion::GetPacked ( ) const
noexcept

Returns a version packed to 32-bit integer.

Definition at line 42 of file ProjectFormatVersion.cpp.

43{
44 return (Major << 24) | (Minor << 16) | (Revision << 8) | ModLevel;
45}

References Major, Minor, ModLevel, and Revision.

Referenced by ProjectFileIO::InstallSchema().

Here is the caller graph for this function:

◆ IsValid()

bool ProjectFormatVersion::IsValid ( ) const
noexcept

Returns true if version is valid, i.e. Major != 0.

Definition at line 47 of file ProjectFormatVersion.cpp.

48{
49 return Major != 0;
50}

References Major.

Member Data Documentation

◆ Major

uint8_t ProjectFormatVersion::Major { 0 }

Definition at line 23 of file ProjectFormatVersion.h.

Referenced by GetPacked(), and IsValid().

◆ Minor

uint8_t ProjectFormatVersion::Minor { 0 }

Definition at line 24 of file ProjectFormatVersion.h.

Referenced by GetPacked().

◆ ModLevel

uint8_t ProjectFormatVersion::ModLevel { 0 }

Definition at line 26 of file ProjectFormatVersion.h.

Referenced by GetPacked().

◆ Revision

uint8_t ProjectFormatVersion::Revision { 0 }

Definition at line 25 of file ProjectFormatVersion.h.

Referenced by GetPacked().


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