File: RocketFileInterface.h

package info (click to toggle)
freespace2 24.2.0%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 43,716 kB
  • sloc: cpp: 595,001; ansic: 21,741; python: 1,174; sh: 457; makefile: 248; xml: 181
file content (45 lines) | stat: -rw-r--r-- 1,116 bytes parent folder | download | duplicates (2)
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
#pragma once
//
//

#include "globalincs/pstypes.h"

// Our Assert conflicts with the definitions inside libRocket
#pragma push_macro("Assert")
#undef Assert

#include <Rocket/Core/FileInterface.h>

#pragma pop_macro("Assert")

namespace scpui {

class RocketFileInterface : public Rocket::Core::FileInterface {
  public:
	RocketFileInterface();

	/**
	 * @brief Opens the specified file using the CFile system
	 *
	 * @details The path is split into a directory path and a file name. If the directory path is not valid then the
	 * file will not be opened.
	 *
	 * @param path
	 * @return
	 */
	Rocket::Core::FileHandle Open(const Rocket::Core::String& path) override;

	void Close(Rocket::Core::FileHandle file) override;

	size_t Read(void* buffer, size_t size, Rocket::Core::FileHandle file) override;

	bool Seek(Rocket::Core::FileHandle file, long offset, int origin) override;

	size_t Tell(Rocket::Core::FileHandle file) override;

	size_t Length(Rocket::Core::FileHandle file) override;

	static bool getCFilePath(const Rocket::Core::String& path, SCP_string& name, int& dir_type);
};

} // namespace scpui