it_bus_pdk/xml_attribute_writer.h

00001 #ifndef _IT_BUS_PDK_XML_ATTRIBUTE_WRITER_H_
00002 #define _IT_BUS_PDK_XML_ATTRIBUTE_WRITER_H_
00003 
00004 // @Copyright 2004 IONA Technologies, Plc. All Rights Reserved.
00005 //
00006 
00007 #include <it_bus/types.h>
00008 #include <it_bus/api_defines.h>
00009 #include <it_bus/xml_output_stream.h>
00010 #include <it_bus/binary_type.h>
00011 #include <it_bus/nillable_value_base.h>
00012 
00013 namespace IT_Bus
00014 {
00015     class IT_BUS_XML_API XMLAttributeWriter
00016     {
00017       public:
00018 
00019         static void write(
00020             XMLOutputStream & stream,
00021             const String & name,
00022             const String& sz
00023         );
00024 
00025         static void write(
00026             XMLOutputStream & stream,
00027             const String & name,
00028             const Boolean bFlag
00029         );
00030 
00031         static void write(
00032             XMLOutputStream & stream,
00033             const String & name,
00034             const Float number
00035         );
00036 
00037         static void write(
00038             XMLOutputStream & stream,
00039             const String & name,
00040             const Double number
00041         );
00042 
00043         static void write(
00044             XMLOutputStream & stream,
00045             const String & name,
00046             const Int number
00047         );
00048 
00049         static void write(
00050             XMLOutputStream & stream,
00051             const String & name,
00052             const Long number
00053         );
00054 
00055         static void write(
00056             XMLOutputStream & stream,
00057             const String & name,
00058             const Short number
00059         );
00060 
00061         static void write(
00062             XMLOutputStream & stream,
00063             const String & name,
00064             const UInt number
00065         );
00066 
00067         static void write(
00068             XMLOutputStream & stream,
00069             const String & name,
00070             const ULong number
00071         );
00072 
00073         static void write(
00074             XMLOutputStream & stream,
00075             const String & name,
00076             const UShort number
00077         );
00078 
00079         static void write(
00080             XMLOutputStream & stream,
00081             const String & name,
00082             const Byte number
00083         );
00084 
00085         static void write(
00086             XMLOutputStream & stream,
00087             const String & name,
00088             const UByte number
00089         );
00090 
00091         static void write(
00092             XMLOutputStream & stream,
00093             const String & name,
00094             const DateTime & time
00095         );
00096 
00097         static void write(
00098             XMLOutputStream & stream,
00099             const String & name,
00100             const Decimal & fixed
00101         );
00102 
00103         static void write(
00104             XMLOutputStream & stream,
00105             const String & name,
00106             const BinaryInParam & data
00107         );
00108 
00109     private:
00110 
00111         XMLAttributeWriter();
00112 
00113         ~XMLAttributeWriter();
00114 
00115         XMLAttributeWriter&
00116         operator=(
00117             const XMLAttributeWriter & rhs
00118         );
00119 
00120         XMLAttributeWriter(
00121             const XMLAttributeWriter & rhs
00122         );
00123     };
00124 
00125 
00126     template<typename T>
00127     class XMLAttributeNillableWriter : public XMLAttributeWriter
00128     {
00129     public:
00130         static
00131         void write(
00132             XMLOutputStream & stream,
00133             const String & name,
00134             const NillableValueBase<T> & data
00135         )
00136         {
00137             if (!data.is_nil())
00138             {
00139                 XMLAttributeWriter::write(
00140                     stream, 
00141                     name, 
00142                     data.get()
00143                 );
00144             }
00145         };
00146     private:
00147 
00148         XMLAttributeNillableWriter();
00149 
00150         XMLAttributeNillableWriter&
00151         operator=(
00152             const XMLAttributeNillableWriter & rhs
00153         );
00154 
00155         XMLAttributeNillableWriter(
00156             const XMLAttributeNillableWriter & rhs
00157         );
00158     };
00159 }
00160 
00161 #endif  

Generated on Thu Sep 7 11:39:37 2006 for Artix by  doxygen 1.4.7