Create needed functions for common attributes and their extensions
This commit is contained in:
@@ -8,6 +8,22 @@ type CommonAttributes struct {
|
||||
UndefinedAttributes []*ExtensionAttribute `xml:",any"`
|
||||
}
|
||||
|
||||
// NewCommonAttributes creates a new set of CommonAttributes. It returns a
|
||||
// *CommonAttributes.
|
||||
func NewCommonAttributes() *CommonAttributes {
|
||||
return new(CommonAttributes)
|
||||
}
|
||||
|
||||
// AddExtensionAttribute adds the ExtensionAttribute to the CommonAttributes.
|
||||
func (c *CommonAttributes) AddExtensionAttribute(e *ExtensionAttribute) {
|
||||
if c.UndefinedAttributes == nil {
|
||||
c.UndefinedAttributes = make([]*ExtensionAttribute, 1)
|
||||
c.UndefinedAttributes[0] = e
|
||||
} else {
|
||||
c.UndefinedAttributes = append(c.UndefinedAttributes, e)
|
||||
}
|
||||
}
|
||||
|
||||
// Check checks the CommonAttributes for incompatibilities with RFC4287. It
|
||||
// returns an error.
|
||||
func (c *CommonAttributes) Check() error {
|
||||
|
Reference in New Issue
Block a user