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

Go to the source code of this file.

Functions

NSString * OOTabString (NSUInteger count)
 

Function Documentation

◆ OOTabString()

NSString * OOTabString ( NSUInteger count)

Definition at line 218 of file NSStringOOExtensions.m.

219{
220 NSString * const staticTabs[] =
221 {
222 @"",
223 @"\t",
224 @"\t\t",
225 @"\t\t\t",
226 @"\t\t\t\t",
227 @"\t\t\t\t\t", // 5
228 @"\t\t\t\t\t\t",
229 @"\t\t\t\t\t\t\t",
230 @"\t\t\t\t\t\t\t\t",
231 @"\t\t\t\t\t\t\t\t\t",
232 @"\t\t\t\t\t\t\t\t\t\t" // 10
233 };
234 enum { kStaticTabCount = sizeof staticTabs / sizeof *staticTabs };
235
236 if (count < kStaticTabCount)
237 {
238 return staticTabs[count];
239 }
240 else
241 {
242 return [staticTabs[kStaticTabCount - 1] stringByAppendingString:OOTabString(count - (kStaticTabCount - 1))];
243 }
244}
NSString * OOTabString(NSUInteger count)
unsigned count