lib: show offset and rectype in HexDumpParser
[barry.git] / src / a_osloader.h
blob4a42d3b23eb21d0dc2de07a4117f7152ce22a096
1 ///
2 /// \file a_osloader.h
3 /// OS files parser (multi ALX files parser)
4 ///
6 /*
7 Copyright (C) 2010, Nicolas VIVIEN
8 Copyright (C) 2005-2010, Net Direct Inc. (http://www.netdirect.ca/)
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 See the GNU General Public License in the COPYING file at the
20 root directory of this project for more details.
23 #ifndef __BARRY_A_OSLOADER_H__
24 #define __BARRY_A_OSLOADER_H__
26 #include <iostream>
27 #include <vector>
28 #include <map>
30 #include "dll.h"
31 #include "a_application.h"
32 #include "a_library.h"
35 #define OS_LANG_ENGLISH ""
36 #define OS_LANG_ARABIC "0x0001"
37 #define OS_LANG_CATALAN "0x0003"
38 #define OS_LANG_CZECH "0x0005"
39 #define OS_LANG_GERMAN "0x0007"
40 #define OS_LANG_SPANISH "0x000a"
41 #define OS_LANG_FRENCH "0x000c"
42 #define OS_LANG_HEBREW "0x000d"
43 #define OS_LANG_HUNGARIAN "0x000e"
44 #define OS_LANG_ITALIAN "0x0010"
45 #define OS_LANG_JAPANESE "0x0011"
46 #define OS_LANG_KOREAN "0x0012"
49 namespace Barry {
51 namespace ALX {
53 class BXEXPORT OSLoader
55 private:
56 std::string sfifile;
57 std::vector<CODSection *> applications;
58 std::vector<CODSection *> libraries;
59 std::map<std::string, std::string> properties;
61 public:
62 OSLoader(void);
63 ~OSLoader(void);
65 void Load(const std::string& path);
66 /// Load ALX file, and if enable is true, register the applications
67 /// and libraries found inside it with this OSLoader class.
68 void LoadALXFile(const std::string& alxfile, const bool enable=true);
70 void Dump(std::ostream &os) const;
72 void AddProperties(const std::string& property, const std::string& value);
73 void AddProperties(const xmlpp::SaxParser::AttributeList& attrs);
74 void SetSFIFile(const std::string& name);
75 bool IsSupported(const xmlpp::SaxParser::AttributeList& attrs);
76 void AddApplication(CODSection *app);
77 void AddLibrary(CODSection *lib);
81 inline std::ostream& operator<<(std::ostream& os, const OSLoader& osloader)
83 osloader.Dump(os);
84 return os;
88 } // namespace ALX
90 } // namespace Barry
92 #endif