Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members Related Pages

# xml_serializer_base.h

Go to the documentation of this file.

    00001 /* -*- c++ -*- */
    00002 #ifndef AKAXISO2_XML_SERIALIZER_XML_SERIALIZER_BASE_H__
    00003 #define AKAXISO2_XML_SERIALIZER_XML_SERIALIZER_BASE_H__
    00004
    00010 #include <akaxiso2/XML/serializer/serializer.h>
    00011 #include <akaxiso2/framework/operators.h>
    00012 #include <akaxiso2/framework/entity_complements.h>
    00013
    00014 namespace aka2 {
    00015
    00016   struct wildcard;
    00017   typedef std::vector<wildcard> wc_array;
    00018
    00025   class xml_serializer_base : public serializer {
    00026   public:
    00027     explicit xml_serializer_base(const std::string &encoding)
    00028       : serializer(2), encoding_(encoding), ns11_enabled_(true) {};
    00029     virtual ~xml_serializer_base();
    00030
    00035     void enable_ns11(bool value) { ns11_enabled_ = value; }
    00036
    00037   private:
    00038     std::string encoding_;
    00039     bool ns11_enabled_;
    00040
    00041     virtual void serialize_internal(const void *e, const element_props &props,
    00042                                     const qname &name);
    00043
    00044     void write_element(const void *e, const element_props &props, const element_op &op);
    00045     void write_element_entity(const void *e, const element_props &props, const element_op &op);
    00046
    00047     void write_sequence(const qname &tagname,
    00048                         const void *e, const sequence_op &sop);
    00049     void write_sequence_entity(const void *e, const sequence_op &sop);
    00050
    00051     void write_choice(const qname &tagname,
    00052                       const void *e, const choice_op &sop);
    00053     void write_choice_entity(const void *e, const choice_op &sop);
    00054
    00055     void write_all(const qname &tagname,
    00056                    const void *e, const all_op &sop);
    00057     void write_all_entity(const void *e, const all_op &sop);
    00058
    00059     void write_simplecontent(const qname &tagname,
    00060                              const void *e, const simplecontent_op &sop);
    00061     void write_array(const void *e, const element_props &props, const array_op &aop);
    00062     void write_group_array(const void *e, const element_props &props, const array_op &aop);
    00063     void write_ptrmember(const void *e, const element_props &props);
    00064     void write_ptrmember_entity(const void *e, const element_props &props);
    00065
    00066     void write_simpletype(const qname &tagname,
    00067                           const void *e, const simpletype_op &sop);
    00068
    00069     void write_fixed_simpletype(const element_props &props);
    00070
    00071
    00072     void write_nill_element(const qname &tagname,
    00073                             const void *e, const element_op &op);
    00074     void write_beginning_tag(const qname& tagname,
    00075                              const void *e, const element_op &op);
    00076     void write_ending_tag(const qname &tagname);
    00077
    00078     void write_attributes(const void *e, const element_op &op);
    00079     void write_namespace_attributes();
    00080     void write_ns(id_type nsid);
    00081     void write_ns11_declaration(const qname &tagname, const element_op &op, const void *e);
    00082
    00083     void write_any(const element_props &props, const any &an);
    00084     void write_any_array(const element_props &props, const any_array &ar);
    00085     void write_wildcard(const element_props &props, const wildcard &wc);
    00086     void write_wildcard_array(const element_props &props, const wc_array &ar);
    00087     void write_anyType(const qname &tagname, const wildcard &an);
    00088     void write_anyType_array(const qname &tagname, const wc_array &ar);
    00089     void write_ns_decl_if_new(id_type nsid);
    00090   };
    00091
    00092 } // namespace aka2
    00093
    00094 #endif