Skip to content

Commit 37f0c2d

Browse files
add more Directory calls
1 parent 335947c commit 37f0c2d

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/framework/System/IO.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "IO/FileInfo.h"
2+
#include "IO/Directory.h"
23
#include "IO/StreamReader.h"
34
#include "IO/StreamWriter.h"
45
#include "IO/FileNotFoundException.h"

src/framework/System/IO/Directory.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "System/String.h"
55
#include "System/IO.h"
6+
#include "System/IO/FileSystemInfo.h"
67

78
namespace System
89
{
@@ -12,15 +13,27 @@ namespace System
1213
/// determine if the file exists
1314
static void CreateDirectory(const System::String& file)
1415
{
15-
static_cast<void>(file);
16+
mkdir(file.str().c_str(),
17+
S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
1618
}
1719

1820
static void Delete(const System::String& file)
1921
{
20-
static_cast<void>(file);
22+
rmdir(file.str().c_str());
2123
}
2224

2325
};
26+
27+
class DirectoryInfo : public FileSystemInfo
28+
{
29+
public:
30+
DirectoryInfo()
31+
{}
32+
33+
DirectoryInfo(const System::String & dir):
34+
FileSystemInfo(dir)
35+
{}
36+
};
2437
}
2538

2639
using namespace System;

src/unittests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ add_executable(System_Test
4949
HashSet_Test.cxx
5050
StringBuilder_Test.cxx
5151
Xml_Test.cxx
52+
Directory_Test.cxx
5253
)
5354

5455
# alter the link line of gcc to include coverage library

0 commit comments

Comments
 (0)