|
#ifndef DIRECTORY_H
#define DIRECTORY_H
#if _MSC_VER > 1000
#pragma warning (disable: 4786)
#pragma warning (disable: 4748)
#pragma warning (disable: 4103)
#endif /* _MSC_VER > 1000 */
#include <afx.h>
#include <afxwin.h>
#include "ObjectList.h"
class CDirectory
{
public:
CDirectory(void);
~CDirectory(void);
// Retrieve files from a directory.
// Returns a pointer to the ObjectList. Each element is a pointer to CString
static CObjectList* GetFiles(TCHAR* szFolderPath, TCHAR* filter = _T("*.*"));
// Add, if not already present, a back slash at the end of the path
static CString AddBackSlash(TCHAR* szFolderPath);
// Extract the directory from a full path
static void ExtractDirectory(TCHAR* lpszPath, TCHAR* lpszFullPath);
// Extract only the filename from a path
static void ExtractFilename(TCHAR* lpszAppName, TCHAR* lpszPath);
// Extract only the extension from a filename
static CString ExtractExtension(TCHAR* lpszFilename);
// Cut away the extension from a filename
static CString CutExtension(TCHAR* lpszFilename);
// Path creation
static bool CreateFileOrDirFullPath(TCHAR* lpSourcePath, bool bIsDir);
// Get the current process directory
static CString GetApplicationDirectory();
// Delete all files of a given kind
static bool DeleteGivenFilesInGivenFolder(TCHAR* pczRetFileFullFolderPath, TCHAR* pczExtension);
// Delete given file
static bool DeleteGivenFile(TCHAR* pczRetFileFullFolderPath);
};
#endif /* ! defined(DIRECTORY_H) */
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Senior Software Developer in C/C++ and Oracle.
Ex-physicist holding a Ph.D. on x-ray lasers.