1 // =================================
 2 // Copyright (c) 2022 Seppo Laakko
 3 // Distributed under the MIT license
 4 // =================================
 5 
 6 using System;
 7 using System.IO;
 8 
 9 void RemoveDirectory(const string& dirPathbool verbose)
10 {
11     if (IsDirectoryEmpty(dirPath))
12     {
13         System.IO.RemoveDirectory(dirPath);
14         if (verbose)
15         {
16             Console.Out() << "directory '" << dirPath << "' removed" << endl();
17         }
18     }
19     else
20     {
21         throw FileSystemException("directory '" + dirPath + "' is not empty");
22     }
23 }