xoreos  0.0.5
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Engines::KotOR::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 KotOR installation in this directory. More...
 
bool hasVersion () const
 Did we detect a version? More...
 
Aurora::Platform getPlatform () const
 
Common::UString getPlatformName () const
 
uint16 getVersionMajor () const
 Return the major version. More...
 
uint16 getVersionMinor () const
 Return the minor version. More...
 
uint32 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...
 
uint16 getOptimumVersionMajor () const
 Return the optimum major version. More...
 
uint16 getOptimumVersionMinor () const
 Return the optimum minor version. More...
 
Common::UString getOptimumVersionString ()
 

Private Member Functions

bool detectWindows (const Common::UString &directory)
 
bool detectMacOSX (const Common::UString &directory)
 
bool detectXbox (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.03.514078 -> 1 More...
 
uint16 _versionMinor
 v1.03.514078 -> 3 More...
 
uint32 _versionBuild
 v1.03.514078 -> 514078 More...
 

Detailed Description

Definition at line 40 of file version.h.

Constructor & Destructor Documentation

◆ Version()

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

Definition at line 47 of file version.cpp.

◆ ~Version()

Engines::KotOR::Version::~Version ( )

Definition at line 52 of file version.cpp.

Member Function Documentation

◆ detect()

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

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

Definition at line 133 of file version.cpp.

References _platform, _versionBuild, _versionMajor, _versionMinor, detectMacOSX(), detectWindows(), detectXbox(), Aurora::kPlatformMacOSX, Aurora::kPlatformWindows, and Aurora::kPlatformXbox.

Here is the call graph for this function:

◆ detectMacOSX()

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

Definition at line 242 of file version.cpp.

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

Referenced by detect().

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

◆ detectWindows()

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

Definition at line 153 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:

◆ detectXbox()

bool Engines::KotOR::Version::detectXbox ( const Common::UString directory)
private

Definition at line 316 of file version.cpp.

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

Referenced by detect().

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

◆ getOptimumVersionMajor()

uint16 Engines::KotOR::Version::getOptimumVersionMajor ( ) const

Return the optimum major version.

Definition at line 83 of file version.cpp.

References _platform, Aurora::kPlatformMacOSX, Aurora::kPlatformWindows, and Aurora::kPlatformXbox.

Referenced by getOptimumVersionString(), isTooNew(), and isTooOld().

Here is the caller graph for this function:

◆ getOptimumVersionMinor()

uint16 Engines::KotOR::Version::getOptimumVersionMinor ( ) const

Return the optimum minor version.

Definition at line 97 of file version.cpp.

References _platform, Aurora::kPlatformMacOSX, Aurora::kPlatformWindows, and Aurora::kPlatformXbox.

Referenced by getOptimumVersionString(), isTooNew(), and isTooOld().

Here is the caller graph for this function:

◆ getOptimumVersionString()

Common::UString Engines::KotOR::Version::getOptimumVersionString ( )

Definition at line 113 of file version.cpp.

References Common::UString::format(), getOptimumVersionMajor(), and getOptimumVersionMinor().

Here is the call graph for this function:

◆ getPlatform()

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

Definition at line 59 of file version.cpp.

References _platform.

Referenced by Engines::KotOR::MainMenu::MainMenu().

Here is the caller graph for this function:

◆ getPlatformName()

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

Definition at line 63 of file version.cpp.

References _platform, and Aurora::getPlatformDescription().

Here is the call graph for this function:

◆ getVersionBuild()

uint32 Engines::KotOR::Version::getVersionBuild ( ) const

Return the build number.

Definition at line 75 of file version.cpp.

References _versionBuild.

◆ getVersionMajor()

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

Return the major version.

Definition at line 67 of file version.cpp.

References _versionMajor.

◆ getVersionMinor()

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

Return the minor version.

Definition at line 71 of file version.cpp.

References _versionMinor.

◆ getVersionString()

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

Definition at line 79 of file version.cpp.

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

Referenced by Engines::KotOR::OptionsMenu::OptionsMenu().

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

◆ hasVersion()

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

Did we detect a version?

Definition at line 55 of file version.cpp.

References _versionBuild, _versionMajor, and _versionMinor.

Referenced by Engines::KotOR::OptionsMenu::OptionsMenu().

Here is the caller graph for this function:

◆ isTooNew()

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

Is this version newer than the optimum?

Definition at line 127 of file version.cpp.

References _versionMajor, _versionMinor, getOptimumVersionMajor(), getOptimumVersionMinor(), and Engines::KotOR::makeCombinedVersion().

Here is the call graph for this function:

◆ isTooOld()

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

Is this version older than the optimum?

Definition at line 122 of file version.cpp.

References _versionMajor, _versionMinor, getOptimumVersionMajor(), getOptimumVersionMinor(), and Engines::KotOR::makeCombinedVersion().

Here is the call graph for this function:

◆ readFile() [1/2]

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

Definition at line 370 of file version.cpp.

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

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

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

◆ readFile() [2/2]

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

Member Data Documentation

◆ _platform

Aurora::Platform Engines::KotOR::Version::_platform
private

◆ _versionBuild

uint32 Engines::KotOR::Version::_versionBuild
private

v1.03.514078 -> 514078

Definition at line 74 of file version.h.

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

◆ _versionMajor

uint16 Engines::KotOR::Version::_versionMajor
private

v1.03.514078 -> 1

Definition at line 72 of file version.h.

Referenced by detect(), detectMacOSX(), detectWindows(), detectXbox(), getVersionMajor(), getVersionString(), hasVersion(), isTooNew(), and isTooOld().

◆ _versionMinor

uint16 Engines::KotOR::Version::_versionMinor
private

v1.03.514078 -> 3

Definition at line 73 of file version.h.

Referenced by detect(), detectMacOSX(), detectWindows(), detectXbox(), getVersionMinor(), getVersionString(), hasVersion(), isTooNew(), and isTooOld().


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