xoreos  0.0.5
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Engines::NWN::Version Class Reference

#include <version.h>

Public Member Functions

 Version (Aurora::Platform platform)
 
 ~Version ()
 
bool detect (const Common::UString &directory)
 Try to detect the version of the NWN installation in this directory. More...
 
bool hasVersion () const
 Did we detect a version? More...
 
Aurora::Platform getPlatform () const
 
Common::UString getPlatformName () const
 
uint64 getVersion () const
 Return the combined version. More...
 
uint16 getVersionMajor () const
 Return the major version. More...
 
uint16 getVersionMinor () const
 Return the minor version. More...
 
uint16 getVersionBuild () const
 Return the build number. More...
 
Common::UString getVersionString () const
 
bool isTooOld () const
 Is this version older than the optimum? More...
 
bool isTooNew () const
 Is this version newer than the optimum? More...
 

Static Public Member Functions

static uint64 getOptimumVersion ()
 Return the optimum combined version. More...
 
static uint16 getOptimumVersionMajor ()
 Return the optimum major version. More...
 
static uint16 getOptimumVersionMinor ()
 Return the optimum minor version. More...
 
static uint16 getOptimumVersionBuild ()
 Return the optimum build number. More...
 
static Common::UString getOptimumVersionString ()
 

Private Member Functions

bool detectWindows (const Common::UString &directory)
 
bool detectMacOSX (const Common::UString &directory)
 
bool detectLinux (const Common::UString &directory)
 
bytereadFile (const Common::UString &directory, const Common::UString &file, size_t &size)
 
bytereadFile (const Common::UString &path, size_t &size)
 

Private Attributes

Aurora::Platform _platform
 
uint16 _versionMajor
 v1.69.8109 -> 1 More...
 
uint16 _versionMinor
 v1.69.8109 -> 69 More...
 
uint16 _versionBuild
 v1.69.8109 -> 8109 More...
 
uint64 _version
 The combined version number. More...
 

Static Private Attributes

static const uint16 kOptimumVersionMajor = 1
 
static const uint16 kOptimumVersionMinor = 69
 
static const uint16 kOptimumVersionBuild = 8109
 

Detailed Description

Definition at line 40 of file version.h.

Constructor & Destructor Documentation

◆ Version()

Engines::NWN::Version::Version ( Aurora::Platform  platform)

Definition at line 58 of file version.cpp.

◆ ~Version()

Engines::NWN::Version::~Version ( )

Definition at line 63 of file version.cpp.

Member Function Documentation

◆ detect()

bool Engines::NWN::Version::detect ( const Common::UString directory)

Try to detect the version of the NWN installation in this directory.

Definition at line 130 of file version.cpp.

References _platform, _version, _versionBuild, _versionMajor, _versionMinor, detectLinux(), detectMacOSX(), detectWindows(), Aurora::kPlatformLinux, Aurora::kPlatformMacOSX, Aurora::kPlatformWindows, and MAKE_NWN_VERSION.

Here is the call graph for this function:

◆ detectLinux()

bool Engines::NWN::Version::detectLinux ( const Common::UString directory)
private

Definition at line 283 of file version.cpp.

References _versionBuild, _versionMajor, _versionMinor, Common::ScopedPtrBase< T, Deallocator >::get(), kVersionUnix, and readFile().

Referenced by detect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ detectMacOSX()

bool Engines::NWN::Version::detectMacOSX ( const Common::UString directory)
private

Definition at line 224 of file version.cpp.

References _versionBuild, _versionMajor, _versionMinor, Common::UString::empty(), Common::FilePath::findSubDirectory(), Common::ScopedPtrBase< T, Deallocator >::get(), kVersionUnix, and readFile().

Referenced by detect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ detectWindows()

bool Engines::NWN::Version::detectWindows ( const Common::UString directory)
private

Definition at line 149 of file version.cpp.

References _versionBuild, _versionMajor, _versionMinor, Common::ScopedPtrBase< T, Deallocator >::get(), kBuildWin, kVersionWin, and readFile().

Referenced by detect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOptimumVersion()

uint64 Engines::NWN::Version::getOptimumVersion ( )
static

Return the optimum combined version.

Definition at line 98 of file version.cpp.

References kOptimumVersionBuild, kOptimumVersionMajor, kOptimumVersionMinor, and MAKE_NWN_VERSION.

Referenced by isTooNew(), and isTooOld().

Here is the caller graph for this function:

◆ getOptimumVersionBuild()

uint16 Engines::NWN::Version::getOptimumVersionBuild ( )
static

Return the optimum build number.

Definition at line 110 of file version.cpp.

References kOptimumVersionBuild.

◆ getOptimumVersionMajor()

uint16 Engines::NWN::Version::getOptimumVersionMajor ( )
static

Return the optimum major version.

Definition at line 102 of file version.cpp.

References kOptimumVersionMajor.

◆ getOptimumVersionMinor()

uint16 Engines::NWN::Version::getOptimumVersionMinor ( )
static

Return the optimum minor version.

Definition at line 106 of file version.cpp.

References kOptimumVersionMinor.

◆ getOptimumVersionString()

Common::UString Engines::NWN::Version::getOptimumVersionString ( )
static

Definition at line 114 of file version.cpp.

References Common::UString::format(), kOptimumVersionBuild, kOptimumVersionMajor, and kOptimumVersionMinor.

Here is the call graph for this function:

◆ getPlatform()

Aurora::Platform Engines::NWN::Version::getPlatform ( ) const

Definition at line 70 of file version.cpp.

References _platform.

◆ getPlatformName()

Common::UString Engines::NWN::Version::getPlatformName ( ) const

Definition at line 74 of file version.cpp.

References _platform, and Aurora::getPlatformDescription().

Here is the call graph for this function:

◆ getVersion()

uint64 Engines::NWN::Version::getVersion ( ) const

Return the combined version.

Definition at line 78 of file version.cpp.

References _version.

◆ getVersionBuild()

uint16 Engines::NWN::Version::getVersionBuild ( ) const

Return the build number.

Definition at line 90 of file version.cpp.

References _versionBuild.

◆ getVersionMajor()

uint16 Engines::NWN::Version::getVersionMajor ( ) const

Return the major version.

Definition at line 82 of file version.cpp.

References _versionMajor.

◆ getVersionMinor()

uint16 Engines::NWN::Version::getVersionMinor ( ) const

Return the minor version.

Definition at line 86 of file version.cpp.

References _versionMinor.

◆ getVersionString()

Common::UString Engines::NWN::Version::getVersionString ( ) const

Definition at line 94 of file version.cpp.

References _versionBuild, _versionMajor, _versionMinor, and Common::UString::format().

Referenced by Engines::NWN::IngameMainMenu::initWidget(), and Engines::NWN::OptionsMenu::initWidget().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasVersion()

bool Engines::NWN::Version::hasVersion ( ) const

Did we detect a version?

Definition at line 66 of file version.cpp.

References _version.

Referenced by Engines::NWN::OptionsMenu::initWidget().

Here is the caller graph for this function:

◆ isTooNew()

bool Engines::NWN::Version::isTooNew ( ) const

Is this version newer than the optimum?

Definition at line 123 of file version.cpp.

References _version, and getOptimumVersion().

Here is the call graph for this function:

◆ isTooOld()

bool Engines::NWN::Version::isTooOld ( ) const

Is this version older than the optimum?

Definition at line 119 of file version.cpp.

References _version, and getOptimumVersion().

Here is the call graph for this function:

◆ readFile() [1/2]

byte * Engines::NWN::Version::readFile ( const Common::UString directory,
const Common::UString file,
size_t &  size 
)
private

Definition at line 331 of file version.cpp.

References Common::FileList::addDirectory(), and Common::FileList::findFirst().

Referenced by detectLinux(), detectMacOSX(), and detectWindows().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readFile() [2/2]

byte * Engines::NWN::Version::readFile ( const Common::UString path,
size_t &  size 
)
private

Member Data Documentation

◆ _platform

Aurora::Platform Engines::NWN::Version::_platform
private

Definition at line 77 of file version.h.

Referenced by detect(), getPlatform(), and getPlatformName().

◆ _version

uint64 Engines::NWN::Version::_version
private

The combined version number.

Definition at line 82 of file version.h.

Referenced by detect(), getVersion(), hasVersion(), isTooNew(), and isTooOld().

◆ _versionBuild

uint16 Engines::NWN::Version::_versionBuild
private

v1.69.8109 -> 8109

Definition at line 81 of file version.h.

Referenced by detect(), detectLinux(), detectMacOSX(), detectWindows(), getVersionBuild(), and getVersionString().

◆ _versionMajor

uint16 Engines::NWN::Version::_versionMajor
private

v1.69.8109 -> 1

Definition at line 79 of file version.h.

Referenced by detect(), detectLinux(), detectMacOSX(), detectWindows(), getVersionMajor(), and getVersionString().

◆ _versionMinor

uint16 Engines::NWN::Version::_versionMinor
private

v1.69.8109 -> 69

Definition at line 80 of file version.h.

Referenced by detect(), detectLinux(), detectMacOSX(), detectWindows(), getVersionMinor(), and getVersionString().

◆ kOptimumVersionBuild

const uint16 Engines::NWN::Version::kOptimumVersionBuild = 8109
staticprivate

Definition at line 75 of file version.h.

Referenced by getOptimumVersion(), getOptimumVersionBuild(), and getOptimumVersionString().

◆ kOptimumVersionMajor

const uint16 Engines::NWN::Version::kOptimumVersionMajor = 1
staticprivate

Definition at line 73 of file version.h.

Referenced by getOptimumVersion(), getOptimumVersionMajor(), and getOptimumVersionString().

◆ kOptimumVersionMinor

const uint16 Engines::NWN::Version::kOptimumVersionMinor = 69
staticprivate

Definition at line 74 of file version.h.

Referenced by getOptimumVersion(), getOptimumVersionMinor(), and getOptimumVersionString().


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