--------------------------------- File::Delete Delete the file from the disk
| 245 | // Delete the file from the disk |
| 246 | // |
| 247 | bool File::Delete() |
| 248 | { |
| 249 | if (m_IsOpen) |
| 250 | { |
| 251 | Close(); |
| 252 | } |
| 253 | |
| 254 | if(m_IsOpen) |
| 255 | { |
| 256 | LOG("Couldn't delete file because it failed to close", Error); |
| 257 | return false; |
| 258 | } |
| 259 | |
| 260 | std::string path = GetPath()+m_Filename; |
| 261 | if(FILE_BASE::DeleteFile( path.c_str() )) |
| 262 | { |
| 263 | if(m_Parent) |
| 264 | { |
| 265 | m_Parent->RemoveChild( this ); |
| 266 | } |
| 267 | |
| 268 | delete this; |
| 269 | return true; |
| 270 | } |
| 271 | |
| 272 | return false; |
| 273 | } |
| 274 | |
| 275 | |
| 276 | //====================== |
no test coverage detected