Browse Source

FileInfoTruncated.String() for stindex' benefit

Jakob Borg 11 năm trước cách đây
mục cha
commit
d031f958a9
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      internal/protocol/message.go

+ 5 - 0
internal/protocol/message.go

@@ -64,6 +64,11 @@ type FileInfoTruncated struct {
 	NumBlocks    uint32
 }
 
+func (f FileInfoTruncated) String() string {
+	return fmt.Sprintf("File{Name:%q, Flags:0%o, Modified:%d, Version:%d, Size:%d, NumBlocks:%d}",
+		f.Name, f.Flags, f.Modified, f.Version, f.Size(), f.NumBlocks)
+}
+
 // Returns a statistical guess on the size, not the exact figure
 func (f FileInfoTruncated) Size() int64 {
 	if IsDeleted(f.Flags) || IsDirectory(f.Flags) {