nomlib
Toggle main menu visibility
Loading...
Searching...
No Matches
include
nomlib
gui
RocketFileInterface.hpp
1
/******************************************************************************
2
3
nomlib - C++11 cross-platform game engine
4
5
Copyright (c) 2013, 2014 Jeffrey Carpenter <i8degrees@gmail.com>
6
All rights reserved.
7
8
Redistribution and use in source and binary forms, with or without
9
modification, are permitted provided that the following conditions are met:
10
11
1. Redistributions of source code must retain the above copyright notice, this
12
list of conditions and the following disclaimer.
13
2. Redistributions in binary form must reproduce the above copyright notice,
14
this list of conditions and the following disclaimer in the documentation
15
and/or other materials provided with the distribution.
16
17
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28
******************************************************************************/
29
#ifndef NOMLIB_GUI_ROCKET_FILE_INTERFACE_HPP
30
#define NOMLIB_GUI_ROCKET_FILE_INTERFACE_HPP
31
32
#include <string>
33
34
#include "export.hpp"
35
#include "nomlib/config.hpp"
36
37
#include <Rocket/Core/String.h>
38
#include <Rocket/Core/FileInterface.h>
39
40
namespace
nom {
41
42
/* Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
43
*
44
* Permission is hereby granted, free of charge, to any person obtaining a copy
45
* of this software and associated documentation files (the "Software"), to deal
46
* in the Software without restriction, including without limitation the rights
47
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
48
* copies of the Software, and to permit persons to whom the Software is
49
* furnished to do so, subject to the following conditions:
50
*
51
* The above copyright notice and this permission notice shall be included in
52
* all copies or substantial portions of the Software.
53
*
54
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
55
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
56
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
57
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
58
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
59
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
60
* THE SOFTWARE.
61
*
62
*/
63
68
70
class
NOM_EXPORT RocketFileInterface:
public
Rocket::Core::FileInterface
71
{
72
public
:
73
RocketFileInterface(
const
std::string&
root
);
74
75
virtual
~RocketFileInterface();
76
80
virtual
void
Release
();
81
83
virtual
Rocket::Core::FileHandle
Open
(
const
Rocket::Core::String& path);
84
86
virtual
void
Close
(Rocket::Core::FileHandle file);
87
89
virtual
nom::size_type
Read
(
void
* buffer, nom::size_type size, Rocket::Core::FileHandle file);
90
92
virtual
bool
Seek
(Rocket::Core::FileHandle file,
long
offset,
int
origin);
93
95
virtual
nom::size_type
Tell
(Rocket::Core::FileHandle file);
96
101
std::string
root
()
const
;
102
103
private
:
104
Rocket::Core::String root_;
105
};
106
107
}
// namespace nom
108
109
#endif
// include guard defined
nom::RocketFileInterface::Close
virtual void Close(Rocket::Core::FileHandle file)
Closes a previously opened file.
nom::RocketFileInterface::Read
virtual nom::size_type Read(void *buffer, nom::size_type size, Rocket::Core::FileHandle file)
Reads data from a previously opened file.
nom::RocketFileInterface::Open
virtual Rocket::Core::FileHandle Open(const Rocket::Core::String &path)
Opens a file.
nom::RocketFileInterface::Seek
virtual bool Seek(Rocket::Core::FileHandle file, long offset, int origin)
Seeks to a point in a previously opened file.
nom::RocketFileInterface::Release
virtual void Release()
Implements Rocket::Core::FileInterface::Release.
nom::RocketFileInterface::root
std::string root() const
Get the root directory path.
nom::RocketFileInterface::Tell
virtual nom::size_type Tell(Rocket::Core::FileHandle file)
Returns the current position of the file pointer.
Generated on
for nomlib by
1.18.0