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