DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
Directory.h
Go to the documentation of this file.
1#pragma once
2
3#include "Common.h"
4#include "System/Object.h"
5#include "System/String.h"
6#include "System/Array.h"
8
9#if defined(_WIN32)
10#undef CreateDirectory
11#undef GetCurrentDirectory
12#undef SetCurrentDirectory
13#endif
14
15namespace DotNetDupe {
16 namespace System {
17 namespace IO {
23 class Directory : public Object {
24 public:
28 DOTNETDUPE_API static bool Exists(const String& sPath);
29
32 DOTNETDUPE_API static void CreateDirectory(const String& sPath);
33
37 DOTNETDUPE_API static void CreateDirectory(const String& sPath, bool bRecursive);
38
41 DOTNETDUPE_API static void Delete(const String& sPath);
42
46 DOTNETDUPE_API static void Delete(const String& sPath, bool bRecursive);
47
51 DOTNETDUPE_API static void Move(const String& sSourceDirName, const String& sDestDirName);
52
56 DOTNETDUPE_API static Array<String> GetFiles(const String& sPath);
57
62 DOTNETDUPE_API static Array<String> GetFiles(const String& sPath, const String& sSearchPattern);
63
68
70 DOTNETDUPE_API static Array<String> GetDirectories(const String& sPath, const String& sSearchPattern);
71
74
76 DOTNETDUPE_API static Array<String> GetFileSystemEntries(const String& sPath, const String& sSearchPattern);
77
81
84 DOTNETDUPE_API static void SetCurrentDirectory(const String& sPath);
85
87 DOTNETDUPE_API static String GetDirectoryRoot(const String& sPath);
88
91
94
97 };
98 }
99 }
100}
Provides methods for creating, manipulating, searching, and sorting arrays.
Defines common cross-platform macros, export decorators, and fundamental types.
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition Common.h:20
Represents a point in time, typically expressed as a date and time of day, relative to Coordinated Un...
Base object class for DotNetDupe mirroring .NET System.Object.
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition Array.h:29
Represents a point in time, typically expressed as a date and time of day, relative to Coordinated Un...
Exposes static methods for creating, moving, and enumerating through directories and subdirectories.
Definition Directory.h:23
static void CreateDirectory(const String &sPath)
Creates all directories and subdirectories in the specified path unless they already exist.
Definition Directory.cpp:64
static Array< String > GetDirectories(const String &sPath)
Returns the names of subdirectories (including their paths) in the specified directory.
static DateTimeOffset GetCreationTime(const String &sPath)
Gets the creation date and time of a directory.
static void SetCurrentDirectory(const String &sPath)
Sets the application's current working directory to the specified directory.
static DateTimeOffset GetLastWriteTime(const String &sPath)
Returns the date and time the specified file or directory was last written to.
static void Delete(const String &sPath)
Deletes an empty directory from a specified path.
Definition Directory.cpp:86
static String GetCurrentDirectory()
Gets the current working directory of the application.
static void Move(const String &sSourceDirName, const String &sDestDirName)
Moves a file or a directory and its contents to a new location.
static bool Exists(const String &sPath)
Determines whether the given path refers to an existing directory on disk.
Definition Directory.cpp:56
static DateTimeOffset GetLastAccessTime(const String &sPath)
Returns the date and time the specified file or directory was last accessed.
static Array< String > GetFiles(const String &sPath)
Returns the names of files (including their paths) in the specified directory.
static Array< String > GetFileSystemEntries(const String &sPath)
Returns the names of all files and subdirectories in the specified directory.
static String GetDirectoryRoot(const String &sPath)
Returns the volume information, root information, or both for the specified path.
Supports all classes in the DotNetDupe class hierarchy.
Definition Object.h:18
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition String.h:74