00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GROUP_H
00022 #define GROUP_H
00023
00024
00025
00026 #include <string>
00027 #include "schemaparser/Schema.h"
00028 #include "schemaparser/ContentModel.h"
00029
00030 namespace Schema {
00031
00032 class Group
00033 {
00034 public:
00035 Group();
00036 ~Group();
00037 Group(const Group & g);
00038 Group(const std::string & name,
00039 int minimum,
00040 int maximum);
00041 int getMin()const;
00042 void setMin(int m);
00043
00044 int getMax() const;
00045 void setMax(int m);
00046
00047 std::string getName()const;
00048 void setName(const std::string & n);
00049
00050 void setAnnotation(const std::string & s);
00051 ContentModel * getContents()const;
00052 void setContents(const ContentModel* cm,bool isRef=false);
00053 private:
00054 int maxOccurs_;
00055 int minOccurs_;
00056 std::string name_;
00057 std::string annotation_;
00058 ContentModel * cm_;
00059 bool ref_;
00060 };
00061
00062
00063 inline
00064 std::string
00065 Group::getName()const
00066 {
00067 return name_;
00068 }
00069
00070 inline
00071 void
00072 Group::setName(const std::string &n)
00073 {
00074 name_=n;
00075 }
00076
00077 inline
00078 void
00079 Group::setAnnotation(const std::string &s)
00080 {
00081 annotation_=s;
00082 }
00083
00084 inline
00085 int
00086 Group::getMax() const
00087 {
00088 return maxOccurs_;
00089 }
00090
00091 inline
00092 int
00093 Group::getMin() const
00094 {
00095 return minOccurs_;
00096 }
00097
00098 inline
00099 void
00100 Group::setMin(int m)
00101 {
00102 minOccurs_=m;
00103
00104 }
00105
00106 inline
00107 void
00108 Group::setMax(int m)
00109 {
00110 maxOccurs_=m;
00111
00112 }
00113
00114 inline
00115 ContentModel *
00116 Group::getContents()const
00117 {
00118 return cm_;
00119
00120 }
00121
00122 inline
00123 void
00124 Group::setContents(const ContentModel* cm,bool setRef)
00125 {
00126 cm_=const_cast<ContentModel*> (cm);
00127 ref_=setRef;
00128 }
00129
00130 }
00131 #endif // GROUP_H