---------------------------------------------------------------------------
| 164 | } |
| 165 | //--------------------------------------------------------------------------- |
| 166 | int TMYIniFile::Find(String Section, String Ident, int from) |
| 167 | { |
| 168 | if( Section.Length() == 0 ) |
| 169 | return -1; |
| 170 | |
| 171 | // ������ ��-�� ? |
| 172 | if( MySameText(CurSection, Section) && from==0 ) |
| 173 | { |
| 174 | // �� - ������� ������ CurSectionIndex |
| 175 | if( Ident.Length() > 0 ) |
| 176 | { |
| 177 | if( CurParamIndex<0 ) |
| 178 | CurParamIndex = CurSectionIndex + 1; // ������������, ��� ��������� ��������� �������� |
| 179 | else |
| 180 | CurParamIndex++; // ������������, ��� ��������� ��������� �������� |
| 181 | } |
| 182 | } |
| 183 | else |
| 184 | { |
| 185 | CurSection = ""; |
| 186 | CurSectionIndex = -1; |
| 187 | CurParamIndex = -1; |
| 188 | // ���: ���� ������... |
| 189 | for(int i=from; i<list->Count; i++) |
| 190 | { |
| 191 | if( ! IsSectionName(list->Strings[i]) ) continue; |
| 192 | if( MySameText( String("[" + Section + "]"), list->Strings[i]) ) |
| 193 | { |
| 194 | CurSection = Section; |
| 195 | CurSectionIndex = i; |
| 196 | if( Ident.Length() > 0 ) |
| 197 | CurParamIndex = CurSectionIndex + 1; // ������������, ��� ��������� ��������� �������� |
| 198 | break; |
| 199 | } |
| 200 | } |
| 201 | } |
| 202 | // ������ �� ������� ��� �� ���� ������ �������� |
| 203 | if( CurSectionIndex<0 || Ident.Length() == 0 ) |
| 204 | return CurSectionIndex; |
| 205 | |
| 206 | // ���� �������� ����������... (���� ��� ���������) |
| 207 | if( Ident.Length() > 0 ) |
| 208 | { |
| 209 | // ���������... |
| 210 | if( CurParamIndex>=0 && CurParamIndex<list->Count ) |
| 211 | if( MySameText(Ident, list->Names[CurParamIndex]) ) // == |
| 212 | return CurParamIndex; |
| 213 | |
| 214 | CurParamIndex = -1; |
| 215 | for(int i=CurSectionIndex+1; i<list->Count; i++) |
| 216 | { |
| 217 | // ���� ��������� ������ - ������ �� ����� ����������: |
| 218 | if( IsSectionName(list->Strings[i]) ) |
| 219 | break; |
| 220 | |
| 221 | if( MySameText(Ident, list->Names[i]) ) // == |
| 222 | { |
| 223 | CurParamIndex = i; |
nothing calls this directly
no test coverage detected