2013-06-02 14:32:43 +02:00
|
|
|
/*****************************************************************************
|
2013-10-04 22:15:52 +02:00
|
|
|
* DirectoryInfo.h *
|
2013-06-02 14:32:43 +02:00
|
|
|
* *
|
2013-10-04 22:15:52 +02:00
|
|
|
* XFX System::IO::DirectoryInfo class definition file. *
|
|
|
|
* Copyright (c) XFX Team. All Rights Reserved. *
|
2013-06-02 14:32:43 +02:00
|
|
|
*****************************************************************************/
|
2013-05-05 18:18:41 +02:00
|
|
|
#ifndef _SYSTEM_IO_DIRECTORYINFO_
|
|
|
|
#define _SYSTEM_IO_DIRECTORYINFO_
|
|
|
|
|
2013-06-02 14:32:43 +02:00
|
|
|
#include <System/Types.h>
|
2013-05-05 18:18:41 +02:00
|
|
|
#include "FileSystemInfo.h"
|
|
|
|
|
|
|
|
namespace System
|
|
|
|
{
|
|
|
|
namespace IO
|
|
|
|
{
|
|
|
|
class Directory;
|
|
|
|
|
2013-07-12 21:30:13 +02:00
|
|
|
/**
|
|
|
|
* Exposes instance methods for creating, moving, and enumerating through directories and subdirectories. This class cannot be inherited.
|
|
|
|
*/
|
2013-06-02 14:32:43 +02:00
|
|
|
class DirectoryInfo : public FileSystemInfo
|
2013-05-05 18:18:41 +02:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
friend class Directory;
|
|
|
|
|
2013-06-02 14:32:43 +02:00
|
|
|
String current;
|
|
|
|
String parent;
|
2013-05-05 18:18:41 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
bool Exists() const;
|
2013-06-02 14:32:43 +02:00
|
|
|
String getName() const;
|
2013-10-04 22:15:52 +02:00
|
|
|
DirectoryInfo* getParent() const;
|
|
|
|
DirectoryInfo* getRoot() const;
|
2013-05-05 18:18:41 +02:00
|
|
|
|
|
|
|
DirectoryInfo();
|
|
|
|
DirectoryInfo(const String& path); // Initializes a new instance of the System::IO::DirectoryInfo class on the specified path.
|
|
|
|
|
2013-10-04 22:15:52 +02:00
|
|
|
/**
|
|
|
|
* Creates a directory.
|
|
|
|
*/
|
2013-05-05 18:18:41 +02:00
|
|
|
void Create();
|
2013-10-04 22:15:52 +02:00
|
|
|
/**
|
|
|
|
* Creates a subdirectory or subdirectories on the specified path.
|
|
|
|
* The specified path can be relative to this instance of the System::IO::DirectoryInfo class.
|
|
|
|
*/
|
2013-05-05 18:18:41 +02:00
|
|
|
DirectoryInfo CreateSubDirectory(const String& path);
|
2013-10-04 22:15:52 +02:00
|
|
|
/**
|
|
|
|
* Deletes this System::IO::DirectoryInfo if it is empty.
|
|
|
|
*/
|
2013-05-05 18:18:41 +02:00
|
|
|
void Delete();
|
2013-10-04 22:15:52 +02:00
|
|
|
/**
|
|
|
|
* Deletes this instance of a System::IO::DirectoryInfo, specifying whether to delete subdirectories and files.
|
|
|
|
*/
|
2013-05-05 18:18:41 +02:00
|
|
|
void Delete(const bool recursive);
|
|
|
|
DirectoryInfo* GetDirectories(); //
|
|
|
|
DirectoryInfo* GetDirectories(const String& searchPattern);
|
|
|
|
FileSystemInfo* GetFileSystemInfos();
|
|
|
|
FileSystemInfo* GetFileSystemInfos(const String& searchPattern);
|
2013-07-12 21:30:13 +02:00
|
|
|
static const Type& GetType();
|
2013-05-05 18:18:41 +02:00
|
|
|
void MoveTo(const String& destDirName);
|
2013-07-11 20:00:07 +02:00
|
|
|
const String ToString() const;
|
2013-05-05 18:18:41 +02:00
|
|
|
|
|
|
|
bool operator !=(const DirectoryInfo& right) const;
|
|
|
|
bool operator ==(const DirectoryInfo& right) const;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //_SYSTEM_IO_DIRECTORYINFO_
|