00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #if !defined(_BASICTYPESERIALIZER_H____OF_AXIS_INCLUDED_)
00018 #define _BASICTYPESERIALIZER_H____OF_AXIS_INCLUDED_
00019
00020 #include "TypeMapping.h"
00021 #include "AxisTime.h"
00022 #include <string>
00023 using namespace std;
00024
00025 #define BTS_BUFFSIZE 32
00026 const AxisChar XML_ENTITY_REFERENCE_CAHRS[] = "<>&\"\'";
00027
00028 const AxisChar ENCODED_LESSER_STR[] = "<";
00029
00030 const AxisChar ENCODED_GREATOR_STR[] = ">";
00031
00032 const AxisChar ENCODED_AMPERSAND_STR[] = "&";
00033
00034 const AxisChar ENCODED_DBL_QUOTE_STR[] = """;
00035
00036 const AxisChar ENCODED_SGL_QUOTE_STR[] = "'";
00037
00038
00039
00040
00041
00042
00043
00044
00045 class BasicTypeSerializer
00046 {
00047 public:
00048 BasicTypeSerializer();
00049 virtual ~BasicTypeSerializer();
00050 const AxisString& getEntityReferenced(const AxisString& str);
00051 const AxisChar* serializeAsElement(const AxisChar* pName,
00052 const void* pValue, XSDTYPE type);
00053 const AxisChar* serializeAsAttribute(const AxisChar* pName,
00054 const AxisChar* pPrefix, const void* pValue, XSDTYPE type);
00055 const AxisChar* encodeToHexBinary(const xsd__hexBinary* pBinary);
00056 const AxisChar* encodeToBase64Binary(const xsd__base64Binary* pBinary);
00057 void setStyle(AXIS_BINDING_STYLE nStyle){ m_nStyle = nStyle;};
00058 static const AxisChar* basicTypeStr(XSDTYPE type);
00059
00060 private:
00061 enum
00062 {
00063 GREATOR_THAN_CHAR = L'>',
00064 LESSER_THAN_CHAR = L'<',
00065 SINGLE_QUOTE_CHAR = L'\'',
00066 DOUBLE_QUOTE_CHAR = L'\"',
00067 AMPERSAND_CHAR = L'&'
00068 };
00069 private:
00070 AxisString m_sSZ;
00071 AxisString m_AuxStr;
00072 AxisString m_strReturnVal;
00073 AxisChar m_Buf[BTS_BUFFSIZE];
00074
00075 AxisTime m_AxisTime;
00076
00077 AXIS_BINDING_STYLE m_nStyle;
00078 };
00079
00080 #endif
00081