aboutsummaryrefslogtreecommitdiff
path: root/examples/cxx/tree/custom/wildcard/wildcard-custom.hxx
blob: 2c58cc890703f3809c03ec06fcef79c933230be4 (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
59
60
61
62
63
64
65
66
67
// file      : examples/cxx/tree/custom/wildcard/wildcard-custom.hxx
// author    : Boris Kolpackov <boris@codesynthesis.com>
// copyright : not copyrighted - public domain

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

namespace wildcard
{
  class data: public data_base
  {
    // Standard constructors.
    //
  public:
    data (const xml_schema::string&);

    data (const xercesc::DOMElement&,
          xml_schema::flags = 0,
          xml_schema::container* = 0);

    data (const data&,
          xml_schema::flags = 0,
          xml_schema::container* = 0);

    virtual data*
    _clone (xml_schema::flags = 0,
            xml_schema::container* = 0) const;

    // Our customizations.
    //
  public:
    bool
    scope_present () const
    {
      return scope_present_;
    }

    const xml_schema::string&
    scope () const
    {
      return scope_;
    }

    void
    scope (const xml_schema::string& s)
    {
      scope_present_ = true;
      scope_ = s;
    }

  private:
    bool scope_present_;
    xml_schema::string scope_;
  };

  // Serialization operator.
  //
  void
  operator<< (xercesc::DOMElement&, const data&);

  // std::ostream insertion operator.
  //
  std::ostream&
  operator<< (std::ostream&, const data&);
}