| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Fire;
- namespace System.Fire.Container {
- public class ContainerFile {
-
- private long _size; // 8
- private DateTime _uploadDate; // 8
- private bool bDeleted; // 1
- private Mime.eMediaType _mediaType = Mime.eMediaType.Unknown; // 8
- private long _fileInfoPos; // 8
- private long _chunkPos; // 8
- private int _chunkLen; // 4
- //---------------------------
- // 41 bytes
- public void getInfoFromFile(string path) {
- this._mediaType = Mime.getMediaType(path);
- }
- public Mime.eMediaType MediaType {
- get {
- return this._mediaType;
- }
- set {
- this._mediaType = value;
- }
- }
- public long FileInfoPos {
- get {
- return this._fileInfoPos;
- }
- set {
- this._fileInfoPos = value;
- }
- }
- public long ChunkPos {
- get {
- return this._chunkPos;
- }
- set {
- this._chunkPos = value;
- }
- }
- public int ChunkLen {
- get {
- return this._chunkLen;
- }
- set {
- this._chunkLen = value;
- }
- }
- public long Size {
- get {
- return this._size;
- }
- set {
- this._size = value;
- }
- }
- public DateTime UploadDate {
- get {
- return this._uploadDate;
- }
- set {
- this._uploadDate = value;
- }
- }
- public bool Deleted {
- get {
- return this.bDeleted;
- }
- set {
- this.bDeleted = value;
- }
- }
- public int NumChunks {
- get {
- return this._chunkLen / 4;
- }
- }
- public override string ToString() {
- string s = "{";
- s += "\"size\":" + this._size + ",";
- s += "\"uploadDate\":" + this._uploadDate.Ticks + ",";
- s += "\"bDeleted\":" + (this.bDeleted?"true":"false") + ",";
- s += "\"mediaType\":" + ((byte)this.MediaType) + ",";
- s += "\"fileInfoPos\":" + this._fileInfoPos + ",";
- s += "\"chunkPos\":" + this._chunkPos + ",";
- s += "\"chunkLen\":" + this._chunkLen;
- s += "}";
- return s;
- }
- }
- }
|