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 _VALUE_PARSER_H 00014 #define _VALUE_PARSER_H 00015 00016 #include <xml/XMLParser.h> 00017 #include <support/Package.h> 00018 00019 #if _SUPPORTS_NAMESPACE 00020 namespace palmos { 00021 namespace xml { 00022 #endif 00023 00024 // ================================================================== 00025 class BXML2ValueCreator : public BCreator 00026 { 00027 public: 00028 BXML2ValueCreator(SValue &targetValue, const SValue &attributes, const SPackage& resources = B_NO_PACKAGE, const SValue &references = B_UNDEFINED_VALUE); 00029 00030 virtual status_t OnStartTag( SString & name, 00031 SValue & attributes, 00032 sptr<BCreator> & newCreator ); 00033 00034 virtual status_t OnEndTag( SString & name ); 00035 00036 virtual status_t OnText( SString & data ); 00037 00038 virtual status_t Done(); 00039 00040 private: 00041 static status_t ParseSignedInteger (const BNS(palmos::support::) SString &from, int64_t maximum, int64_t *val); 00042 SPackage m_resources; 00043 BNS(palmos::support::) SValue &m_targetValue; 00044 BNS(palmos::support::) SValue m_key; 00045 BNS(palmos::support::) SValue m_value; 00046 BNS(palmos::support::) SString m_data; 00047 BNS(palmos::support::) SString m_dataType; 00048 status_t m_status; 00049 SValue m_references; 00050 type_code m_rawTypeCode; 00051 size_t m_rawSize; 00052 int32_t m_resID; 00053 int32_t m_strIndex; 00054 bool m_isReference : 1; 00055 00056 int32_t m_id; 00057 }; 00058 00059 #if _SUPPORTS_NAMESPACE 00060 } } // palmos::xml 00061 #endif 00062 00063 #endif