Files
source/VFS/iteratedir.h
T
Wanne 06a2af0fa6 Win 98 VFS Fixes (by BirdFlu)
- add ini option to disable UNICODE in VFS (and use the current codepage)
- when UNICODE disabled in VFS, open files with default encoding (instead of UTF8/16) filenames


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3118 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2009-07-20 08:14:37 +00:00

57 lines
1.0 KiB
C++

//
// Snap: Declaration of the TReadDir class
// This class reads the contents of a directory file-by-file
//
#ifndef _ITERATEDIR_H_
#define _ITERATEDIR_H_
#ifdef WIN32
#include <windows.h>
#else
#include <sys/types.h>
#include <sys/dir.h>
#include <unistd.h>
#include <stdio.h>
#endif
#include "vfs_types.h"
namespace os
{
class CIterateDirectory
{
public:
enum EFileAttribute
{
FA_DIRECTORY,
FA_FILE
};
public:
CIterateDirectory(vfs::Path const& sPath, utf8string const& searchPattern);
~CIterateDirectory();
bool NextFile(utf8string &fileName, CIterateDirectory::EFileAttribute &attrib);
private:
#ifdef WIN32
HANDLE fSearchHandle;
union
{
WIN32_FIND_DATAA fFileInfoA;
WIN32_FIND_DATAW fFileInfoW;
};
#else
struct direct **files;
int count, current_pos;
#endif
bool fFirstRequest;
};
bool CreateRealDirecory(vfs::Path &sDir, bool bDoNotCreate=false);
bool DeleteRealFile(vfs::Path &sDir);
}; // end namespace
#endif // #ifndef _ITERATEDIR_H_