Changeset 14:f69f443c1a13 in miniini


Ignore:
Timestamp:
Sep 22, 2010 12:46:39 PM (3 years ago)
Author:
Nikita Kozlov <nikita@…>
Branch:
default
Message:

add 2 new accessor to INISection

Location:
miniini
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • miniini/include/inisection.h

    r13 r14  
    321321        }; 
    322322 
    323         unsigned GetTag(const char* tags, unsigned pos) const; 
     323        bool GetTag(const char* &tags, unsigned pos) const; 
     324        bool GetTagValue(const char*& val, unsigned pos) const; 
    324325 
    325326        unsigned GetTags(const char* tags[], unsigned n) const; 
  • miniini/src/allocator.cpp

    r0 r14  
    143143        delete [] Blocks; 
    144144        Blocks = tempblocks; 
     145        NumBlocks++; 
    145146    } 
    146147} 
  • miniini/src/inisection.cpp

    r13 r14  
    9494            REALLOCATE(tagbuf, tagcap, tagsize, c); 
    9595        } 
    96         //unrolled part of the loop (process 4 chars) 
    97         FOR_4 
    98         ( 
     96 
    9997        { 
    10098            ch = *currentchar; 
     
    161159            ++currentchar; 
    162160        } 
    163         ) 
    164161    } 
    165162} 
     
    844841#endif 
    845842 
    846 bool INISection::GetTag(const char* tags, unsigned pos) const 
    847 { 
    848         if (pos >= 0 && pos < N) 
     843bool INISection::GetTag(const char* &tags, unsigned pos) const 
     844{ 
     845        if (pos >= 0 && pos < Length) 
    849846        { 
    850847                tags = Tags[pos]; 
     
    854851} 
    855852 
     853bool INISection::GetTagValue(const char* &val, unsigned pos) const 
     854{ 
     855        if (pos >= 0 && pos < Length) 
     856        { 
     857                val = Tags[pos] + strlen(Tags[pos]) + 1; 
     858                return true; 
     859        } 
     860        return false; 
     861} 
     862 
    856863unsigned INISection::GetTags(const char *tags[], unsigned n) const { 
    857864 
Note: See TracChangeset for help on using the changeset viewer.