Oolite
Loading...
Searching...
No Matches
OOConstToString.h File Reference
import "MyOpenGLView.h"
import "OOFunctionAttributes.h"
import "OOTypes.h"
import <Foundation/Foundation.h>
Include dependency graph for OOConstToString.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  { kOOCargoTypeDefault = CARGO_NOT_CARGO , kOOEnergyUnitTypeDefault = ENERGY_UNIT_NONE , kOORouteTypeDefault = OPTIMIZED_BY_JUMPS }

Functions

NSString * JSTypeToString (int type) CONST_FUNC
NSString * CargoTypeToString (OOCargoType cargo) CONST_FUNC
OOCargoType StringToCargoType (NSString *string) PURE_FUNC
NSString * EnergyUnitTypeToString (OOEnergyUnitType unit) CONST_FUNC
OOEnergyUnitType StringToEnergyUnitType (NSString *string) PURE_FUNC
NSString * CommodityDisplayNameForSymbolicName (NSString *symbolicName)
NSString * CommodityDisplayNameForCommodityArray (NSArray *commodityDefinition)
NSString * DisplayStringForMassUnit (OOMassUnit unit)
NSString * DisplayStringForMassUnitForCommodity (OOCommodityType commodity)
NSString * OOStringFromCompassMode (OOCompassMode mode)
OOCompassMode OOCompassModeFromString (NSString *string)
NSString * OOStringFromLongRangeChartMode (OOLongRangeChartMode chartMode)
OOLongRangeChartMode OOLongRangeChartModeFromString (NSString *string)
NSString * OOStringFromLegalStatusReason (OOLegalStatusReason reason)
NSString * RouteTypeToString (OORouteType routeType)
OORouteType StringToRouteType (NSString *string)
NSString * DockingClearanceStatusToString (OODockingClearanceStatus dockingClearanceStatus) PURE_FUNC
NSString * OOStringFromGraphicsDetail (OOGraphicsDetail detail)
OOGraphicsDetail OOGraphicsDetailFromString (NSString *string)
NSString * OOStringFromHDRToneMapper (OOHDRToneMapper toneMapper)
OOHDRToneMapper OOHDRToneMapperFromString (NSString *string)
NSString * OOStringFromSDRToneMapper (OOSDRToneMapper toneMapper)
OOSDRToneMapper OOSDRToneMapperFromString (NSString *string)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kOOCargoTypeDefault 
kOOEnergyUnitTypeDefault 
kOORouteTypeDefault 

Definition at line 36 of file OOConstToString.h.

36 {
37 // Values used for unknown strings.
39 // kOOCommodityTypeDefault = COMMODITY_UNDEFINED,
42};
@ kOOCargoTypeDefault
@ kOORouteTypeDefault
@ kOOEnergyUnitTypeDefault
@ OPTIMIZED_BY_JUMPS
Definition OOTypes.h:33
@ CARGO_NOT_CARGO
Definition OOTypes.h:61
@ ENERGY_UNIT_NONE
Definition OOTypes.h:118

Function Documentation

◆ CargoTypeToString()

NSString * CargoTypeToString ( OOCargoType cargo)

Definition at line 316 of file OOConstToString.m.

317{
318 switch (cargo) {
327 }
328 return @"Unknown cargo";
329}
#define CASE(foo)
@ CARGO_RANDOM
Definition OOTypes.h:66
@ CARGO_THARGOID
Definition OOTypes.h:65
@ CARGO_CHARACTER
Definition OOTypes.h:68
@ CARGO_SLAVES
Definition OOTypes.h:62
@ CARGO_ALLOY
Definition OOTypes.h:63
@ CARGO_SCRIPTED_ITEM
Definition OOTypes.h:67
@ CARGO_MINERALS
Definition OOTypes.h:64

References CARGO_ALLOY, CARGO_CHARACTER, CARGO_MINERALS, CARGO_NOT_CARGO, CARGO_RANDOM, CARGO_SCRIPTED_ITEM, CARGO_SLAVES, CARGO_THARGOID, and CASE.

◆ CommodityDisplayNameForCommodityArray()

NSString * CommodityDisplayNameForCommodityArray ( NSArray * commodityDefinition)

Definition at line 478 of file OOConstToString.m.

479{
480 return CommodityDisplayNameForSymbolicName([commodityDefinition oo_stringAtIndex:MARKET_NAME]);
481}
NSString * CommodityDisplayNameForSymbolicName(NSString *symbolicName)
@ MARKET_NAME
Definition Universe.h:61

References CommodityDisplayNameForSymbolicName(), and MARKET_NAME.

Here is the call graph for this function:

◆ CommodityDisplayNameForSymbolicName()

NSString * CommodityDisplayNameForSymbolicName ( NSString * symbolicName)

Definition at line 472 of file OOConstToString.m.

473{
474 NSString* ret = [UNIVERSE descriptionForKey:[@"commodity-name " stringByAppendingString:[symbolicName lowercaseString]]];
475 return ret ? ret : symbolicName;
476}
#define UNIVERSE
Definition Universe.h:827

Referenced by CommodityDisplayNameForCommodityArray(), GlobalDisplayNameForCommodity(), and GlobalDisplayNameForCommodity().

Here is the caller graph for this function:

◆ DisplayStringForMassUnit()

NSString * DisplayStringForMassUnit ( OOMassUnit unit)

Definition at line 483 of file OOConstToString.m.

484{
485 switch (unit) {
486 case UNITS_TONS:
487 return DESC(@"cargo-tons-symbol");
488 case UNITS_KILOGRAMS:
489 return DESC(@"cargo-kilograms-symbol");
490 case UNITS_GRAMS:
491 return DESC(@"cargo-grams-symbol");
492 }
493
494 return @"??";
495}
@ UNITS_TONS
Definition OOTypes.h:112
@ UNITS_GRAMS
Definition OOTypes.h:114
@ UNITS_KILOGRAMS
Definition OOTypes.h:113
#define DESC(key)
Definition Universe.h:832

References DESC, UNITS_GRAMS, UNITS_KILOGRAMS, and UNITS_TONS.

Referenced by DisplayStringForMassUnitForCommodity(), and PlayerEntity(OOPrivate)::showMarketScreenDataLine:forGood:inMarket:holdQuantity:.

Here is the caller graph for this function:

◆ DisplayStringForMassUnitForCommodity()

NSString * DisplayStringForMassUnitForCommodity ( OOCommodityType commodity)

Definition at line 497 of file OOConstToString.m.

498{
499 return DisplayStringForMassUnit([[UNIVERSE commodityMarket] massUnitForGood:commodity]);
500}
NSString * DisplayStringForMassUnit(OOMassUnit unit)

References DisplayStringForMassUnit(), and UNIVERSE.

Here is the call graph for this function:

◆ DockingClearanceStatusToString()

NSString * DockingClearanceStatusToString ( OODockingClearanceStatus dockingClearanceStatus)

Definition at line 511 of file OOConstToString.m.

512{
513 switch (dockingClearanceStatus) {
519 }
520
521 return @"DOCKING_CLEARANCE_STATUS_UNKNOWN";
522}
@ DOCKING_CLEARANCE_STATUS_TIMING_OUT
Definition OOTypes.h:152
@ DOCKING_CLEARANCE_STATUS_NOT_REQUIRED
Definition OOTypes.h:149
@ DOCKING_CLEARANCE_STATUS_GRANTED
Definition OOTypes.h:151
@ DOCKING_CLEARANCE_STATUS_NONE
Definition OOTypes.h:148
@ DOCKING_CLEARANCE_STATUS_REQUESTED
Definition OOTypes.h:150

References CASE, DOCKING_CLEARANCE_STATUS_GRANTED, DOCKING_CLEARANCE_STATUS_NONE, DOCKING_CLEARANCE_STATUS_NOT_REQUIRED, DOCKING_CLEARANCE_STATUS_REQUESTED, and DOCKING_CLEARANCE_STATUS_TIMING_OUT.

Referenced by PlayerGetProperty(), and PlayerGetProperty().

Here is the caller graph for this function:

◆ EnergyUnitTypeToString()

NSString * EnergyUnitTypeToString ( OOEnergyUnitType unit)

Definition at line 349 of file OOConstToString.m.

350{
351 switch (unit) {
357
360 break;
361 }
362
363 return @"Unsupported energy unit";
364}
@ ENERGY_UNIT_NORMAL
Definition OOTypes.h:123
@ ENERGY_UNIT_NAVAL_DAMAGED
Definition OOTypes.h:120
@ ENERGY_UNIT_NAVAL
Definition OOTypes.h:124
@ OLD_ENERGY_UNIT_NORMAL
Definition OOTypes.h:121
@ OLD_ENERGY_UNIT_NAVAL
Definition OOTypes.h:122
@ ENERGY_UNIT_NORMAL_DAMAGED
Definition OOTypes.h:119

References CASE, ENERGY_UNIT_NAVAL, ENERGY_UNIT_NAVAL_DAMAGED, ENERGY_UNIT_NONE, ENERGY_UNIT_NORMAL, ENERGY_UNIT_NORMAL_DAMAGED, OLD_ENERGY_UNIT_NAVAL, and OLD_ENERGY_UNIT_NORMAL.

◆ JSTypeToString()

NSString * JSTypeToString ( int type)

Definition at line 236 of file OOConstToString.m.

237{
238 switch ((JSType)type) {
239 CASE(JSTYPE_VOID);
240 CASE(JSTYPE_OBJECT);
241 CASE(JSTYPE_FUNCTION);
242 CASE(JSTYPE_STRING);
243 CASE(JSTYPE_NUMBER);
244 CASE(JSTYPE_BOOLEAN);
245 CASE(JSTYPE_NULL);
246 CASE(JSTYPE_XML);
247 CASE(JSTYPE_LIMIT);
248 }
249 return [NSString stringWithFormat:@"unknown (%u)", type];
250}

References CASE.

◆ OOCompassModeFromString()

OOCompassMode OOCompassModeFromString ( NSString * string)

Definition at line 149 of file OOConstToString.m.

150{
151#include "OOCompassMode.tbl"
152
154}
@ kOOCompassModeDefault
Definition OOTypes.h:134

References kOOCompassModeDefault.

◆ OOGraphicsDetailFromString()

OOGraphicsDetail OOGraphicsDetailFromString ( NSString * string)

Definition at line 536 of file OOConstToString.m.

537{
542
544}
#define REVERSE_CASE(foo)
@ DETAIL_LEVEL_EXTRAS
Definition OOTypes.h:212
@ DETAIL_LEVEL_SHADERS
Definition OOTypes.h:211
@ DETAIL_LEVEL_MINIMUM
Definition OOTypes.h:209
@ DETAIL_LEVEL_NORMAL
Definition OOTypes.h:210

References DETAIL_LEVEL_EXTRAS, DETAIL_LEVEL_MINIMUM, DETAIL_LEVEL_NORMAL, DETAIL_LEVEL_SHADERS, and REVERSE_CASE.

◆ OOHDRToneMapperFromString()

OOHDRToneMapper OOHDRToneMapperFromString ( NSString * string)

Definition at line 559 of file OOConstToString.m.

References OOHDR_TONEMAPPER_ACES_APPROX, OOHDR_TONEMAPPER_DICE, OOHDR_TONEMAPPER_NONE, OOHDR_TONEMAPPER_REINHARD, OOHDR_TONEMAPPER_UCHIMURA, and REVERSE_CASE.

Referenced by MyOpenGLView::createWindowWithSize:.

Here is the caller graph for this function:

◆ OOLongRangeChartModeFromString()

OOLongRangeChartMode OOLongRangeChartModeFromString ( NSString * string)

Definition at line 184 of file OOConstToString.m.

185{
186#include "OOLongRangeChartMode.tbl"
187
189}
@ kOOLongRangeChartModeDefault
Definition OOTypes.h:48

References kOOLongRangeChartModeDefault.

Referenced by PlayerShipSetProperty(), and PlayerShipSetProperty().

Here is the caller graph for this function:

◆ OOSDRToneMapperFromString()

OOSDRToneMapper OOSDRToneMapperFromString ( NSString * string)

Definition at line 585 of file OOConstToString.m.

References OOSDR_TONEMAPPER_ACES, OOSDR_TONEMAPPER_AgX, OOSDR_TONEMAPPER_HEJLDAWSON, OOSDR_TONEMAPPER_NONE, OOSDR_TONEMAPPER_REINHARD, OOSDR_TONEMAPPER_UC2, OOSDR_TONEMAPPER_UCHIMURA, and REVERSE_CASE.

Referenced by MyOpenGLView::createWindowWithSize:.

Here is the caller graph for this function:

◆ OOStringFromCompassMode()

NSString * OOStringFromCompassMode ( OOCompassMode mode)

Definition at line 69 of file OOConstToString.m.

70{
71 switch (value) {
72#include "OOCompassMode.tbl"
73 }
74
75 return @"UNDEFINED";
76}

◆ OOStringFromGraphicsDetail()

NSString * OOStringFromGraphicsDetail ( OOGraphicsDetail detail)

Definition at line 524 of file OOConstToString.m.

525{
526 switch (detail) {
531 }
532
533 return @"DETAIL_LEVEL_UNKNOWN";
534}

References CASE, DETAIL_LEVEL_EXTRAS, DETAIL_LEVEL_MINIMUM, DETAIL_LEVEL_NORMAL, and DETAIL_LEVEL_SHADERS.

Referenced by Universe::setDetailLevel:.

Here is the caller graph for this function:

◆ OOStringFromHDRToneMapper()

NSString * OOStringFromHDRToneMapper ( OOHDRToneMapper toneMapper)

Definition at line 546 of file OOConstToString.m.

547{
548 switch (toneMapper) {
554 }
555
556 return @"OOHDR_TONEMAPPER_UNDEFINED";
557}

References CASE, OOHDR_TONEMAPPER_ACES_APPROX, OOHDR_TONEMAPPER_DICE, OOHDR_TONEMAPPER_NONE, OOHDR_TONEMAPPER_REINHARD, and OOHDR_TONEMAPPER_UCHIMURA.

Referenced by OoliteGetProperty(), and OoliteGetProperty().

Here is the caller graph for this function:

◆ OOStringFromLegalStatusReason()

NSString * OOStringFromLegalStatusReason ( OOLegalStatusReason reason)

Definition at line 123 of file OOConstToString.m.

124{
125 switch (value) {
126#include "OOLegalStatusReason.tbl"
127 }
128
129 return @"UNDEFINED";
130}

Referenced by PlayerEntity::setBounty:withReason:, and ShipEntity::setBounty:withReason:.

Here is the caller graph for this function:

◆ OOStringFromLongRangeChartMode()

NSString * OOStringFromLongRangeChartMode ( OOLongRangeChartMode chartMode)

Definition at line 78 of file OOConstToString.m.

79{
80 switch (value) {
81#include "OOLongRangeChartMode.tbl"
82 }
83
84 return @"UNDEFINED";
85}

Referenced by PlayerShipGetProperty(), and PlayerShipGetProperty().

Here is the caller graph for this function:

◆ OOStringFromSDRToneMapper()

NSString * OOStringFromSDRToneMapper ( OOSDRToneMapper toneMapper)

Definition at line 570 of file OOConstToString.m.

571{
572 switch (toneMapper) {
580 }
581
582 return @"OOSDR_TONEMAPPER_UNDEFINED";
583}

References CASE, OOSDR_TONEMAPPER_ACES, OOSDR_TONEMAPPER_AgX, OOSDR_TONEMAPPER_HEJLDAWSON, OOSDR_TONEMAPPER_NONE, OOSDR_TONEMAPPER_REINHARD, OOSDR_TONEMAPPER_UC2, and OOSDR_TONEMAPPER_UCHIMURA.

Referenced by OoliteGetProperty(), and OoliteGetProperty().

Here is the caller graph for this function:

◆ RouteTypeToString()

NSString * RouteTypeToString ( OORouteType routeType)

Definition at line 194 of file OOConstToString.m.

195{
196 switch (routeType) {
200 }
201
202 return @"** ROUTE TYPE UNKNOWN **";
203}
@ OPTIMIZED_BY_NONE
Definition OOTypes.h:32
@ OPTIMIZED_BY_TIME
Definition OOTypes.h:34

References CASE, OPTIMIZED_BY_JUMPS, OPTIMIZED_BY_NONE, and OPTIMIZED_BY_TIME.

◆ StringToCargoType()

OOCargoType StringToCargoType ( NSString * string)

Definition at line 331 of file OOConstToString.m.

332{
341
342 // Backwards compatibility.
343 if ([string isEqual:@"CARGO_CARRIED"])
344 return CARGO_RANDOM;
345
346 return kOOCargoTypeDefault;
347}

References CARGO_ALLOY, CARGO_CHARACTER, CARGO_MINERALS, CARGO_NOT_CARGO, CARGO_RANDOM, CARGO_SCRIPTED_ITEM, CARGO_SLAVES, CARGO_THARGOID, kOOCargoTypeDefault, and REVERSE_CASE.

Referenced by ShipEntity::setUpCargoType:.

Here is the caller graph for this function:

◆ StringToEnergyUnitType()

◆ StringToRouteType()

OORouteType StringToRouteType ( NSString * string)

Definition at line 502 of file OOConstToString.m.

References kOORouteTypeDefault, OPTIMIZED_BY_JUMPS, OPTIMIZED_BY_NONE, OPTIMIZED_BY_TIME, and REVERSE_CASE.

Referenced by SystemInfoRouteToSystem(), and SystemInfoRouteToSystem().

Here is the caller graph for this function: