#include <OBTPluginInformation.h>
Public Member Functions | |
PluginInformation (const char *pluginName, const char *description, unsigned int majorVersion, unsigned int minorVersion, const char *versionLabel, const char *releaseDate) | |
virtual | ~PluginInformation () |
const char * | getPluginName () const |
const char * | getDescription () const |
unsigned int | getMajorVersion () const |
unsigned int | getMinorVersion () const |
const char * | getVersionLabel () const |
const char * | getReleaseDate () const |
bool | operator< (const PluginInformation &pluginInformation) const |
bool | operator== (const PluginInformation &pluginInformation) const |
bool | operator!= (const PluginInformation &pluginInformation) const |
const char * | getCString () const |
Static Public Attributes | |
static const PluginInformation | Unknown |
"unknown" definition for missing plugin information | |
Private Attributes | |
std::string | _pluginName |
name of the plugin | |
std::string | _description |
description of the plugin | |
unsigned int | _majorVersion |
major part of the plugin version number | |
unsigned int | _minorVersion |
minor part of the plugin version number | |
std::string | _versionLabel |
label of the plugin version | |
std::string | _releaseDate |
date of plugin release |
Describes the properties of a plugin, such as the plugin name, version and release date.
Definition at line 19 of file OBTPluginInformation.h.
PluginInformation::PluginInformation | ( | const char * | pluginName, | |
const char * | description, | |||
unsigned int | majorVersion, | |||
unsigned int | minorVersion, | |||
const char * | versionLabel, | |||
const char * | releaseDate | |||
) |
constructor
Definition at line 10 of file OBTPluginInformation.cpp.
00016 : 00017 _pluginName( productName ) , 00018 _description( description ) , 00019 _majorVersion( majorVersion ) , 00020 _minorVersion( minorVersion ) , 00021 _versionLabel( versionLabel ) , 00022 _releaseDate( releaseDate ) 00023 { 00024 }
PluginInformation::~PluginInformation | ( | ) | [virtual] |
const char * OBT::PluginInformation::getPluginName | ( | ) | const [inline] |
Get the name of the plugin.
Definition at line 130 of file OBTPluginInformation.h.
References _pluginName.
00131 { 00132 return _pluginName.c_str(); 00133 }
const char * OBT::PluginInformation::getDescription | ( | ) | const [inline] |
Get the description of the plugin.
Definition at line 139 of file OBTPluginInformation.h.
References _description.
00140 { 00141 return _description.c_str() ; 00142 }
unsigned int OBT::PluginInformation::getMajorVersion | ( | ) | const [inline] |
Get the major part of the plugin version number.
Definition at line 148 of file OBTPluginInformation.h.
References _majorVersion.
Referenced by getCString(), operator!=(), operator<(), and operator==().
00149 { 00150 return _majorVersion ; 00151 }
unsigned int OBT::PluginInformation::getMinorVersion | ( | ) | const [inline] |
Get the minor part of the plugin version number.
Definition at line 157 of file OBTPluginInformation.h.
References _minorVersion.
Referenced by getCString(), operator!=(), operator<(), and operator==().
00158 { 00159 return _minorVersion ; 00160 }
const char * OBT::PluginInformation::getVersionLabel | ( | ) | const [inline] |
Get the label of the plugin version.
Definition at line 166 of file OBTPluginInformation.h.
References _versionLabel.
00167 { 00168 return _versionLabel.c_str(); 00169 }
const char * OBT::PluginInformation::getReleaseDate | ( | ) | const [inline] |
Get the release date (in a string form).
Definition at line 175 of file OBTPluginInformation.h.
References _releaseDate.
00176 { 00177 return _releaseDate.c_str(); 00178 }
bool OBT::PluginInformation::operator< | ( | const PluginInformation & | pluginInformation | ) | const [inline] |
less operator.
pluginInformation | instance to compare to this |
Definition at line 213 of file OBTPluginInformation.h.
References _majorVersion, _minorVersion, getMajorVersion(), and getMinorVersion().
00214 { 00215 if ( _majorVersion < pluginInformation.getMajorVersion() ) 00216 { 00217 return true; 00218 } 00219 else if ( _majorVersion == pluginInformation.getMajorVersion() ) 00220 { 00221 return ( _minorVersion < pluginInformation.getMinorVersion() ) ; 00222 } 00223 else 00224 { 00225 return false ; 00226 } 00227 }
bool OBT::PluginInformation::operator== | ( | const PluginInformation & | pluginInformation | ) | const [inline] |
comparison operator.
pluginInformation | instance to compare to this |
Definition at line 233 of file OBTPluginInformation.h.
References _majorVersion, _minorVersion, _versionLabel, getMajorVersion(), and getMinorVersion().
00234 { 00235 return( ( _majorVersion == pluginInformation.getMajorVersion() ) && 00236 ( _minorVersion == pluginInformation.getMinorVersion() ) && 00237 ( _versionLabel == pluginInformation._versionLabel ) ) ; 00238 }
bool OBT::PluginInformation::operator!= | ( | const PluginInformation & | pluginInformation | ) | const [inline] |
comparison operator.
pluginInformation | instance to compare to this |
Definition at line 244 of file OBTPluginInformation.h.
References _majorVersion, _minorVersion, _versionLabel, getMajorVersion(), and getMinorVersion().
00245 { 00246 return( ( _majorVersion != pluginInformation.getMajorVersion() ) || 00247 ( _minorVersion != pluginInformation.getMinorVersion() ) || 00248 ( _versionLabel != pluginInformation._versionLabel ) ) ; 00249 }
const char * OBT::PluginInformation::getCString | ( | ) | const [inline] |
C-string conversion method
Definition at line 184 of file OBTPluginInformation.h.
References _description, _pluginName, _releaseDate, _versionLabel, getMajorVersion(), and getMinorVersion().
00185 { 00186 // WARNING : not thread-safe 00187 std::string information ; 00188 std::stringstream stream ; 00189 00190 information = _pluginName ; 00191 information += " - " ; 00192 stream << getMajorVersion() ; 00193 information += stream.str() ; 00194 information += "." ; 00195 stream.clear() ; 00196 stream << getMinorVersion() ; 00197 information += stream.str() ; 00198 information += " - " ; 00199 information += _versionLabel ; 00200 information += " - " ; 00201 information += _releaseDate ; 00202 if ( !_description.empty() ) 00203 { 00204 information += " - " ; 00205 information += _description ; 00206 } 00207 return information.c_str() ; 00208 }
const PluginInformation PluginInformation::Unknown [static] |
"unknown" definition for missing plugin information
Definition at line 103 of file OBTPluginInformation.h.
Referenced by OBT::Plugin::getInformation().
std::string OBT::PluginInformation::_pluginName [private] |
name of the plugin
Definition at line 108 of file OBTPluginInformation.h.
Referenced by getCString(), and getPluginName().
std::string OBT::PluginInformation::_description [private] |
description of the plugin
Definition at line 111 of file OBTPluginInformation.h.
Referenced by getCString(), and getDescription().
unsigned int OBT::PluginInformation::_majorVersion [private] |
major part of the plugin version number
Definition at line 114 of file OBTPluginInformation.h.
Referenced by getMajorVersion(), operator!=(), operator<(), and operator==().
unsigned int OBT::PluginInformation::_minorVersion [private] |
minor part of the plugin version number
Definition at line 117 of file OBTPluginInformation.h.
Referenced by getMinorVersion(), operator!=(), operator<(), and operator==().
std::string OBT::PluginInformation::_versionLabel [private] |
label of the plugin version
Definition at line 120 of file OBTPluginInformation.h.
Referenced by getCString(), getVersionLabel(), operator!=(), and operator==().
std::string OBT::PluginInformation::_releaseDate [private] |
date of plugin release
Definition at line 123 of file OBTPluginInformation.h.
Referenced by getCString(), and getReleaseDate().