8#ifndef KUNITCONVERSION_CONVERTER_H
9#define KUNITCONVERSION_CONVERTER_H
11#include <kunitconversion/kunitconversion_export.h>
13#include "unitcategory.h"
15#include <QExplicitlySharedDataPointer>
17namespace KUnitConversion
21class ConverterPrivate;
57#ifdef Q_COMPILER_RVALUE_REFS
78#if KUNITCONVERSION_ENABLE_DEPRECATED_SINCE(5, 91)
83 KUNITCONVERSION_DEPRECATED_VERSION(5, 91,
"result is always true")
84 bool operator==(const
Converter &other) const;
90 KUNITCONVERSION_DEPRECATED_VERSION(5, 91, "result is always false")
91 bool operator!=(const
Converter &other) const;
102 Value convert(
const Value &value, UnitId toUnit)
const;
153 QExplicitlySharedDataPointer<ConverterPrivate> d;
Class for converting values between units of measurement.
Definition converter.h:35
QList< UnitCategory > categories() const
Returns a list of all unit categories.
Value convert(const Value &value, const QString &toUnit=QString()) const
Convert value to another unit.
Unit unit(UnitId unitId) const
Find unit for unit enum.
void swap(Converter &other)
Swaps this Converter with other.
Definition converter.h:73
Converter & operator=(const Converter &other)
Assignment operator, assign other to this.
Converter()
Creates a Converter instance.
~Converter()
Destroys this Converter instance.
UnitCategory categoryForUnit(const QString &unit) const
Find unit category for unit.
UnitCategory category(CategoryId categoryId) const
Find unit category.
Unit unit(const QString &unitString) const
Find unit for string unit.
UnitCategory category(const QString &category) const
Find unit category.
Converter(const Converter &other)
Copy constructor.
Class to define a category of units of measurement.
Definition unitcategory.h:35
Class to define a unit of measurement.
Definition unit.h:758
Class to hold a value in a unit of measurement.
Definition value.h:36