ScummVM API documentation
file.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22//=============================================================================
23//
24// Script File API implementation.
25//
26//=============================================================================
27
28#ifndef AGS_ENGINE_AC_FILE_H
29#define AGS_ENGINE_AC_FILE_H
30
31#include "common/std/memory.h"
32#include "ags/engine/ac/dynobj/script_file.h"
33#include "ags/engine/ac/runtime_defines.h"
34
35namespace AGS3 {
36
37using AGS::Shared::Stream;
38
39int File_Exists(const char *fnmm);
40int File_Delete(const char *fnmm);
41void *sc_OpenFile(const char *fnmm, int mode);
42const char *File_ResolvePath(const char *fnmm);
43void File_Close(sc_File *fil);
44void File_WriteString(sc_File *fil, const char *towrite);
45void File_WriteInt(sc_File *fil, int towrite);
46void File_WriteRawChar(sc_File *fil, int towrite);
47void File_WriteRawInt(sc_File *fil, int towrite);
48void File_WriteRawLine(sc_File *fil, const char *towrite);
49void File_ReadRawLine(sc_File *fil, char *buffer);
50const char *File_ReadRawLineBack(sc_File *fil);
51void File_ReadString(sc_File *fil, char *toread);
52const char *File_ReadStringBack(sc_File *fil);
53int File_ReadInt(sc_File *fil);
54int File_ReadRawChar(sc_File *fil);
55int File_ReadRawInt(sc_File *fil);
56int File_Seek(sc_File *fil, int offset, int origin);
57int File_GetEOF(sc_File *fil);
58int File_GetError(sc_File *fil);
59int File_GetPosition(sc_File *fil);
60
63 int32_t handle = 0;
64};
65
66ScriptFileHandle *check_valid_file_handle_ptr(Stream *stream_ptr, const char *operation_name);
67ScriptFileHandle *check_valid_file_handle_int32(int32_t handle, const char *operation_name);
68Stream *get_valid_file_stream_from_handle(int32_t handle, const char *operation_name);
69
70} // namespace AGS3
71
72#endif
Definition: stream.h:52
Definition: ptr.h:572
Definition: file.h:61