ScummVM API documentation
library.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#ifndef AGS_ENGINE_UTIL_LIBRARY_H
23#define AGS_ENGINE_UTIL_LIBRARY_H
24
25#include "ags/shared/core/platform.h"
26#include "ags/shared/util/string.h"
27
28namespace AGS3 {
29namespace AGS {
30namespace Engine {
31
32using AGS::Shared::String;
33
35public:
36 BaseLibrary() {}
37
38 virtual ~BaseLibrary() {}
39
40 // Get library name; returns empty string if not loaded
41 inline String GetName() const { return _name; }
42 // Get actual filename; returns empty string if not loaded
43 inline String GetFileName() const { return _filename; }
44 // Get path used to load the library; or empty string is not loaded.
45 // NOTE: this is NOT a fully qualified path, but a lookup path.
46 inline String GetPath() const { return _path; }
47
48 // Returns expected filename form for the dynamic library of a given name
49 virtual String GetFilenameForLib(const String &libname) = 0;
50
51 // Try load a library of a given name
52 virtual bool Load(const String &libname) = 0;
53 // Unload a library; does nothing if was not loaded
54 virtual void Unload() = 0;
55 // Tells if library is loaded
56 virtual bool IsLoaded() const = 0;
57
58protected:
59 String _name;
60 String _filename;
61 String _path;
62};
63
64} // namespace Engine
65} // namespace AGS
66} // namespace AGS3
67
68#endif
Definition: library.h:34
Definition: string.h:60
Definition: engine.h:149