Implementation of a unit conversion server using an ini-file.
More...
#include <UnitConversionServer.h>
Implementation of a unit conversion server using an ini-file.
This conversion class installs a handler using setUnitConversionHandler() using a UnitConversionServerClosure type of function.
◆ UnitSystemPair
Type to combine a system enumerate and name.
◆ EUnitSystem
Different unit conversion systems.
Enumerator |
---|
usPassThrough | No conversion use as is which should be SI-units.
|
usMetric | Conversion in the metric system depending on precision. Radials become degrees and 'm/s' can become 'km/h'.
|
usImperial | Conversion to the imperial system depending on precision. Celsius becomes Fahrenheit and 'm/s' become 'mph'.
|
◆ UnitConversionServer() [1/2]
sf::UnitConversionServer::UnitConversionServer |
( |
| ) |
|
◆ UnitConversionServer() [2/2]
Copying this class is not possible.
◆ ~UnitConversionServer()
sf::UnitConversionServer::~UnitConversionServer |
( |
| ) |
|
◆ getProfile()
IniProfile & sf::UnitConversionServer::getProfile |
( |
| ) |
|
Gets the internal storage profile.
◆ getUnitSystem()
EUnitSystem sf::UnitConversionServer::getUnitSystem |
( |
| ) |
const |
Gets the unit system being applied.
◆ getUnitSystemName()
static const char * sf::UnitConversionServer::getUnitSystemName |
( |
int |
us | ) |
|
|
static |
Gets the section name of the passed enumerate.
- Parameters
-
- Returns
- Name of the system.
◆ getUnitSystemNames()
static const std::vector< UnitSystemPair > & sf::UnitConversionServer::getUnitSystemNames |
( |
| ) |
|
|
static |
Gets all the system unit entries as a pair in a vector.
- Returns
◆ Handler()
◆ isDirty()
bool sf::UnitConversionServer::isDirty |
( |
| ) |
const |
Gets the dirty status of the configuration.
- Returns
- True when the config has been changed.
◆ load()
virtual bool sf::UnitConversionServer::load |
( |
std::istream & |
is | ) |
|
|
virtual |
◆ removeConversion()
void sf::UnitConversionServer::removeConversion |
( |
const std::string & |
key | ) |
|
Removes a conversion entry in the profile.
◆ save()
virtual bool sf::UnitConversionServer::save |
( |
std::ostream & |
os | ) |
|
|
virtual |
◆ setConversion()
Writes or over writes a conversion entry in the profile.
◆ setUnitSystem()
virtual void sf::UnitConversionServer::setUnitSystem |
( |
int |
us | ) |
|
|
virtual |
◆ _profile
Ini profile keeping all conversion information.
The documentation for this class was generated from the following file: