| 715 | } |
| 716 | |
| 717 | Unit createDimensionlessUnit(UnitSystem system) { |
| 718 | switch (system.value()) { |
| 719 | case UnitSystem::Mixed: |
| 720 | return Unit(); |
| 721 | case UnitSystem::SI: |
| 722 | return SIUnit(); |
| 723 | case UnitSystem::IP: |
| 724 | return IPUnit(); |
| 725 | case UnitSystem::BTU: |
| 726 | return BTUUnit(); |
| 727 | case UnitSystem::CFM: |
| 728 | return CFMUnit(); |
| 729 | case UnitSystem::GPD: |
| 730 | return GPDUnit(); |
| 731 | case UnitSystem::MPH: |
| 732 | return MPHUnit(); |
| 733 | case UnitSystem::Therm: |
| 734 | return ThermUnit(); |
| 735 | case UnitSystem::Wh: |
| 736 | return WhUnit(); |
| 737 | case UnitSystem::Misc1: |
| 738 | return Misc1Unit(); |
| 739 | case UnitSystem::Celsius: |
| 740 | return CelsiusUnit(); |
| 741 | case UnitSystem::Fahrenheit: |
| 742 | return FahrenheitUnit(); |
| 743 | default: |
| 744 | OS_ASSERT(false); |
| 745 | } |
| 746 | return Unit(); |
| 747 | } |
| 748 | |
| 749 | boost::optional<Unit> createUnit(const std::string& unitString, UnitSystem system) { |
| 750 | return UnitFactory::instance().createUnit(unitString, system); |
no test coverage detected