Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
OODebugStandards.m File Reference
+ Include dependency graph for OODebugStandards.m:

Go to the source code of this file.

Enumerations

enum  OOStandardsEnforcement { STANDARDS_ENFORCEMENT_OFF = 0 , STANDARDS_ENFORCEMENT_WARN , STANDARDS_ENFORCEMENT_ENFORCE , STANDARDS_ENFORCEMENT_QUIT }
 

Functions

void OOStandardsSetup (void)
 
void OOStandardsInternal (NSString *type, NSString *message)
 
void OOStandardsDeprecated (NSString *message)
 
void OOStandardsError (NSString *message)
 
BOOL OOEnforceStandards ()
 
void OOSetStandardsForOXPVerifierMode ()
 

Variables

static BOOL sSetup = NO
 
static OOStandardsEnforcement sEnforcement = STANDARDS_ENFORCEMENT_WARN
 

Enumeration Type Documentation

◆ OOStandardsEnforcement

Enumerator
STANDARDS_ENFORCEMENT_OFF 
STANDARDS_ENFORCEMENT_WARN 
STANDARDS_ENFORCEMENT_ENFORCE 
STANDARDS_ENFORCEMENT_QUIT 

Definition at line 49 of file OODebugStandards.m.

49 {
50// do nothing (equivalent to release build)
52// warn in log but otherwise do nothing
54// warn in log, block use of deprecated or error items
56// note in log, then exit if deprecated or error condition occurs
OOStandardsEnforcement
@ STANDARDS_ENFORCEMENT_OFF
@ STANDARDS_ENFORCEMENT_QUIT
@ STANDARDS_ENFORCEMENT_WARN
@ STANDARDS_ENFORCEMENT_ENFORCE

Function Documentation

◆ OOEnforceStandards()

BOOL OOEnforceStandards ( void )

Definition at line 114 of file OODebugStandards.m.

115{
118}
static OOStandardsEnforcement sEnforcement
void OOStandardsSetup(void)

References OOStandardsSetup(), sEnforcement, and STANDARDS_ENFORCEMENT_ENFORCE.

Referenced by OOScript::descriptionComponents, EquipmentInfoSetProperty(), LoadScriptWithName(), MissionMarkSystem(), and MissionUnmarkSystem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OOSetStandardsForOXPVerifierMode()

void OOSetStandardsForOXPVerifierMode ( void )

Definition at line 121 of file OODebugStandards.m.

122{
124 sSetup = YES;
125}
static BOOL sSetup

References sEnforcement, sSetup, and STANDARDS_ENFORCEMENT_WARN.

◆ OOStandardsDeprecated()

void OOStandardsDeprecated ( NSString * message)

Definition at line 102 of file OODebugStandards.m.

103{
104 OOStandardsInternal(@"oxp-standards.deprecated",message);
105}
void OOStandardsInternal(NSString *type, NSString *message)

References OOStandardsInternal().

Referenced by ClockGetProperty(), OOScript::descriptionComponents, EquipmentInfoSetProperty(), LoadScriptWithName(), MissionMarkSystem(), MissionUnmarkSystem(), SystemLegacyAddShips(), SystemLegacyAddShipsAt(), SystemLegacyAddShipsAtPrecisely(), SystemLegacyAddShipsWithinRadius(), SystemLegacyAddSystemShips(), and SystemLegacySpawnShip().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OOStandardsError()

void OOStandardsError ( NSString * message)

Definition at line 108 of file OODebugStandards.m.

109{
110 OOStandardsInternal(@"oxp-standards.error",message);
111}

References OOStandardsInternal().

+ Here is the call graph for this function:

◆ OOStandardsInternal()

void OOStandardsInternal ( NSString * type,
NSString * message )

Definition at line 84 of file OODebugStandards.m.

85{
88 {
89 return;
90 }
91
92 OOLog(type, @"%@", message);
93
95 {
97 // exit
98 }
99}
#define OOLog(class, format,...)
Definition OOLogging.h:88
GameController * sharedController()
void exitAppWithContext:(NSString *context)

References GameController::exitAppWithContext:, OOLog, OOStandardsSetup(), sEnforcement, GameController::sharedController, STANDARDS_ENFORCEMENT_OFF, and STANDARDS_ENFORCEMENT_QUIT.

Referenced by OOStandardsDeprecated(), and OOStandardsError().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OOStandardsSetup()

void OOStandardsSetup ( void )

Definition at line 63 of file OODebugStandards.m.

64{
65 if (sSetup)
66 {
67 return;
68 }
69 NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
70 int s = [prefs oo_intForKey:@"enforce-oxp-standards"
71 defaultValue:STANDARDS_ENFORCEMENT_WARN];
73 {
75 }
76 else if (s > STANDARDS_ENFORCEMENT_QUIT)
77 {
79 }
80 sEnforcement = s;
81}

References sEnforcement, sSetup, STANDARDS_ENFORCEMENT_OFF, and STANDARDS_ENFORCEMENT_QUIT.

Referenced by OOEnforceStandards(), and OOStandardsInternal().

+ Here is the caller graph for this function:

Variable Documentation

◆ sEnforcement

◆ sSetup

BOOL sSetup = NO
static

Definition at line 47 of file OODebugStandards.m.

Referenced by OOSetStandardsForOXPVerifierMode(), and OOStandardsSetup().