2020-08-23 14:15:53 +00:00
|
|
|
//
|
|
|
|
// Copyright 2020 FoxyUtils ehf. All rights reserved.
|
|
|
|
//
|
|
|
|
// This is a commercial product and requires a license to operate.
|
|
|
|
// A trial license can be obtained at https://unidoc.io
|
|
|
|
//
|
|
|
|
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
|
|
|
|
//
|
|
|
|
// Use of this source code is governed by the UniDoc End User License Agreement
|
|
|
|
// terms that can be accessed at https://unidoc.io/eula/
|
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
package custom_properties ;import (_bb "encoding/xml";_e "fmt";_a "github.com/unidoc/unioffice";_fa "github.com/unidoc/unioffice/schema/soo/ofc/docPropsVTypes";_df "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes";_d "strconv";_f "time";);
|
2021-04-23 20:00:00 +00:00
|
|
|
|
2021-08-23 20:44:48 +00:00
|
|
|
// ValidateWithPath validates the CT_Property and its children, prefixing error messages with path
|
2021-09-22 16:41:01 +00:00
|
|
|
func (_ccc *CT_Property )ValidateWithPath (path string )error {if !_df .ST_GuidPatternRe .MatchString (_ccc .FmtidAttr ){return _e .Errorf ("%\u0073\u002f\u006d\u002e\u0046\u006d\u0074\u0069\u0064\u0041\u0074\u0074\u0072\u0020\u006d\u0075\u0073\u0074 \u006d\u0061\u0074\u0063\u0068\u0020\u0027\u0025\u0073\u0027 (\u0068\u0061\u0076e\u0020%\u0076\u0029",path ,_df .ST_GuidPatternRe ,_ccc .FmtidAttr );};if _ccc .Vector !=nil {if _gce :=_ccc .Vector .ValidateWithPath (path +"\u002fV\u0065\u0063\u0074\u006f\u0072");_gce !=nil {return _gce ;};};if _ccc .Array !=nil {if _aac :=_ccc .Array .ValidateWithPath (path +"\u002f\u0041\u0072\u0072\u0061\u0079");_aac !=nil {return _aac ;};};if _ccc .Empty !=nil {if _dfg :=_ccc .Empty .ValidateWithPath (path +"\u002f\u0045\u006d\u0070\u0074\u0079");_dfg !=nil {return _dfg ;};};if _ccc .Null !=nil {if _agd :=_ccc .Null .ValidateWithPath (path +"\u002f\u004e\u0075l\u006c");_agd !=nil {return _agd ;};};if _ccc .Cy !=nil {if !_fa .ST_CyPatternRe .MatchString (*_ccc .Cy ){return _e .Errorf ("\u0025\u0073\u002f\u006d\u002e\u0043y\u0020\u006d\u0075\u0073\u0074\u0020\u006d\u0061\u0074\u0063\u0068\u0020\u0027%\u0073\u0027\u0020\u0028\u0068\u0061\u0076e\u0020\u0025\u0076\u0029",path ,_fa .ST_CyPatternRe ,*_ccc .Cy );};};if _ccc .Error !=nil {if !_fa .ST_ErrorPatternRe .MatchString (*_ccc .Error ){return _e .Errorf ("\u0025\u0073/m\u002e\u0045\u0072r\u006f\u0072\u0020\u006dust\u0020ma\u0074\u0063\u0068\u0020\u0027\u0025\u0073' \u0028\u0068\u0061\u0076\u0065\u0020\u0025v\u0029",path ,_fa .ST_ErrorPatternRe ,*_ccc .Error );};};if _ccc .Vstream !=nil {if _ca :=_ccc .Vstream .ValidateWithPath (path +"\u002f\u0056\u0073\u0074\u0072\u0065\u0061\u006d");_ca !=nil {return _ca ;};};if _ccc .Clsid !=nil {if !_df .ST_GuidPatternRe .MatchString (*_ccc .Clsid ){return _e .Errorf ("\u0025\u0073/m\u002e\u0043\u006cs\u0069\u0064\u0020\u006dust\u0020ma\u0074\u0063\u0068\u0020\u0027\u0025\u0073' \u0028\u0068\u0061\u0076\u0065\u0020\u0025v\u0029",path ,_df .ST_GuidPatternRe ,*_ccc .Clsid );};};return nil ;};func (_be *CT_Property )UnmarshalXML (d *_bb .Decoder ,start _bb .StartElement )error {_be .FmtidAttr ="\u007b\u0030\u0030\u0030\u0030\u0030\u0030\u0030\u0030\u002d\u0030\u0030\u0030\u0030\u002d\u0030\u0030\u0030\u0030\u002d\u0030\u0030\u0030\u0030-\u0030\u0030\u0030\u0030\u00300\u0030\u00300\u0030\u0030\u0030\u007d";for _ ,_gd :=range start .Attr {if _gd .Name .Local =="\u0070\u0069\u0064"{_dca ,_bdf :=_d .ParseInt (_gd .Value ,10,32);if _bdf !=nil {return _bdf ;};_be .PidAttr =int32 (_dca );continue ;};if _gd .Name .Local =="\u006c\u0069\u006e\u006b\u0054\u0061\u0072\u0067\u0065\u0074"{_fce ,_bbe :=_gd .Value ,error (nil );if _bbe !=nil {return _bbe ;};_be .LinkTargetAttr =&_fce ;continue ;};if _gd .Name .Local =="\u006e\u0061\u006d\u0065"{_gfd ,_cce :=_gd .Value ,error (nil );if _cce !=nil {return _cce ;};_be .NameAttr =&_gfd ;continue ;};if _gd .Name .Local =="\u0066\u006d\u0074i\u0064"{_aeea ,_bdb :=_gd .Value ,error (nil );if _bdb !=nil {return _bdb ;};_be .FmtidAttr =_aeea ;continue ;};};_ace :for {_dgg ,_dfed :=d .Token ();if _dfed !=nil {return _dfed ;};switch _bcg :=_dgg .(type ){case _bb .StartElement :switch _bcg .Name {case _bb .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063\u0068\u0065\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078m\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067\u002f\u006f\u0066\u0066\u0069\u0063\u0065\u0044\u006fc\u0075\u006d\u0065\u006e\u0074\u002f\u0032\u0030\u0030\u0036\u002f\u0064\u006f\u0063P\u0072\u006f\u0070s\u0056\u0054\u0079\u0070\u0065\u0073",Local :"\u0076\u0065\u0063\u0074\u006f\u0072"},_bb .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f/\u0070\u0075\u0072l\u002e\u006f\u0063l\u0063\u002e\u006f\u0072\u0067\u002f\u006f\u006f\u0078\u006dl\u002f\u006f\u0066\u0066\u0069ce\u0044\u006f\u0063\u0075\u006d\u0065\u006e\u0074\u002f\u0064\u006f\u0063\u0050\u0072\u006f\u0070\u0073\u0056\u0054\u0079\u0070\u0065\u0073",Local :"\u0076\u0065\u0063\u0074\u006f\u0072"}:_be .Vector =_fa .NewVector ();if _agc :=d .DecodeElement (_be .Ve
|
2021-05-31 16:22:30 +00:00
|
|
|
|
2021-07-30 17:03:26 +00:00
|
|
|
// Validate validates the CT_Properties and its children
|
2021-09-22 16:41:01 +00:00
|
|
|
func (_fe *CT_Properties )Validate ()error {return _fe .ValidateWithPath ("\u0043\u0054\u005f\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0069\u0065\u0073");};
|
|
|
|
|
|
|
|
// Validate validates the Properties and its children
|
|
|
|
func (_eab *Properties )Validate ()error {return _eab .ValidateWithPath ("\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0069\u0065\u0073");};
|
2021-05-31 16:22:30 +00:00
|
|
|
|
2021-08-23 20:44:48 +00:00
|
|
|
// ValidateWithPath validates the Properties and its children, prefixing error messages with path
|
2021-09-22 16:41:01 +00:00
|
|
|
func (_dda *Properties )ValidateWithPath (path string )error {if _adc :=_dda .CT_Properties .ValidateWithPath (path );_adc !=nil {return _adc ;};return nil ;};type CT_Property struct{FmtidAttr string ;PidAttr int32 ;NameAttr *string ;LinkTargetAttr *string ;Vector *_fa .Vector ;Array *_fa .Array ;Blob *string ;Oblob *string ;Empty *_fa .Empty ;Null *_fa .Null ;I1 *int8 ;I2 *int16 ;I4 *int32 ;I8 *int64 ;Int *int32 ;Ui1 *uint8 ;Ui2 *uint16 ;Ui4 *uint32 ;Ui8 *uint64 ;Uint *uint32 ;R4 *float32 ;R8 *float64 ;Decimal *float64 ;Lpstr *string ;Lpwstr *string ;Bstr *string ;Date *_f .Time ;Filetime *_f .Time ;Bool *bool ;Cy *string ;Error *string ;Stream *string ;Ostream *string ;Storage *string ;Ostorage *string ;Vstream *_fa .Vstream ;Clsid *string ;};
|
2021-07-30 17:03:26 +00:00
|
|
|
|
2021-09-22 16:41:01 +00:00
|
|
|
// Validate validates the CT_Property and its children
|
|
|
|
func (_dcc *CT_Property )Validate ()error {return _dcc .ValidateWithPath ("C\u0054\u005f\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079");};
|
|
|
|
|
|
|
|
// ValidateWithPath validates the CT_Properties and its children, prefixing error messages with path
|
|
|
|
func (_ce *CT_Properties )ValidateWithPath (path string )error {for _bff ,_db :=range _ce .Property {if _fd :=_db .ValidateWithPath (_e .Sprintf ("\u0025s\u002fP\u0072\u006f\u0070\u0065\u0072\u0074\u0079\u005b\u0025\u0064\u005d",path ,_bff ));_fd !=nil {return _fd ;};};return nil ;};func (_egd *CT_Properties )UnmarshalXML (d *_bb .Decoder ,start _bb .StartElement )error {_egdg :for {_bf ,_aca :=d .Token ();if _aca !=nil {return _aca ;};switch _c :=_bf .(type ){case _bb .StartElement :switch _c .Name {case _bb .Name {Space :"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0063h\u0065\u006d\u0061\u0073\u002e\u006f\u0070\u0065\u006e\u0078\u006d\u006c\u0066\u006f\u0072\u006d\u0061\u0074\u0073\u002e\u006f\u0072\u0067/\u006f\u0066f\u0069\u0063e\u0044\u006f\u0063\u0075\u006d\u0065\u006e\u0074\u002f\u0032\u0030\u0030\u0036/c\u0075\u0073\u0074\u006f\u006d\u002d\u0070\u0072\u006fp\u0065\u0072\u0074\u0069\u0065\u0073",Local :"\u0070\u0072\u006f\u0070\u0065\u0072\u0074\u0079"}:_gf :=NewCT_Property ();if _ge :=d .DecodeElement (_gf ,&_c );_ge !=nil {return _ge ;};_egd .Property =append (_egd .Property ,_gf );default:_a .Log ("\u0073\u006b\u0069\u0070\u0070\u0069\u006e\u0067 \u0075\u006e\u0073up\u0070\u006f\u0072\u0074\u0065\u0064 \u0065\u006c\u0065\u006d\u0065\u006e\u0074\u0020\u006f\u006e\u0020\u0043\u0054\u005f\u0050r\u006f\u0070\u0065\u0072\u0074\u0069\u0065\u0073 \u0025\u0076",_c .Name );if _ba :=d .Skip ();_ba !=nil {return _ba ;};};case _bb .EndElement :break _egdg ;case _bb .CharData :};};return nil ;};func (_fg *CT_Property )MarshalXML (e *_bb .Encoder ,start _bb .StartElement )error {start .Attr =append (start .Attr ,_bb .Attr {Name :_bb .Name {Local :"\u0066\u006d\u0074i\u0064"},Value :_e .Sprintf ("\u0025\u0076",_fg .FmtidAttr )});start .Attr =append (start .Attr ,_bb .Attr {Name :_bb .Name {Local :"\u0070\u0069\u0064"},Value :_e .Sprintf ("\u0025\u0076",_fg .PidAttr )});if _fg .NameAttr !=nil {start .Attr =append (start .Attr ,_bb .Attr {Name :_bb .Name {Local :"\u006e\u0061\u006d\u0065"},Value :_e .Sprintf ("\u0025\u0076",*_fg .NameAttr )});};if _fg .LinkTargetAttr !=nil {start .Attr =append (start .Attr ,_bb .Attr {Name :_bb .Name {Local :"\u006c\u0069\u006e\u006b\u0054\u0061\u0072\u0067\u0065\u0074"},Value :_e .Sprintf ("\u0025\u0076",*_fg .LinkTargetAttr )});};e .EncodeToken (start );if _fg .Vector !=nil {_gfa :=_bb .StartElement {Name :_bb .Name {Local :"\u0076t\u003a\u0076\u0065\u0063\u0074\u006fr"}};e .EncodeElement (_fg .Vector ,_gfa );};if _fg .Array !=nil {_cc :=_bb .StartElement {Name :_bb .Name {Local :"\u0076\u0074\u003a\u0061\u0072\u0072\u0061\u0079"}};e .EncodeElement (_fg .Array ,_cc );};if _fg .Blob !=nil {_fc :=_bb .StartElement {Name :_bb .Name {Local :"\u0076t\u003a\u0062\u006c\u006f\u0062"}};_a .AddPreserveSpaceAttr (&_fc ,*_fg .Blob );e .EncodeElement (_fg .Blob ,_fc );};if _fg .Oblob !=nil {_aa :=_bb .StartElement {Name :_bb .Name {Local :"\u0076\u0074\u003a\u006f\u0062\u006c\u006f\u0062"}};_a .AddPreserveSpaceAttr (&_aa ,*_fg .Oblob );e .EncodeElement (_fg .Oblob ,_aa );};if _fg .Empty !=nil {_da :=_bb .StartElement {Name :_bb .Name {Local :"\u0076\u0074\u003a\u0065\u006d\u0070\u0074\u0079"}};e .EncodeElement (_fg .Empty ,_da );};if _fg .Null !=nil {_ef :=_bb .StartElement {Name :_bb .Name {Local :"\u0076t\u003a\u006e\u0075\u006c\u006c"}};e .EncodeElement (_fg .Null ,_ef );};if _fg .I1 !=nil {_bc :=_bb .StartElement {Name :_bb .Name {Local :"\u0076\u0074\u003ai\u0031"}};e .EncodeElement (_fg .I1 ,_bc );};if _fg .I2 !=nil {_ee :=_bb .StartElement {Name :_bb .Name {Local :"\u0076\u0074\u003ai\u0032"}};e .EncodeElement (_fg .I2 ,_ee );};if _fg .I4 !=nil {_fee :=_bb .StartElement {Name :_bb .Name {Local :"\u0076\u0074\u003ai\u0034"}};e .EncodeElement (_fg .I4 ,_fee );};if _fg .I8 !=nil {_gb :=_bb .StartElement {Name :_bb .Name {Local :"\u0076\u0074\u003ai\u0038"}};e .EncodeElement (_fg .I8 ,_gb );};if _fg .Int !=nil {_ga :=_bb .StartElement {Name :_bb .Name {Local :"\u0076\u0074\u003a\u0069\u006e\u0074"}};e .EncodeElement (_fg .Int ,_ga );};if _fg .Ui1 !=nil {_dac :=_bb .StartElement {Name :_bb .Nam
|