project_files/HedgewarsMobile/Classes/IniParser.m
branchios-develop
changeset 12872 00215a7ec5f5
parent 11568 e9ee87b28e17
equal deleted inserted replaced
12871:2c06b1120749 12872:00215a7ec5f5
    20 
    20 
    21 #define COMMENTS_START_CHAR ';'
    21 #define COMMENTS_START_CHAR ';'
    22 #define  SECTION_START_CHAR '['
    22 #define  SECTION_START_CHAR '['
    23 
    23 
    24 @interface IniParser ()
    24 @interface IniParser ()
    25 @property (nonatomic, retain) NSString *iniFilePath;
    25 @property (nonatomic, strong) NSString *iniFilePath;
    26 
    26 
    27 @property (nonatomic, retain) NSMutableArray *mutableSections;
    27 @property (nonatomic, strong) NSMutableArray *mutableSections;
    28 @property (nonatomic, retain) NSMutableDictionary *currentSection;
    28 @property (nonatomic, strong) NSMutableDictionary *currentSection;
    29 @end
    29 @end
    30 
    30 
    31 @implementation IniParser
    31 @implementation IniParser
    32 
    32 
    33 #pragma mark - Initilisation
    33 #pragma mark - Initilisation
    83 }
    83 }
    84 
    84 
    85 - (void)addPreviousSectionToSectionsIfNecessary {
    85 - (void)addPreviousSectionToSectionsIfNecessary {
    86     if (self.currentSection != nil) {
    86     if (self.currentSection != nil) {
    87         [self.mutableSections addObject:self.currentSection];
    87         [self.mutableSections addObject:self.currentSection];
    88         [self.currentSection release];
       
    89     }
    88     }
    90 }
    89 }
    91 
    90 
    92 - (void)createCurrentSection {
    91 - (void)createCurrentSection {
    93     self.currentSection = [[NSMutableDictionary alloc] init];
    92     self.currentSection = [[NSMutableDictionary alloc] init];
   108 
   107 
   109 - (NSArray *)copyParsedSections {
   108 - (NSArray *)copyParsedSections {
   110     return [self.mutableSections copy];
   109     return [self.mutableSections copy];
   111 }
   110 }
   112 
   111 
   113 #pragma mark - Dealloc
       
   114 
       
   115 - (void)dealloc {
       
   116     [_iniFilePath release];
       
   117     [_mutableSections release];
       
   118     [_currentSection release];
       
   119     [super dealloc];
       
   120 }
       
   121 
       
   122 @end
   112 @end