Bumped copyright dates for 2013
[barry.git] / src / a_osloader.h
blob3365fc5348b0f34ff4f02a8c05e38ce8ea40f072
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-2013, 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"
33 #include <tr1/memory>
36 #define OS_LANG_ENGLISH ""
37 #define OS_LANG_ARABIC "0x0001"
38 #define OS_LANG_CATALAN "0x0003"
39 #define OS_LANG_CZECH "0x0005"
40 #define OS_LANG_GERMAN "0x0007"
41 #define OS_LANG_SPANISH "0x000a"
42 #define OS_LANG_FRENCH "0x000c"
43 #define OS_LANG_HEBREW "0x000d"
44 #define OS_LANG_HUNGARIAN "0x000e"
45 #define OS_LANG_ITALIAN "0x0010"
46 #define OS_LANG_JAPANESE "0x0011"
47 #define OS_LANG_KOREAN "0x0012"
50 namespace Barry {
52 namespace ALX {
54 class BXEXPORT OSLoader
56 public:
57 typedef std::tr1::shared_ptr<CODSection> CODSectionPtr;
58 typedef std::vector<CODSectionPtr> CODSectionList;
59 typedef std::map<std::string, std::string> PropertyMap;
61 private:
62 std::string sfifile;
63 CODSectionList applications;
64 CODSectionList libraries;
65 PropertyMap properties;
67 public:
68 OSLoader(void);
69 ~OSLoader(void);
71 void Load(const std::string& path);
72 /// Load ALX file, and if enable is true, register the applications
73 /// and libraries found inside it with this OSLoader class.
74 void LoadALXFile(const std::string& alxfile, const bool enable=true);
76 void Dump(std::ostream &os) const;
78 void AddProperties(const std::string& property, const std::string& value);
79 void AddProperties(const xmlpp::SaxParser::AttributeList& attrs);
80 void SetSFIFile(const std::string& name);
81 bool IsSupported(const xmlpp::SaxParser::AttributeList& attrs);
82 void AddApplication(CODSectionPtr app);
83 void AddLibrary(CODSectionPtr lib);
87 inline std::ostream& operator<<(std::ostream& os, const OSLoader& osloader)
89 osloader.Dump(os);
90 return os;
94 } // namespace ALX
96 } // namespace Barry
98 #endif