2015-01-09 07:19:32 +00:00
|
|
|
// ************************************************************
|
|
|
|
// This file is automatically generated by genxdr. Do not edit.
|
|
|
|
// ************************************************************
|
|
|
|
|
2015-01-12 13:50:30 +00:00
|
|
|
package db
|
2015-01-09 07:19:32 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"io"
|
|
|
|
|
|
|
|
"github.com/calmh/xdr"
|
|
|
|
)
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
FileInfoTruncated Structure:
|
|
|
|
|
|
|
|
0 1 2 3
|
|
|
|
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| Length of Name |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
/ /
|
|
|
|
\ Name (variable length) \
|
|
|
|
/ /
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| Flags |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| |
|
|
|
|
+ Modified (64 bits) +
|
|
|
|
| |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| |
|
|
|
|
+ Version (64 bits) +
|
|
|
|
| |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| |
|
|
|
|
+ Local Version (64 bits) +
|
|
|
|
| |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| Num Blocks |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
|
|
|
|
|
|
|
|
struct FileInfoTruncated {
|
|
|
|
string Name<8192>;
|
|
|
|
unsigned int Flags;
|
|
|
|
hyper Modified;
|
2015-01-18 01:12:06 +00:00
|
|
|
hyper Version;
|
|
|
|
hyper LocalVersion;
|
|
|
|
int NumBlocks;
|
2015-01-09 07:19:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
func (o FileInfoTruncated) EncodeXDR(w io.Writer) (int, error) {
|
|
|
|
var xw = xdr.NewWriter(w)
|
|
|
|
return o.encodeXDR(xw)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o FileInfoTruncated) MarshalXDR() ([]byte, error) {
|
|
|
|
return o.AppendXDR(make([]byte, 0, 128))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o FileInfoTruncated) MustMarshalXDR() []byte {
|
|
|
|
bs, err := o.MarshalXDR()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return bs
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o FileInfoTruncated) AppendXDR(bs []byte) ([]byte, error) {
|
|
|
|
var aw = xdr.AppendWriter(bs)
|
|
|
|
var xw = xdr.NewWriter(&aw)
|
|
|
|
_, err := o.encodeXDR(xw)
|
|
|
|
return []byte(aw), err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o FileInfoTruncated) encodeXDR(xw *xdr.Writer) (int, error) {
|
|
|
|
if l := len(o.Name); l > 8192 {
|
|
|
|
return xw.Tot(), xdr.ElementSizeExceeded("Name", l, 8192)
|
|
|
|
}
|
|
|
|
xw.WriteString(o.Name)
|
|
|
|
xw.WriteUint32(o.Flags)
|
|
|
|
xw.WriteUint64(uint64(o.Modified))
|
2015-01-18 01:12:06 +00:00
|
|
|
xw.WriteUint64(uint64(o.Version))
|
|
|
|
xw.WriteUint64(uint64(o.LocalVersion))
|
|
|
|
xw.WriteUint32(uint32(o.NumBlocks))
|
2015-01-09 07:19:32 +00:00
|
|
|
return xw.Tot(), xw.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *FileInfoTruncated) DecodeXDR(r io.Reader) error {
|
|
|
|
xr := xdr.NewReader(r)
|
|
|
|
return o.decodeXDR(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *FileInfoTruncated) UnmarshalXDR(bs []byte) error {
|
|
|
|
var br = bytes.NewReader(bs)
|
|
|
|
var xr = xdr.NewReader(br)
|
|
|
|
return o.decodeXDR(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *FileInfoTruncated) decodeXDR(xr *xdr.Reader) error {
|
|
|
|
o.Name = xr.ReadStringMax(8192)
|
|
|
|
o.Flags = xr.ReadUint32()
|
|
|
|
o.Modified = int64(xr.ReadUint64())
|
2015-01-18 01:12:06 +00:00
|
|
|
o.Version = int64(xr.ReadUint64())
|
|
|
|
o.LocalVersion = int64(xr.ReadUint64())
|
|
|
|
o.NumBlocks = int32(xr.ReadUint32())
|
2015-01-09 07:19:32 +00:00
|
|
|
return xr.Error()
|
|
|
|
}
|