mirror of
https://github.com/unidoc/unioffice.git
synced 2025-05-14 19:29:48 +08:00

The go command on Windows doesn't like long path name. To work around this, this is the first in a series of changes to shorten the schema disk path structure in a few places. Fixes #89
61 lines
1.6 KiB
Go
61 lines
1.6 KiB
Go
// Copyright 2017 Baliance. All rights reserved.
|
|
//
|
|
// DO NOT EDIT: generated by gooxml ECMA-376 generator
|
|
//
|
|
// Use of this source code is governed by the terms of the Affero GNU General
|
|
// Public License version 3.0 as published by the Free Software Foundation and
|
|
// appearing in the file LICENSE included in the packaging of this file. A
|
|
// commercial license can be purchased by contacting sales@baliance.com.
|
|
|
|
package chart
|
|
|
|
import (
|
|
"encoding/xml"
|
|
"fmt"
|
|
)
|
|
|
|
// ST_DepthPercent is a union type
|
|
type ST_DepthPercent struct {
|
|
ST_DepthPercentWithSymbol *string
|
|
ST_DepthPercentUShort *uint16
|
|
}
|
|
|
|
func (m *ST_DepthPercent) Validate() error {
|
|
return m.ValidateWithPath("")
|
|
}
|
|
|
|
func (m ST_DepthPercent) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
|
|
e.EncodeToken(start)
|
|
if m.ST_DepthPercentWithSymbol != nil {
|
|
e.EncodeToken(xml.CharData(*m.ST_DepthPercentWithSymbol))
|
|
}
|
|
if m.ST_DepthPercentUShort != nil {
|
|
e.EncodeToken(xml.CharData(fmt.Sprintf("%d", *m.ST_DepthPercentUShort)))
|
|
}
|
|
return e.EncodeToken(xml.EndElement{Name: start.Name})
|
|
}
|
|
|
|
func (m *ST_DepthPercent) ValidateWithPath(path string) error {
|
|
mems := []string{}
|
|
if m.ST_DepthPercentWithSymbol != nil {
|
|
mems = append(mems, "ST_DepthPercentWithSymbol")
|
|
}
|
|
if m.ST_DepthPercentUShort != nil {
|
|
mems = append(mems, "ST_DepthPercentUShort")
|
|
}
|
|
if len(mems) > 1 {
|
|
return fmt.Errorf("%s too many members set: %v", path, mems)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m ST_DepthPercent) String() string {
|
|
if m.ST_DepthPercentWithSymbol != nil {
|
|
return fmt.Sprintf("%v", *m.ST_DepthPercentWithSymbol)
|
|
}
|
|
if m.ST_DepthPercentUShort != nil {
|
|
return fmt.Sprintf("%v", *m.ST_DepthPercentUShort)
|
|
}
|
|
return ""
|
|
}
|