CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
directory_info.h
1
2#ifndef _directory_info_h_
3#define _directory_info_h_
4
5#include "fwd.h"
6#include "system/object.h"
7#include "system/io/directory.h"
8#include "system/io/file_system_info.h"
9#include "system/io/file_info.h"
10#include "system/io/search_option.h"
11#include "system/collections/ienumerable.h"
12
13namespace System { namespace IO {
19 class ASPOSECPP_SHARED_CLASS DirectoryInfo : public FileSystemInfo {
21 template<class T>
23
24 public:
27 ASPOSECPP_SHARED_API DirectoryInfo(const String& path);
28
29 //***** Properties
32 virtual ASPOSECPP_SHARED_API bool get_Exists() override;
34 virtual ASPOSECPP_SHARED_API String get_Name() override;
37 ASPOSECPP_SHARED_API DirectoryInfoPtr get_Parent();
40 ASPOSECPP_SHARED_API DirectoryInfoPtr get_Root();
41
42 //***** Methods
44 ASPOSECPP_SHARED_API void Create();
45
49 ASPOSECPP_SHARED_API DirectoryInfoPtr CreateSubdirectory(const String& path);
51 virtual ASPOSECPP_SHARED_API void Delete() override; //delete current if empty
55 ASPOSECPP_SHARED_API void Delete(bool recursive);
56
65 ASPOSECPP_SHARED_API SharedPtr<IEnumerable<DirectoryInfoPtr> > EnumerateDirectories(const String& searchPattern);
73 ASPOSECPP_SHARED_API SharedPtr<IEnumerable<DirectoryInfoPtr> > EnumerateDirectories(const String& searchPattern, SearchOption searchOption);
74
83 ASPOSECPP_SHARED_API SharedPtr<IEnumerable<FileInfoPtr> > EnumerateFiles(const String& searchPattern);
91 ASPOSECPP_SHARED_API SharedPtr<IEnumerable<FileInfoPtr> > EnumerateFiles(const String& searchPattern, SearchOption searchOption);
92
109 ASPOSECPP_SHARED_API SharedPtr<IEnumerable<FileSystemInfoPtr> > EnumerateFileSystemInfos(const String& searchPattern, SearchOption searchOption);
110
119 ASPOSECPP_SHARED_API ArrayPtr<DirectoryInfoPtr> GetDirectories(const String& searchPattern);
127 ASPOSECPP_SHARED_API ArrayPtr<DirectoryInfoPtr> GetDirectories(const String& searchPattern, SearchOption searchOption);
128
131 ASPOSECPP_SHARED_API ArrayPtr<FileInfoPtr> GetFiles();
137 ASPOSECPP_SHARED_API ArrayPtr<FileInfoPtr> GetFiles(const String& searchPattern);
145 ASPOSECPP_SHARED_API ArrayPtr<FileInfoPtr> GetFiles(const String& searchPattern, SearchOption searchOption);
146
155 ASPOSECPP_SHARED_API ArrayPtr<FileSystemInfoPtr> GetFileSystemInfos(const String& searchPattern);
163 ASPOSECPP_SHARED_API ArrayPtr<FileSystemInfoPtr> GetFileSystemInfos(const String& searchPattern, SearchOption searchOption);
166 ASPOSECPP_SHARED_API void MoveTo(const String& destDirName);
168 ASPOSECPP_SHARED_API String ToString() const override;
169 };
170
171}}
172
173#endif // _directory_info_h_
174
Interface of object providing enumerator on contained elements.
Definition: ienumerable.h:25
Represents a file system path, a directory referred to by this path and provides instance methods for...
Definition: directory_info.h:19
SharedPtr< IEnumerable< FileInfoPtr > > EnumerateFiles(const String &searchPattern, SearchOption searchOption)
Searches for the files that satisfy the specified search criteria either in the directory represented...
DirectoryInfo(const String &path)
Constructs an instnace of DirectoryInfo class on the specified path.
virtual void Delete() override
Removes the directory referred to by the path represented by the current object if the directory is e...
SharedPtr< IEnumerable< FileInfoPtr > > EnumerateFiles()
Returns enumerable collection containing all files located in the directory represented by the curren...
ArrayPtr< FileSystemInfoPtr > GetFileSystemInfos()
Returns an array containing shared pointers to FileSystemInfo objects representing all files and dire...
ArrayPtr< FileSystemInfoPtr > GetFileSystemInfos(const String &searchPattern)
Searches for the files and directories that satisfy the specified search criteria in the directory re...
ArrayPtr< DirectoryInfoPtr > GetDirectories()
Returns an array containing shared pointers to DirectoryInfo objects representing all directories loc...
SharedPtr< IEnumerable< FileSystemInfoPtr > > EnumerateFileSystemInfos()
Returns enumerable collection containing all files and directories located in the directory represent...
ArrayPtr< FileInfoPtr > GetFiles(const String &searchPattern, SearchOption searchOption)
Searches for the files that satisfy the specified search criteria either in the directory represented...
SharedPtr< IEnumerable< FileInfoPtr > > EnumerateFiles(const String &searchPattern)
Searches for the files that satisfy the specified search criteria in the directory represented by the...
ArrayPtr< FileInfoPtr > GetFiles()
Returns an array containing shared pointers to FileInfo objects representing all directories located ...
SharedPtr< IEnumerable< DirectoryInfoPtr > > EnumerateDirectories(const String &searchPattern, SearchOption searchOption)
Searches for the directories that satisfy the specified search criteria either in the directory repre...
ArrayPtr< FileInfoPtr > GetFiles(const String &searchPattern)
Searches for the files that satisfy the specified search criteria in the directory represented by the...
ArrayPtr< DirectoryInfoPtr > GetDirectories(const String &searchPattern, SearchOption searchOption)
Searches for the directories that satisfy the specified search criteria either in the directory repre...
ArrayPtr< FileSystemInfoPtr > GetFileSystemInfos(const String &searchPattern, SearchOption searchOption)
Searches for the files and directories that satisfy the specified search criteria either in the direc...
SharedPtr< IEnumerable< FileSystemInfoPtr > > EnumerateFileSystemInfos(const String &searchPattern, SearchOption searchOption)
Searches for the files and directories that satisfy the specified search criteria either in the direc...
SharedPtr< IEnumerable< FileSystemInfoPtr > > EnumerateFileSystemInfos(const String &searchPattern)
Searches for the files and directories that satisfy the specified search criteria in the directory re...
void Delete(bool recursive)
Removes the directory referred to by the path represented by the current object. A parameter specifie...
ArrayPtr< DirectoryInfoPtr > GetDirectories(const String &searchPattern)
Searches for the directories that satisfy the specified search criteria in the directory represented ...
virtual bool get_Exists() override
Determines if the path represented by the current object refers to existing directory.
String ToString() const override
Returns a string containing the path represented by the current object.
DirectoryInfoPtr CreateSubdirectory(const String &path)
Creates subdirectories on the specified path.
SharedPtr< IEnumerable< DirectoryInfoPtr > > EnumerateDirectories()
Returns enumerable collection containing all directories located in the directory represented by the ...
void Create()
Creates a directory at the path represented by the current object.
DirectoryInfoPtr get_Parent()
Returns a shared pointer to DirectoryInfo object that represents a path referring the parent director...
DirectoryInfoPtr get_Root()
Returns a shared pointer to DirectoryInfo object that represents a path referring the root directory ...
SharedPtr< IEnumerable< DirectoryInfoPtr > > EnumerateDirectories(const String &searchPattern)
Searches for the directories that satisfy the specified search criteria in the directory represented ...
virtual String get_Name() override
Returns the name of the entity referred to by the path represented by the current object.
void MoveTo(const String &destDirName)
Moves the directory represented by the current object and all its contentto the specified location.
The base class for FileInfo and DirectoryInfo. Objects of this class should only be allocated using S...
Definition: file_system_info.h:31
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
Definition: db_command.h:9