aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/File.h
blob: 0b710cd4610116c30c1ef55a61e3909dc8a6cc72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
using namespace std;
// 4J Stu - Represents java standard library class

class FileFilter;

class File
{
public:
	//The system-dependent path-separator character
	static const wchar_t pathSeparator;

	// 4J Jev, the start of the file root
	static const wstring pathRoot;

	File() { m_abstractPathName = L""; }

	File( const File &parent, const wstring& child );
	File( const wstring& pathname );
	File( const wstring& parent, const wstring& child  );
	bool _delete();
	bool mkdir() const;
	bool mkdirs() const;
	bool exists() const;
	bool isFile() const;
	bool renameTo(File dest);
	vector<File *> *listFiles() const; // Array
	vector<File *> *listFiles(FileFilter *filter) const;
	bool isDirectory() const;
	__int64 length();
	__int64 lastModified();
	const wstring getPath() const; // 4J Jev: TODO
	wstring getName() const;

	static int hash_fnct(const File &k);
	static bool eq_test(const File &x, const File &y);

private:
	void _init();
	wstring m_abstractPathName;

	// 4J Jev, just helper functions, change between paths and vector<string>
	//File(vector<wstring> *path);
};

typedef struct
{
	int operator() (const File &k) const { return File::hash_fnct(k); }

} FileKeyHash;

typedef struct
{
	bool operator() (const File &x, const File &y) const {return File::eq_test(x,y); }

} FileKeyEq;