summaryrefslogtreecommitdiff
path: root/examples/cxx/tree/custom/comments/xml-schema-custom.hxx
blob: 821d0ddede4b9ef5eb7bea5623ee8cf674b96214 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// file      : examples/cxx/tree/custom/comments/xml-schema-custom.hxx
// author    : Boris Kolpackov <boris@codesynthesis.com>
// copyright : not copyrighted - public domain

// Do not include this file directly, use xml-schema.hxx instead. This
// file is included into generated xml-schema.hxx so we do not need to
// guard against multiple inclusions.
//

#include <string>

namespace xml_schema
{
  // When customizing anyType always inherit from the original type.
  //
  class type: public type_base
  {
  public:
    type ();
    type (const xercesc::DOMElement&, flags = 0, container* = 0);
    type (const xercesc::DOMAttr&, flags = 0, container* = 0);
    type (const std::string&, const xercesc::DOMElement*,
          flags = 0, container* = 0);
    type (const type&, flags = 0, container* = 0);

    virtual type*
    _clone (flags = 0, container* = 0) const;

  public:
    // Comment manipulation API.
    //
    const std::string&
    comment () const
    {
      return comment_;
    }

    void
    comment (const std::string& c)
    {
      comment_ = c;
    }

  private:
    std::string comment_;
  };

  // New serialization operators.
  //
  void
  operator<< (xercesc::DOMElement&, const type&);

  void
  operator<< (xercesc::DOMAttr&, const type&);

  void
  operator<< (xml_schema::list_stream&, const type&);
}