mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
**********************************************************
** Big Maps Projects code (incl. Multiplayer v1.5 ** ********************************************************** - Merged Big Maps Project code from BMP+MP trunk (Revision: 3340) o Complete SVN Revision history: https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP - Before THIS merge, I made a branch of the existing 1.13 source o SVN Branch: https://81.169.133.124/source/ja2/branches/JA2_rev.3336/src - Removed old VS 6.0 and VS 2003 project and solutions files, because compilation is broken long time ago - I will add VS 2010 projects and solution file in the next few days git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3341 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
#ifndef _OS_FUNCTIONS_H_
|
||||
#define _OS_FUNCTIONS_H_
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/dir.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#include "vfs_config.h"
|
||||
#include "vfs_types.h"
|
||||
#include "vfs_path.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;
|
||||
};
|
||||
|
||||
class FileAttributes
|
||||
{
|
||||
public:
|
||||
enum Attributes
|
||||
{
|
||||
ATTRIB_INVALID = 0,
|
||||
ATTRIB_ARCHIVE = 1,
|
||||
ATTRIB_DIRECTORY = 2,
|
||||
ATTRIB_HIDDEN = 4,
|
||||
ATTRIB_NORMAL = 8,
|
||||
ATTRIB_READONLY = 16,
|
||||
ATTRIB_SYSTEM = 32,
|
||||
ATTRIB_TEMPORARY = 64,
|
||||
ATTRIB_COMPRESSED = 128,
|
||||
ATTRIB_OFFLINE = 256,
|
||||
};
|
||||
bool getFileAttributes(vfs::Path const& sDir, vfs::UInt32& uiAttribs);
|
||||
};
|
||||
|
||||
|
||||
VFS_API bool createRealDirectory(vfs::Path const& sDir, bool bDoNotCreate=false);
|
||||
|
||||
bool deleteRealFile(vfs::Path const& sDir);
|
||||
|
||||
VFS_API void getExecutablePath(vfs::Path& sDir, vfs::Path& sFile);
|
||||
VFS_API void getCurrentDirectory(vfs::Path& sDir);
|
||||
VFS_API void setCurrectDirectory(vfs::Path const& sPath);
|
||||
|
||||
}; // end namespace
|
||||
|
||||
#endif // _OS_FUNCTIONS_H_
|
||||
|
||||
Reference in New Issue
Block a user