Ensure the IfStatement can be encoded and decoded into cork
This commit is contained in:
parent
851c52d901
commit
8de7424efb
1 changed files with 34 additions and 0 deletions
34
sql/cork.go
34
sql/cork.go
|
@ -818,6 +818,40 @@ func (this Polygon) MarshalJSON() (data []byte, err error) {
|
||||||
// ##################################################
|
// ##################################################
|
||||||
// ##################################################
|
// ##################################################
|
||||||
|
|
||||||
|
// --------------------------------------------------
|
||||||
|
// IfStatement
|
||||||
|
// --------------------------------------------------
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
cork.Register(&IfStatement{})
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *IfStatement) Decode(src []byte) {
|
||||||
|
pack.Decode(src, this)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *IfStatement) Encode() (dst []byte) {
|
||||||
|
return pack.Encode(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *IfStatement) ExtendCORK() byte {
|
||||||
|
return 0x71
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *IfStatement) MarshalCORK(w *cork.Writer) (err error) {
|
||||||
|
w.EncodeAny(this.Cond)
|
||||||
|
w.EncodeAny(this.Then)
|
||||||
|
w.EncodeAny(this.Else)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *IfStatement) UnmarshalCORK(r *cork.Reader) (err error) {
|
||||||
|
r.DecodeAny(&this.Cond)
|
||||||
|
r.DecodeAny(&this.Then)
|
||||||
|
r.DecodeAny(&this.Else)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
// LiveStatement
|
// LiveStatement
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue