Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
OOStringExpander.h File Reference
import "OOCocoa.h"
import "OOMaths.h"
+ Include dependency graph for OOStringExpander.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OOExpand(string, ...)
 
#define OOExpandKey(key, ...)
 
#define OOExpandKeyRandomized(key, ...)
 
#define OOExpandWithSeed(seed, string, ...)
 
#define OOExpandKeyWithSeed(seed, key, ...)
 
#define OOExpandWithOptions(seed, options, string, ...)
 
#define OOEXPAND_ARG_DICTIONARY(...)
 
#define OOEXPAND_NAME_FROM_ARG(ITEM)
 
#define OOEXPAND_NAMES_FROM_ARGS(...)
 
#define OOEXPAND_OBJECTS_FROM_ARGS(...)
 
#define OO_CAST_PARAMETER(ITEM)
 
#define OOEXPAND_IS_OBJECT(ITEM)
 
#define OOEXPAND_IS_SIGNED_INTEGER(ITEM)
 
#define OOEXPAND_IS_UNSIGNED_INTEGER(ITEM)
 
#define OOEXPAND_IS_FLOAT(ITEM)
 
#define OOEXPAND_IS_DOUBLE(ITEM)
 
#define OOEXPAND_ARGUMENT_COUNT(...)
 
#define OOEXPAND_ARGUMENT_COUNT_INNER(...)
 
#define OOEXPAND_ARGUMENT_COUNT_EXTRACT_64TH_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, N, ...)
 
#define OOEXPAND_ARGUMENT_COUNT_63_VALUES()
 
#define OOEXPAND_MAP(F, ...)
 
#define OOEXPAND_MAP_INNER(F, COUNTEXPR, ...)
 
#define OOEXPAND_MAP_INNER2(F, COUNT, ...)
 
#define OOEXPAND_MAP_INNER3(F, IMPL, ...)
 
#define OOEXPAND_MAP_IMPL_0(F, HEAD)
 
#define OOEXPAND_MAP_IMPL_1(F, HEAD)
 
#define OOEXPAND_MAP_IMPL_2(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_3(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_4(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_5(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_6(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_7(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_8(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_9(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_10(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_11(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_12(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_13(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_14(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_15(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_16(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_17(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_18(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_19(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_20(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_21(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_22(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_23(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_24(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_25(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_26(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_27(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_28(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_29(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_30(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_31(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_32(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_33(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_34(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_35(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_36(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_37(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_38(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_39(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_40(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_41(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_42(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_43(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_44(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_45(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_46(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_47(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_48(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_49(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_50(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_51(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_52(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_53(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_54(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_55(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_56(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_57(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_58(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_59(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_60(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_61(F, HEAD, ...)
 
#define OOEXPAND_MAP_IMPL_62(F, HEAD, ...)
 

Typedefs

typedef NSUInteger OOExpandOptions
 

Enumerations

enum  {
  kOOExpandForJavaScript = 0x00000001 , kOOExpandBackslashN = 0x00000002 , kOOExpandGoodRNG = 0x00000004 , kOOExpandReseedRNG = 0x00000008 ,
  kOOExpandKey = 0x00000010 , kOOExpandDisallowPercentI = 0x00000020 , kOOExpandNoOptions = 0
}
 

Functions

NSString * OOExpandDescriptionString (Random_Seed seed, NSString *string, NSDictionary *overrides, NSDictionary *legacyLocals, NSString *systemName, OOExpandOptions options)
 
NSString * OOGenerateSystemDescription (Random_Seed seed, NSString *name)
 
Random_Seed OOStringExpanderDefaultRandomSeed (void)
 
static id OOCastParamObject (id object)
 
static id OOCastParamSignedInteger (long long value)
 
static id OOCastParamUnsignedInteger (unsigned long long value)
 
static id OOCastParamFloat (float value)
 
static id OOCastParamDouble (double value)
 

Macro Definition Documentation

◆ OO_CAST_PARAMETER

#define OO_CAST_PARAMETER ( ITEM)
Value:
__builtin_choose_expr( \
__builtin_choose_expr( \
__builtin_choose_expr( \
__builtin_choose_expr( \
__builtin_choose_expr( \
__builtin_choose_expr( \
(void)0 \
) \
) \
) \
) \
) \
)(ITEM)
#define OOEXPAND_IS_OBJECT(ITEM)
static id OOCastParamFloat(float value)
static id OOCastParamObject(id object)
#define OOEXPAND_IS_FLOAT(ITEM)
#define OOEXPAND_IS_UNSIGNED_INTEGER(ITEM)
#define OOEXPAND_IS_SIGNED_INTEGER(ITEM)
#define OOEXPAND_IS_DOUBLE(ITEM)
static id OOCastParamUnsignedInteger(unsigned long long value)
static id OOCastParamSignedInteger(long long value)
static id OOCastParamDouble(double value)

Definition at line 178 of file OOStringExpander.h.

178#define OO_CAST_PARAMETER(ITEM) \
179 __builtin_choose_expr( \
180 OOEXPAND_IS_OBJECT(ITEM), \
181 OOCastParamObject, \
182 __builtin_choose_expr( \
183 OOEXPAND_IS_SIGNED_INTEGER(ITEM), \
184 OOCastParamSignedInteger, \
185 __builtin_choose_expr( \
186 OOEXPAND_IS_UNSIGNED_INTEGER(ITEM), \
187 OOCastParamUnsignedInteger, \
188 __builtin_choose_expr( \
189 OOEXPAND_IS_FLOAT(ITEM), \
190 OOCastParamFloat, \
191 __builtin_choose_expr( \
192 OOEXPAND_IS_UNSIGNED_INTEGER(ITEM), \
193 OOCastParamUnsignedInteger, \
194 __builtin_choose_expr( \
195 OOEXPAND_IS_DOUBLE(ITEM), \
196 OOCastParamDouble, \
197 (void)0 \
198 ) \
199 ) \
200 ) \
201 ) \
202 ) \
203 )(ITEM)

◆ OOExpand

#define OOExpand ( string,
... )
Value:
Random_Seed OOStringExpanderDefaultRandomSeed(void)
#define OOExpandWithSeed(seed, string,...)

Expand a string with default options.

Definition at line 127 of file OOStringExpander.h.

Referenced by GlobalRandomName(), OOShipLibraryCategoryPlural(), and OOShipLibraryCategorySingular().

◆ OOEXPAND_ARG_DICTIONARY

#define OOEXPAND_ARG_DICTIONARY ( ...)
Value:
( \
(OOEXPAND_ARGUMENT_COUNT(__VA_ARGS__) == 0) ? \
nil : \
[NSDictionary dictionaryWithObjects:OOEXPAND_OBJECTS_FROM_ARGS(__VA_ARGS__) \
forKeys:OOEXPAND_NAMES_FROM_ARGS(__VA_ARGS__) \
unsigned count
return nil
#define OOEXPAND_ARGUMENT_COUNT(...)
#define OOEXPAND_OBJECTS_FROM_ARGS(...)
#define OOEXPAND_NAMES_FROM_ARGS(...)

Definition at line 161 of file OOStringExpander.h.

161#define OOEXPAND_ARG_DICTIONARY(...) ( \
162 (OOEXPAND_ARGUMENT_COUNT(__VA_ARGS__) == 0) ? \
163 nil : \
164 [NSDictionary dictionaryWithObjects:OOEXPAND_OBJECTS_FROM_ARGS(__VA_ARGS__) \
165 forKeys:OOEXPAND_NAMES_FROM_ARGS(__VA_ARGS__) \
166 count:OOEXPAND_ARGUMENT_COUNT(__VA_ARGS__)] )

◆ OOEXPAND_ARGUMENT_COUNT

#define OOEXPAND_ARGUMENT_COUNT ( ...)
Value:
#define OOEXPAND_ARGUMENT_COUNT_63_VALUES()
#define OOEXPAND_ARGUMENT_COUNT_INNER(...)

Definition at line 270 of file OOStringExpander.h.

270#define OOEXPAND_ARGUMENT_COUNT(...) \
271 OOEXPAND_ARGUMENT_COUNT_INNER(_0, ##__VA_ARGS__, OOEXPAND_ARGUMENT_COUNT_63_VALUES())

◆ OOEXPAND_ARGUMENT_COUNT_63_VALUES

#define OOEXPAND_ARGUMENT_COUNT_63_VALUES ( )
Value:
62,61,60, \
59,58,57,56,55,54,53,52,51,50, \
49,48,47,46,45,44,43,42,41,40, \
39,38,37,36,35,34,33,32,31,30, \
29,28,27,26,25,24,23,22,21,20, \
19,18,17,16,15,14,13,12,11,10, \
9,8,7,6,5,4,3,2,1,0

Definition at line 282 of file OOStringExpander.h.

282#define OOEXPAND_ARGUMENT_COUNT_63_VALUES() \
283 62,61,60, \
284 59,58,57,56,55,54,53,52,51,50, \
285 49,48,47,46,45,44,43,42,41,40, \
286 39,38,37,36,35,34,33,32,31,30, \
287 29,28,27,26,25,24,23,22,21,20, \
288 19,18,17,16,15,14,13,12,11,10, \
289 9,8,7,6,5,4,3,2,1,0

◆ OOEXPAND_ARGUMENT_COUNT_EXTRACT_64TH_ARG

#define OOEXPAND_ARGUMENT_COUNT_EXTRACT_64TH_ARG ( _1,
_2,
_3,
_4,
_5,
_6,
_7,
_8,
_9,
_10,
_11,
_12,
_13,
_14,
_15,
_16,
_17,
_18,
_19,
_20,
_21,
_22,
_23,
_24,
_25,
_26,
_27,
_28,
_29,
_30,
_31,
_32,
_33,
_34,
_35,
_36,
_37,
_38,
_39,
_40,
_41,
_42,
_43,
_44,
_45,
_46,
_47,
_48,
_49,
_50,
_51,
_52,
_53,
_54,
_55,
_56,
_57,
_58,
_59,
_60,
_61,
_62,
_63,
N,
... )
Value:
N

Definition at line 274 of file OOStringExpander.h.

◆ OOEXPAND_ARGUMENT_COUNT_INNER

#define OOEXPAND_ARGUMENT_COUNT_INNER ( ...)
Value:
#define OOEXPAND_ARGUMENT_COUNT_EXTRACT_64TH_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, N,...)

Definition at line 272 of file OOStringExpander.h.

272#define OOEXPAND_ARGUMENT_COUNT_INNER(...) \
273 OOEXPAND_ARGUMENT_COUNT_EXTRACT_64TH_ARG(__VA_ARGS__)

◆ OOEXPAND_IS_DOUBLE

#define OOEXPAND_IS_DOUBLE ( ITEM)
Value:
( \
__builtin_types_compatible_p(typeof(ITEM), double) || \
__builtin_types_compatible_p(typeof(ITEM), long double))

Definition at line 242 of file OOStringExpander.h.

242#define OOEXPAND_IS_DOUBLE(ITEM) ( \
243 __builtin_types_compatible_p(typeof(ITEM), double) || \
244 __builtin_types_compatible_p(typeof(ITEM), long double))

◆ OOEXPAND_IS_FLOAT

#define OOEXPAND_IS_FLOAT ( ITEM)
Value:
( \
__builtin_types_compatible_p(typeof(ITEM), float))

Definition at line 238 of file OOStringExpander.h.

238#define OOEXPAND_IS_FLOAT(ITEM) ( \
239 __builtin_types_compatible_p(typeof(ITEM), float))

◆ OOEXPAND_IS_OBJECT

#define OOEXPAND_IS_OBJECT ( ITEM)
Value:
( \
__builtin_types_compatible_p(typeof(ITEM), NSString *) || \
__builtin_types_compatible_p(typeof(ITEM), NSNumber *))

Definition at line 207 of file OOStringExpander.h.

207#define OOEXPAND_IS_OBJECT(ITEM) ( \
208 __builtin_types_compatible_p(typeof(ITEM), NSString *) || \
209 __builtin_types_compatible_p(typeof(ITEM), NSNumber *))

◆ OOEXPAND_IS_SIGNED_INTEGER

#define OOEXPAND_IS_SIGNED_INTEGER ( ITEM)
Value:
( \
__builtin_types_compatible_p(typeof(ITEM), char) || \
__builtin_types_compatible_p(typeof(ITEM), short) || \
__builtin_types_compatible_p(typeof(ITEM), int) || \
__builtin_types_compatible_p(typeof(ITEM), long) || \
__builtin_types_compatible_p(typeof(ITEM), long long) || \
__builtin_types_compatible_p(typeof(ITEM), NSInteger) || \
__builtin_types_compatible_p(typeof(ITEM), intptr_t) || \
__builtin_types_compatible_p(typeof(ITEM), ssize_t) || \
__builtin_types_compatible_p(typeof(ITEM), off_t))

Definition at line 213 of file OOStringExpander.h.

213#define OOEXPAND_IS_SIGNED_INTEGER(ITEM) ( \
214 __builtin_types_compatible_p(typeof(ITEM), char) || \
215 __builtin_types_compatible_p(typeof(ITEM), short) || \
216 __builtin_types_compatible_p(typeof(ITEM), int) || \
217 __builtin_types_compatible_p(typeof(ITEM), long) || \
218 __builtin_types_compatible_p(typeof(ITEM), long long) || \
219 __builtin_types_compatible_p(typeof(ITEM), NSInteger) || \
220 __builtin_types_compatible_p(typeof(ITEM), intptr_t) || \
221 __builtin_types_compatible_p(typeof(ITEM), ssize_t) || \
222 __builtin_types_compatible_p(typeof(ITEM), off_t))

◆ OOEXPAND_IS_UNSIGNED_INTEGER

#define OOEXPAND_IS_UNSIGNED_INTEGER ( ITEM)
Value:
( \
__builtin_types_compatible_p(typeof(ITEM), unsigned char) || \
__builtin_types_compatible_p(typeof(ITEM), unsigned short) || \
__builtin_types_compatible_p(typeof(ITEM), unsigned int) || \
__builtin_types_compatible_p(typeof(ITEM), unsigned long) || \
__builtin_types_compatible_p(typeof(ITEM), unsigned long long) || \
__builtin_types_compatible_p(typeof(ITEM), NSUInteger) || \
__builtin_types_compatible_p(typeof(ITEM), uintptr_t) || \
__builtin_types_compatible_p(typeof(ITEM), size_t))

Definition at line 226 of file OOStringExpander.h.

226#define OOEXPAND_IS_UNSIGNED_INTEGER(ITEM) ( \
227 __builtin_types_compatible_p(typeof(ITEM), unsigned char) || \
228 __builtin_types_compatible_p(typeof(ITEM), unsigned short) || \
229 __builtin_types_compatible_p(typeof(ITEM), unsigned int) || \
230 __builtin_types_compatible_p(typeof(ITEM), unsigned long) || \
231 __builtin_types_compatible_p(typeof(ITEM), unsigned long long) || \
232 __builtin_types_compatible_p(typeof(ITEM), NSUInteger) || \
233 __builtin_types_compatible_p(typeof(ITEM), uintptr_t) || \
234 __builtin_types_compatible_p(typeof(ITEM), size_t))

◆ OOEXPAND_MAP

#define OOEXPAND_MAP ( F,
... )
Value:
OOEXPAND_MAP_INNER(F, OOEXPAND_ARGUMENT_COUNT(__VA_ARGS__), __VA_ARGS__)
#define OOEXPAND_MAP_INNER(F, COUNTEXPR,...)

Definition at line 292 of file OOStringExpander.h.

292#define OOEXPAND_MAP(F, ...) \
293 OOEXPAND_MAP_INNER(F, OOEXPAND_ARGUMENT_COUNT(__VA_ARGS__), __VA_ARGS__)

◆ OOEXPAND_MAP_IMPL_0

#define OOEXPAND_MAP_IMPL_0 ( F,
HEAD )

Definition at line 301 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_1

#define OOEXPAND_MAP_IMPL_1 ( F,
HEAD )
Value:
F(HEAD)

Definition at line 302 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_10

#define OOEXPAND_MAP_IMPL_10 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_9(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_9(F, HEAD,...)

Definition at line 311 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_11

#define OOEXPAND_MAP_IMPL_11 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_10(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_10(F, HEAD,...)

Definition at line 312 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_12

#define OOEXPAND_MAP_IMPL_12 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_11(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_11(F, HEAD,...)

Definition at line 313 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_13

#define OOEXPAND_MAP_IMPL_13 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_12(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_12(F, HEAD,...)

Definition at line 314 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_14

#define OOEXPAND_MAP_IMPL_14 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_13(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_13(F, HEAD,...)

Definition at line 315 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_15

#define OOEXPAND_MAP_IMPL_15 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_14(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_14(F, HEAD,...)

Definition at line 316 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_16

#define OOEXPAND_MAP_IMPL_16 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_15(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_15(F, HEAD,...)

Definition at line 317 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_17

#define OOEXPAND_MAP_IMPL_17 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_16(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_16(F, HEAD,...)

Definition at line 318 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_18

#define OOEXPAND_MAP_IMPL_18 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_17(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_17(F, HEAD,...)

Definition at line 319 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_19

#define OOEXPAND_MAP_IMPL_19 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_18(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_18(F, HEAD,...)

Definition at line 320 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_2

#define OOEXPAND_MAP_IMPL_2 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_1(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_1(F, HEAD)

Definition at line 303 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_20

#define OOEXPAND_MAP_IMPL_20 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_19(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_19(F, HEAD,...)

Definition at line 321 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_21

#define OOEXPAND_MAP_IMPL_21 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_20(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_20(F, HEAD,...)

Definition at line 322 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_22

#define OOEXPAND_MAP_IMPL_22 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_21(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_21(F, HEAD,...)

Definition at line 323 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_23

#define OOEXPAND_MAP_IMPL_23 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_22(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_22(F, HEAD,...)

Definition at line 324 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_24

#define OOEXPAND_MAP_IMPL_24 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_23(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_23(F, HEAD,...)

Definition at line 325 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_25

#define OOEXPAND_MAP_IMPL_25 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_24(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_24(F, HEAD,...)

Definition at line 326 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_26

#define OOEXPAND_MAP_IMPL_26 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_25(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_25(F, HEAD,...)

Definition at line 327 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_27

#define OOEXPAND_MAP_IMPL_27 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_26(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_26(F, HEAD,...)

Definition at line 328 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_28

#define OOEXPAND_MAP_IMPL_28 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_27(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_27(F, HEAD,...)

Definition at line 329 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_29

#define OOEXPAND_MAP_IMPL_29 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_28(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_28(F, HEAD,...)

Definition at line 330 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_3

#define OOEXPAND_MAP_IMPL_3 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_2(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_2(F, HEAD,...)

Definition at line 304 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_30

#define OOEXPAND_MAP_IMPL_30 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_29(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_29(F, HEAD,...)

Definition at line 331 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_31

#define OOEXPAND_MAP_IMPL_31 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_30(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_30(F, HEAD,...)

Definition at line 332 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_32

#define OOEXPAND_MAP_IMPL_32 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_31(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_31(F, HEAD,...)

Definition at line 333 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_33

#define OOEXPAND_MAP_IMPL_33 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_32(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_32(F, HEAD,...)

Definition at line 334 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_34

#define OOEXPAND_MAP_IMPL_34 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_33(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_33(F, HEAD,...)

Definition at line 335 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_35

#define OOEXPAND_MAP_IMPL_35 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_34(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_34(F, HEAD,...)

Definition at line 336 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_36

#define OOEXPAND_MAP_IMPL_36 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_35(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_35(F, HEAD,...)

Definition at line 337 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_37

#define OOEXPAND_MAP_IMPL_37 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_36(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_36(F, HEAD,...)

Definition at line 338 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_38

#define OOEXPAND_MAP_IMPL_38 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_37(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_37(F, HEAD,...)

Definition at line 339 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_39

#define OOEXPAND_MAP_IMPL_39 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_38(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_38(F, HEAD,...)

Definition at line 340 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_4

#define OOEXPAND_MAP_IMPL_4 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_3(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_3(F, HEAD,...)

Definition at line 305 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_40

#define OOEXPAND_MAP_IMPL_40 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_39(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_39(F, HEAD,...)

Definition at line 341 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_41

#define OOEXPAND_MAP_IMPL_41 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_40(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_40(F, HEAD,...)

Definition at line 342 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_42

#define OOEXPAND_MAP_IMPL_42 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_41(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_41(F, HEAD,...)

Definition at line 343 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_43

#define OOEXPAND_MAP_IMPL_43 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_42(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_42(F, HEAD,...)

Definition at line 344 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_44

#define OOEXPAND_MAP_IMPL_44 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_43(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_43(F, HEAD,...)

Definition at line 345 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_45

#define OOEXPAND_MAP_IMPL_45 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_44(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_44(F, HEAD,...)

Definition at line 346 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_46

#define OOEXPAND_MAP_IMPL_46 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_45(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_45(F, HEAD,...)

Definition at line 347 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_47

#define OOEXPAND_MAP_IMPL_47 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_46(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_46(F, HEAD,...)

Definition at line 348 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_48

#define OOEXPAND_MAP_IMPL_48 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_47(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_47(F, HEAD,...)

Definition at line 349 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_49

#define OOEXPAND_MAP_IMPL_49 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_48(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_48(F, HEAD,...)

Definition at line 350 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_5

#define OOEXPAND_MAP_IMPL_5 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_4(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_4(F, HEAD,...)

Definition at line 306 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_50

#define OOEXPAND_MAP_IMPL_50 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_49(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_49(F, HEAD,...)

Definition at line 351 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_51

#define OOEXPAND_MAP_IMPL_51 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_50(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_50(F, HEAD,...)

Definition at line 352 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_52

#define OOEXPAND_MAP_IMPL_52 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_51(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_51(F, HEAD,...)

Definition at line 353 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_53

#define OOEXPAND_MAP_IMPL_53 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_52(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_52(F, HEAD,...)

Definition at line 354 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_54

#define OOEXPAND_MAP_IMPL_54 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_53(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_53(F, HEAD,...)

Definition at line 355 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_55

#define OOEXPAND_MAP_IMPL_55 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_54(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_54(F, HEAD,...)

Definition at line 356 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_56

#define OOEXPAND_MAP_IMPL_56 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_55(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_55(F, HEAD,...)

Definition at line 357 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_57

#define OOEXPAND_MAP_IMPL_57 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_56(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_56(F, HEAD,...)

Definition at line 358 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_58

#define OOEXPAND_MAP_IMPL_58 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_57(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_57(F, HEAD,...)

Definition at line 359 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_59

#define OOEXPAND_MAP_IMPL_59 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_58(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_58(F, HEAD,...)

Definition at line 360 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_6

#define OOEXPAND_MAP_IMPL_6 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_5(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_5(F, HEAD,...)

Definition at line 307 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_60

#define OOEXPAND_MAP_IMPL_60 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_59(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_59(F, HEAD,...)

Definition at line 361 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_61

#define OOEXPAND_MAP_IMPL_61 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_60(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_60(F, HEAD,...)

Definition at line 362 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_62

#define OOEXPAND_MAP_IMPL_62 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_61(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_61(F, HEAD,...)

Definition at line 363 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_7

#define OOEXPAND_MAP_IMPL_7 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_6(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_6(F, HEAD,...)

Definition at line 308 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_8

#define OOEXPAND_MAP_IMPL_8 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_7(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_7(F, HEAD,...)

Definition at line 309 of file OOStringExpander.h.

◆ OOEXPAND_MAP_IMPL_9

#define OOEXPAND_MAP_IMPL_9 ( F,
HEAD,
... )
Value:
F(HEAD), OOEXPAND_MAP_IMPL_8(F, __VA_ARGS__)
#define OOEXPAND_MAP_IMPL_8(F, HEAD,...)

Definition at line 310 of file OOStringExpander.h.

◆ OOEXPAND_MAP_INNER

#define OOEXPAND_MAP_INNER ( F,
COUNTEXPR,
... )
Value:
OOEXPAND_MAP_INNER2(F, COUNTEXPR, __VA_ARGS__)
#define OOEXPAND_MAP_INNER2(F, COUNT,...)

Definition at line 294 of file OOStringExpander.h.

294#define OOEXPAND_MAP_INNER(F, COUNTEXPR, ...) \
295 OOEXPAND_MAP_INNER2(F, COUNTEXPR, __VA_ARGS__)

◆ OOEXPAND_MAP_INNER2

#define OOEXPAND_MAP_INNER2 ( F,
COUNT,
... )
Value:
OOEXPAND_MAP_INNER3(F, OOEXPAND_MAP_IMPL_ ## COUNT, __VA_ARGS__)
#define COUNT(FIELD)
#define OOEXPAND_MAP_INNER3(F, IMPL,...)

Definition at line 296 of file OOStringExpander.h.

296#define OOEXPAND_MAP_INNER2(F, COUNT, ...) \
297 OOEXPAND_MAP_INNER3(F, OOEXPAND_MAP_IMPL_ ## COUNT, __VA_ARGS__)

◆ OOEXPAND_MAP_INNER3

#define OOEXPAND_MAP_INNER3 ( F,
IMPL,
... )
Value:
IMPL(F, __VA_ARGS__)

Definition at line 298 of file OOStringExpander.h.

298#define OOEXPAND_MAP_INNER3(F, IMPL, ...) \
299 IMPL(F, __VA_ARGS__)

◆ OOEXPAND_NAME_FROM_ARG

#define OOEXPAND_NAME_FROM_ARG ( ITEM)
Value:
@#ITEM

Definition at line 168 of file OOStringExpander.h.

◆ OOEXPAND_NAMES_FROM_ARGS

#define OOEXPAND_NAMES_FROM_ARGS ( ...)
Value:
(NSString *[]){ OOEXPAND_MAP(OOEXPAND_NAME_FROM_ARG, __VA_ARGS__) }
#define OOEXPAND_NAME_FROM_ARG(ITEM)
#define OOEXPAND_MAP(F,...)

Definition at line 169 of file OOStringExpander.h.

◆ OOEXPAND_OBJECTS_FROM_ARGS

#define OOEXPAND_OBJECTS_FROM_ARGS ( ...)
Value:
(id[]){ OOEXPAND_MAP(OO_CAST_PARAMETER, __VA_ARGS__) }
#define OO_CAST_PARAMETER(ITEM)

Definition at line 171 of file OOStringExpander.h.

◆ OOExpandKey

#define OOExpandKey ( key,
... )
Value:
#define OOExpandKeyWithSeed(seed, key,...)

Expand a string as though it were surrounded by brackets; OOExpandKey("foo", ...) is equivalent to OOExpand(@"[foo]", ...).

Definition at line 133 of file OOStringExpander.h.

Referenced by OOShipLibraryCategoryPlural(), and OOShipLibraryCategorySingular().

◆ OOExpandKeyRandomized

#define OOExpandKeyRandomized ( key,
... )
Value:
@ kOOExpandKey
Treat string as a key. Expand("foo", kOOExpandKey) == Expand(@"[foo]", kOOExpandNoOptions).
@ kOOExpandGoodRNG
Use RANDROT for selecting from description arrays and for N expansion.
@ kOOExpandReseedRNG
Set "really random" seeds while expanding.
#define OOExpandWithOptions(seed, options, string,...)

Like OOExpandKey(), but uses a random-er random seed to avoid repeatability.

Definition at line 138 of file OOStringExpander.h.

◆ OOExpandKeyWithSeed

#define OOExpandKeyWithSeed ( seed,
key,
... )
Value:
OOExpandWithOptions(seed, kOOExpandKey, key, __VA_ARGS__)

Definition at line 142 of file OOStringExpander.h.

◆ OOExpandWithOptions

#define OOExpandWithOptions ( seed,
options,
string,
... )
Value:
OOExpandDescriptionString(seed, string, OOEXPAND_ARG_DICTIONARY(__VA_ARGS__), nil, nil, options)
NSString * OOExpandDescriptionString(Random_Seed seed, NSString *string, NSDictionary *overrides, NSDictionary *legacyLocals, NSString *systemName, OOExpandOptions options)
#define OOEXPAND_ARG_DICTIONARY(...)

Definition at line 145 of file OOStringExpander.h.

145#define OOExpandWithOptions(seed, options, string, ...) \
146 OOExpandDescriptionString(seed, string, OOEXPAND_ARG_DICTIONARY(__VA_ARGS__), nil, nil, options)

◆ OOExpandWithSeed

#define OOExpandWithSeed ( seed,
string,
... )
Value:
OOExpandWithOptions(seed, kOOExpandNoOptions, string, __VA_ARGS__)
@ kOOExpandNoOptions

Definition at line 140 of file OOStringExpander.h.

Typedef Documentation

◆ OOExpandOptions

typedef NSUInteger OOExpandOptions

Definition at line 45 of file OOStringExpander.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kOOExpandForJavaScript 

Report warnings through JavaScript runtime system instead of normal logging.

kOOExpandBackslashN 

Convert literal "\\n"s to line breaks (used for missiontext.plist for historical reasons).

kOOExpandGoodRNG 

Use RANDROT for selecting from description arrays and for N expansion.

kOOExpandReseedRNG 

Set "really random" seeds while expanding.

kOOExpandKey 

Treat string as a key. Expand("foo", kOOExpandKey) == Expand(@"[foo]", kOOExpandNoOptions).

kOOExpandDisallowPercentI 

Disallow I expansion (used when expanding I itself).

kOOExpandNoOptions 

Definition at line 34 of file OOStringExpander.h.

35{
36 kOOExpandForJavaScript = 0x00000001,
37 kOOExpandBackslashN = 0x00000002,
38 kOOExpandGoodRNG = 0x00000004,
39 kOOExpandReseedRNG = 0x00000008,
40 kOOExpandKey = 0x00000010,
41 kOOExpandDisallowPercentI = 0x00000020,
42
44};
@ kOOExpandForJavaScript
Report warnings through JavaScript runtime system instead of normal logging.
@ kOOExpandDisallowPercentI
Disallow I expansion (used when expanding I itself).
@ kOOExpandBackslashN
Convert literal "\\n"s to line breaks (used for missiontext.plist for historical reasons).

Function Documentation

◆ OOCastParamDouble()

static id OOCastParamDouble ( double value)
inlinestatic

Definition at line 251 of file OOStringExpander.h.

251{ return [NSNumber numberWithDouble:value]; }

◆ OOCastParamFloat()

static id OOCastParamFloat ( float value)
inlinestatic

Definition at line 250 of file OOStringExpander.h.

250{ return [NSNumber numberWithFloat:value]; }

◆ OOCastParamObject()

static id OOCastParamObject ( id object)
inlinestatic

Definition at line 247 of file OOStringExpander.h.

247{ return object; }

◆ OOCastParamSignedInteger()

static id OOCastParamSignedInteger ( long long value)
inlinestatic

Definition at line 248 of file OOStringExpander.h.

248{ return [NSNumber numberWithLongLong:value]; }

◆ OOCastParamUnsignedInteger()

static id OOCastParamUnsignedInteger ( unsigned long long value)
inlinestatic

Definition at line 249 of file OOStringExpander.h.

249{ return [NSNumber numberWithUnsignedLongLong:value]; }

◆ OOExpandDescriptionString()

NSString * OOExpandDescriptionString ( Random_Seed seed,
NSString * string,
NSDictionary * overrides,
NSDictionary * legacyLocals,
NSString * systemName,
OOExpandOptions options )

Definition at line 160 of file OOStringExpander.m.

161{
162 if (string == nil) return nil;
163
165 {
166 .seed = seed,
167 .systemName = [systemName retain],
168 .overrides = [overrides retain],
169 .legacyLocals = [legacyLocals retain],
170 .isJavaScript = options & kOOExpandForJavaScript,
171 .convertBackslashN = options & kOOExpandBackslashN,
172 .useGoodRNG = options & kOOExpandGoodRNG
173 };
174
175 // Avoid recursive %I expansion by pre-seeding cache with literal %I.
176 if (options & kOOExpandDisallowPercentI) {
177 context.systemNameWithIan = @"%I";
178 }
179
180 OORandomState savedRandomState;
181 if (options & kOOExpandReseedRNG)
182 {
183 savedRandomState = OOSaveRandomState();
185 }
186
187 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
188 NSString *result = nil, *intermediate = nil;
189 @try
190 {
191 // TODO: profile caching the results. Would need to keep track of whether we've done something nondeterministic (array selection, %R etc).
192 if (options & kOOExpandKey)
193 {
194 intermediate = ExpandStringKey(&context, string, kStackAllocationLimit, kRecursionLimit);
195 }
196 else
197 {
198 intermediate = Expand(&context, string, kStackAllocationLimit, kRecursionLimit);
199 }
200 if (!context.hasPercentR)
201 {
202 result = intermediate;
203 }
204 else
205 {
206 result = ExpandPercentR(&context, intermediate);
207 }
208 }
209 @finally
210 {
211 [context.systemName release];
212 [context.overrides release];
213 [context.legacyLocals release];
214 [context.systemNameWithIan release];
215 [context.randomNameN release];
216 [context.randomNameR release];
217 [context.systemDescriptions release];
218 }
219
220 if (options & kOOExpandReseedRNG)
221 {
222 OORestoreRandomState(savedRandomState);
223 }
224
225 result = [result copy];
226 [pool release];
227 return [result autorelease];
228}
static NSString * Expand(OOStringExpansionContext *context, NSString *string, NSUInteger sizeLimit, NSUInteger recursionLimit)
static NSString * ExpandStringKey(OOStringExpansionContext *context, NSString *key, NSUInteger sizeLimit, NSUInteger recursionLimit)
@ kRecursionLimit
@ kStackAllocationLimit
static NSString * ExpandPercentR(OOStringExpansionContext *context, NSString *input)
void OORestoreRandomState(OORandomState state)
OORandomState OOSaveRandomState(void)
void OOSetReallyRandomRANROTAndRndSeeds(void)

References Expand(), ExpandPercentR(), ExpandStringKey(), OOStringExpansionContext::hasPercentR, kOOExpandBackslashN, kOOExpandDisallowPercentI, kOOExpandForJavaScript, kOOExpandGoodRNG, kOOExpandKey, kOOExpandReseedRNG, kRecursionLimit, kStackAllocationLimit, nil, OORestoreRandomState(), OOSaveRandomState(), OOSetReallyRandomRANROTAndRndSeeds(), and OOStringExpansionContext::systemNameWithIan.

Referenced by GlobalExpandDescription(), GlobalExpandMissionText(), OOGenerateSystemDescription(), and PlayerEntity(Scripting)::PerformActionStatment.

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

◆ OOGenerateSystemDescription()

NSString * OOGenerateSystemDescription ( Random_Seed seed,
NSString * name )

Definition at line 231 of file OOStringExpander.m.

232{
234 return OOExpandDescriptionString(seed, @"system-description-string", nil, nil, name, kOOExpandKey);
235}
NSString * OOExpandDescriptionString(Random_Seed seed, NSString *string, NSDictionary *overrides, NSDictionary *legacyLocals, NSString *systemName, OOExpandOptions options)
void seed_RNG_only_for_planet_description(Random_Seed s_seed)

References kOOExpandKey, nil, OOExpandDescriptionString(), and seed_RNG_only_for_planet_description().

+ Here is the call graph for this function:

◆ OOStringExpanderDefaultRandomSeed()

Random_Seed OOStringExpanderDefaultRandomSeed ( void )

Definition at line 238 of file OOStringExpander.m.

239{
240 return [[UNIVERSE systemManager] getRandomSeedForCurrentSystem];
241}
#define UNIVERSE
Definition Universe.h:840

Referenced by PlayerEntity(Scripting)::PerformActionStatment.

+ Here is the caller graph for this function: