Fixed/hacked 'no parameter' for 0.2.7 keyword compatability;

Added 'just_header' flag to make stylesheet list load faster;
Added versioning and dependency support to packages

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@320 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-05-05 23:19:52 +00:00
parent e7bc7438b8
commit 6feef4feb0
11 changed files with 146 additions and 22 deletions
+21 -1
View File
@@ -17,6 +17,7 @@ class Package;
class wxFileInputStream;
class wxZipInputStream;
class wxZipEntry;
DECLARE_POINTER_TYPE(PackageDependency);
/// The package that is currently being written to
DECLARE_DYNAMIC_ARG(Package*, writing_package);
@@ -175,6 +176,15 @@ class Package {
// ----------------------------------------------------------------------------- : Packaged
/// Dependencies of a package
class PackageDependency {
public:
String package; ///< Name of the package someone depends on
Version version; ///< Minimal required version of that package
DECLARE_REFLECTION();
};
/// Utility class for data types that are always stored in a package.
/** When the package is opened/saved a file describing the data object is read/written
*/
@@ -183,15 +193,21 @@ class Packaged : public Package {
Packaged();
virtual ~Packaged() {}
Version version; ///< Version number of this package
String short_name; ///< Short name of this package
String full_name; ///< Name of this package, for menus etc.
String icon_filename; ///< Filename of icon to use in package lists
vector<PackageDependencyP> dependencies; ///< Dependencies of this package
/// Get an input stream for the package icon, if there is any
InputStreamP openIconFile();
/// Open a package, and read the data
void open(const String& package);
/** if just_header is true, then the package is not fully parsed.
*/
void open(const String& package, bool just_header = false);
/// Ensure the package is fully loaded.
void loadFully();
void save();
void saveAs(const String& package);
@@ -202,6 +218,10 @@ class Packaged : public Package {
virtual void validate(Version file_app_version);
DECLARE_REFLECTION_VIRTUAL();
private:
bool fully_loaded; ///< Is the package fully loaded?
friend struct JustAsPackageProxy;
};
// ----------------------------------------------------------------------------- : EOF