| 361 | } |
| 362 | |
| 363 | bool parseBinary() |
| 364 | { |
| 365 | fini_ifstream_t file(filename.c_str(), std::ios::binary); |
| 366 | if (!file.is_open()) |
| 367 | return false; |
| 368 | |
| 369 | size_t sectionCount; |
| 370 | size_t keyCount; |
| 371 | key_t key; |
| 372 | value_t value; |
| 373 | section_t section; |
| 374 | |
| 375 | //file.read((fini_char_t*)§ionCount, sizeof(sectionCount)); |
| 376 | file >> sectionCount; |
| 377 | |
| 378 | for (size_t i = 0; i < sectionCount; i++) |
| 379 | { |
| 380 | if (i > 0) |
| 381 | file.seekg(1 + file.tellg()); |
| 382 | |
| 383 | file.read((fini_char_t*)&keyCount, sizeof(keyCount)); |
| 384 | file >> section; |
| 385 | |
| 386 | create(section); |
| 387 | |
| 388 | for (size_t j = 0; j < keyCount; j++) |
| 389 | { |
| 390 | file >> key; |
| 391 | file >> value; |
| 392 | set(key, value); |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | file.close(); |
| 397 | |
| 398 | return true; |
| 399 | } |
| 400 | |
| 401 | //Clear the contents from memory |
| 402 | void clear() |