CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
directory.h
1
2#ifndef _aspose_system_io_directory_h_
3#define _aspose_system_io_directory_h_
4
5#include "system/array.h"
6#include "system/io/search_option.h"
7#include "system/io/file_attributes.h"
8#include "system/io/file.h"
9#include "system/io/directory_info.h"
10#include "system/collections/ienumerable.h"
11#include "system/date_time.h"
12
13namespace System { namespace IO {
58 class Directory {
59 public:
62 static ASPOSECPP_SHARED_API void CreateDirectory_(const String& path);
68 static ASPOSECPP_SHARED_API void Delete(const String& path, bool recursive = false);
69
72
80 static ASPOSECPP_SHARED_API StringEnumerablePtr EnumerateDirectories(const String& path, const String& searchPattern = u"*", SearchOption searchOption = SearchOption::TopDirectoryOnly);
88 static ASPOSECPP_SHARED_API StringEnumerablePtr EnumerateFiles(const String& path, const String& searchPattern = u"*", SearchOption searchOption = SearchOption::TopDirectoryOnly);
96 static StringEnumerablePtr EnumerateFileSystemEntries(const String& path, const String& searchPattern = u"*", SearchOption searchOption = SearchOption::TopDirectoryOnly);
97
105 static ASPOSECPP_SHARED_API ArrayPtr<String> GetDirectories(const String& path, const String& searchPattern = u"*", SearchOption searchOption = SearchOption::TopDirectoryOnly);
113 static ASPOSECPP_SHARED_API ArrayPtr<String> GetFiles(const String& path, const String& searchPattern = u"*", SearchOption searchOption = SearchOption::TopDirectoryOnly);
121 static ASPOSECPP_SHARED_API ArrayPtr<String> GetFileSystemEntries(const String& path, const String& searchPattern = u"*", SearchOption searchOption = SearchOption::TopDirectoryOnly);
122
125 static ASPOSECPP_SHARED_API ArrayPtr<String> GetLogicalDrives();
126
130 static ASPOSECPP_SHARED_API bool Exists(const String& path);
131
135 static ASPOSECPP_SHARED_API DateTime GetCreationTime(const String& path);
139 static ASPOSECPP_SHARED_API DateTime GetCreationTimeUtc(const String& path);
143 static ASPOSECPP_SHARED_API DateTime GetLastAccessTime(const String& path);
147 static ASPOSECPP_SHARED_API DateTime GetLastAccessTimeUtc(const String& path);
151 static ASPOSECPP_SHARED_API DateTime GetLastWriteTime(const String& path);
155 static ASPOSECPP_SHARED_API DateTime GetLastWriteTimeUtc(const String& path);
156
160 static ASPOSECPP_SHARED_API void SetCreationTime(const String& path, DateTime date);
164 static ASPOSECPP_SHARED_API void SetCreationTimeUtc(const String& path, DateTime date);
168 static ASPOSECPP_SHARED_API void SetLastAccessTime(const String& path, DateTime date);
172 static ASPOSECPP_SHARED_API void SetLastAccessTimeUtc(const String& path, DateTime date);
176 static ASPOSECPP_SHARED_API void SetLastWriteTime(const String& path, DateTime date);
180 static ASPOSECPP_SHARED_API void SetLastWriteTimeUtc(const String& path, DateTime date);
181
183 static ASPOSECPP_SHARED_API String GetCurrentDirectory();
184
188 static ASPOSECPP_SHARED_API String GetDirectoryRoot(const String& path);
189
193 static ASPOSECPP_SHARED_API DirectoryInfoPtr GetParent(const String& path);
194
199 static ASPOSECPP_SHARED_API void Move(const String& sourceDirName, const String& destDirName);
202 static ASPOSECPP_SHARED_API void SetCurrentDirectory(const String& path);
203
204 private:
214 static ArrayPtr<String> GetEntries(const String& path, const String& searchPattern, SearchOption searchOption, FileAttributes attr);
221 static void GetEntries(const String& path, const String& searchPattern, FileAttributes attr, const ArrayPtr<String>& list);
228 static ArrayPtr<String> GetEntries(const String& path, const String& searchPattern, FileAttributes attr);
229 };
230
231}}
232
233#endif // _aspose_system_io_directory_h_
234
Represents a specific date and time value on the time continuum. This type should be allocated on sta...
Definition: date_time.h:50
Contains methods for manipulating directories. This is a static type with no instance services....
Definition: directory.h:58
static StringEnumerablePtr EnumerateDirectories(const String &path, const String &searchPattern=u"*", SearchOption searchOption=SearchOption::TopDirectoryOnly)
Searches for the directories that satisfy the specified search criteria either in the specified direc...
static void Move(const String &sourceDirName, const String &destDirName)
Moves the specified entity to the new location. If the entity to move is a directory,...
static ArrayPtr< String > GetFiles(const String &path, const String &searchPattern=u"*", SearchOption searchOption=SearchOption::TopDirectoryOnly)
Searches for the files that satisfy the specified search criteria either in the specified directory o...
static void SetLastWriteTimeUtc(const String &path, DateTime date)
Sets the last write time of the specified entity as UTC time.
static void SetLastAccessTimeUtc(const String &path, DateTime date)
Sets the last access time of the specified entity as UTC time.
static String GetDirectoryRoot(const String &path)
Returns the root directory of the specified path.
static void CreateDirectory_(const String &path)
Creates all directories in the specified path if those don't exist.
static DateTime GetCreationTimeUtc(const String &path)
Returns the creation time of the specified entity as UTC time.
static void SetCreationTimeUtc(const String &path, DateTime date)
Sets the creation time of the specified entity as UTC time.
static StringEnumerablePtr EnumerateFiles(const String &path, const String &searchPattern=u"*", SearchOption searchOption=SearchOption::TopDirectoryOnly)
Searches for the files that satisfy the specified search criteria either in the specified directory o...
static String GetCurrentDirectory()
Returns the full name (including path) of the current directory.
static StringEnumerablePtr EnumerateFileSystemEntries(const String &path, const String &searchPattern=u"*", SearchOption searchOption=SearchOption::TopDirectoryOnly)
Searches for the files and directories that satisfy the specified search criteria either in the speci...
static bool Exists(const String &path)
Determines if the specified path refers to existing directory.
static void SetCreationTime(const String &path, DateTime date)
Sets the creation time of the specified entity as local time.
static void Delete(const String &path, bool recursive=false)
Removes the specified file or directory. Does not throw.
static void SetLastAccessTime(const String &path, DateTime date)
Sets the last access time of the specified entity as local time.
static DateTime GetLastWriteTime(const String &path)
Returns the last write time of the specified entity as local time.
static void SetCurrentDirectory(const String &path)
Sets the current directory.
static DateTime GetCreationTime(const String &path)
Returns the creation time of the specified entity as local time.
static DateTime GetLastAccessTime(const String &path)
Returns the last access time of the specified entity as local time.
static DateTime GetLastAccessTimeUtc(const String &path)
Returns the last access time of the specified entity as UTC time.
static DirectoryInfoPtr GetParent(const String &path)
Returns a shared pointer to DirectoryInfo object representing the parent directory of the specified e...
static void SetLastWriteTime(const String &path, DateTime date)
Sets the last write time of the specified entity as local time.
static ArrayPtr< String > GetLogicalDrives()
NOT IMPLEMENTED.
static ArrayPtr< String > GetDirectories(const String &path, const String &searchPattern=u"*", SearchOption searchOption=SearchOption::TopDirectoryOnly)
Searches for the directories that satisfy the specified search criteria either in the specified direc...
static ArrayPtr< String > GetFileSystemEntries(const String &path, const String &searchPattern=u"*", SearchOption searchOption=SearchOption::TopDirectoryOnly)
Searches for the files and directories that satisfy the specified search criteria either in the speci...
static DateTime GetLastWriteTimeUtc(const String &path)
Returns the last write time of the specified entity as UTC time.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
SearchOption
Specifies a search should be performed only in the current directory, or in the current directory and...
Definition: search_option.h:8
@ TopDirectoryOnly
Search in the current directory only.
FileAttributes
Represents attributes of a directory or a file.
Definition: file_attributes.h:9
Definition: db_command.h:9