ManifestParser.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2005 Palmsource, Inc.
00003  * 
00004  * This software is licensed as described in the file LICENSE, which
00005  * you should have received as part of this distribution. The terms
00006  * are also available at http://www.openbinder.org/license.html.
00007  * 
00008  * This software consists of voluntary contributions made by many
00009  * individuals. For the exact contribution history, see the revision
00010  * history and logs, available at http://www.openbinder.org
00011  */
00012 
00013 #ifndef _PACKAGE_MANIFESTPARSER_H
00014 #define _PACKAGE_MANIFESTPARSER_H
00015 
00016 #include <support/Package.h>
00017 #include <support/String.h>
00018 #include <support/ByteStream.h>
00019 
00020 
00021 #if _SUPPORTS_NAMESPACE
00022 namespace palmos {
00023 namespace package {
00024 #endif
00025 
00026 
00027 class SManifestParser : public SLightAtom
00028 {
00029 public:
00031     static status_t ParseManifest(const SString& filename, const sptr<SManifestParser>& parser, const sptr<IByteInput>& stream, const SPackage& resources, const SString& package);
00032 
00034     //  embedded manifest file, and calls the callbacks on a parser
00035     static status_t ParseManifestFromPackageFile(const SString& filename, const sptr<SManifestParser>& parser, const sptr<IByteInput>& stream, const SPackage& resources, const SString& package);
00036     
00038     virtual void OnDeclareAddon(const SValue& addonInfo) = 0;
00039 
00041     virtual void OnDeclareApplication(const SValue& appInfo) = 0;
00042     
00044     virtual void OnDeclareComponent(const SValue& componentInfo) = 0;
00045 };
00046 
00047 
00048 #if _SUPPORTS_NAMESPACE
00049 } } // namespace palmos::package
00050 #endif
00051 
00052 #endif // _PACKAGE_MANIFESTPARSER_H