ScummVM API documentation
res_man_pc.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 * Additional copyright for this file:
8 * Copyright (C) 1999-2000 Revolution Software Ltd.
9 * This code is based on source code created by Revolution Software,
10 * used with permission.
11 *
12 * This program is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 *
25 */
26
27#ifndef ICB_RES_MAN_PC_H
28#define ICB_RES_MAN_PC_H
29
30#include "engines/icb/debug.h"
31#include "engines/icb/common/px_string.h"
32
33#include "common/stream.h"
34#include "common/file.h"
35
36namespace ICB {
37
38bool checkFileExists(const char *fullpath);
39
40Common::SeekableReadStream *openDiskFileForBinaryStreamRead(const Common::String &filename);
41Common::WriteStream *openDiskWriteStream(const Common::String &filename);
42inline int32 SameUrl(const char *urla, const uint32 urla_hash, const uint32 clustera_hash, const char *urlb, const uint32 urlb_hash, const uint32 clusterb_hash) {
43 // If urls are provided then the hash values should be identical if the strings are the same, and not if not
44 if ((urla) && (urlb)) {
45 if (strcmp(urla, urlb) == 0) {
46 if (urla_hash != urlb_hash)
47 Fatal_error("Hash error in %s @ %d", __FILE__, __LINE__);
48 } else {
49 if (urla_hash == urlb_hash)
50 Fatal_error("Hash error in %s @ %d", __FILE__, __LINE__);
51 }
52 }
53
54 // For clustering we just check the hashes
55 if (clustera_hash != clusterb_hash)
56 return 0;
57 if (urla_hash != urlb_hash)
58 return 0;
59 return 1;
60}
61
62} // End of namespace ICB
63
64#endif // #ifndef RES_MAN_PC_H
Definition: stream.h:745
Definition: str.h:59
Definition: stream.h:77