---------------------------------------------------------------------------
| 340 | } |
| 341 | //--------------------------------------------------------------------------- |
| 342 | void TStorageFile::RotationLogAddItem(String fn, String & file_to_delete) |
| 343 | { |
| 344 | TStringList * p = NULL; |
| 345 | String rlf = RotationLogFormatFileName(); |
| 346 | try |
| 347 | { |
| 348 | p = new TStringList; |
| 349 | try { p->LoadFromFile(rlf); } catch(...) {} |
| 350 | p->Insert(0, fn); |
| 351 | // delete last item if limit of files exceeded |
| 352 | if( rotation_count > 0 ) |
| 353 | if( p->Count > rotation_count ) |
| 354 | { |
| 355 | file_to_delete = p->Strings[p->Count - 1]; |
| 356 | p->Delete(p->Count - 1); |
| 357 | } |
| 358 | p->SaveToFile(rlf); |
| 359 | } |
| 360 | catch(const Exception & E) |
| 361 | { |
| 362 | WriteToLogError("ERROR\tRotationLogAddItem(%s): %s", rlf.c_str(), E.Message.c_str()); |
| 363 | } |
| 364 | catch(...) |
| 365 | {} |
| 366 | delete p; |
| 367 | } |
| 368 | //--------------------------------------------------------------------------- |
| 369 | String TStorageFile::RotationLogGetItem(int num) |
| 370 | { |
nothing calls this directly
no test coverage detected