1 module libwasm.bindings.File; 2 3 import libwasm.types; 4 5 import memutils.ct: tuple; 6 import libwasm.bindings.Blob; 7 8 @safe: 9 nothrow: 10 11 struct ChromeFilePropertyBag { 12 nothrow: 13 libwasm.bindings.File.FilePropertyBag _parent; 14 alias _parent this; 15 this(Handle h) { 16 _parent = .FilePropertyBag(h); 17 } 18 static auto create() { 19 return ChromeFilePropertyBag(libwasm_add__object()); 20 } 21 void name()(string name) { 22 Object_Call_string__void(this._parent, "name", name); 23 } 24 string name()() { 25 return Object_Getter__string(this._parent, "name"); 26 } 27 void existenceCheck()(bool existenceCheck) { 28 Object_Call_bool__void(this._parent, "existenceCheck", existenceCheck); 29 } 30 bool existenceCheck()() { 31 return Object_Getter__bool(this._parent, "existenceCheck"); 32 } 33 } 34 struct File { 35 nothrow: 36 libwasm.bindings.Blob.Blob _parent; 37 alias _parent this; 38 this(Handle h) { 39 _parent = .Blob(h); 40 } 41 string name()() { 42 return Object_Getter__string(this._parent, "name"); 43 } 44 int lastModified()() { 45 return Object_Getter__int(this._parent, "lastModified"); 46 } 47 string webkitRelativePath()() { 48 return Object_Getter__string(this._parent, "webkitRelativePath"); 49 } 50 string mozFullPath()() { 51 return Object_Getter__string(this._parent, "mozFullPath"); 52 } 53 auto createFromNsIFile()(scope ref nsIFile file, scope ref ChromeFilePropertyBag options) { 54 return JsPromise!(File)(Serialize_Object_VarArgCall!Handle(this._parent, "createFromNsIFile", "Handle;Handle", tuple(cast(Handle)file.handle, cast(Handle)options._parent))); 55 } 56 auto createFromNsIFile()(scope ref nsIFile file) { 57 return JsPromise!(File)(Object_Call_Handle__Handle(this._parent, "createFromNsIFile", file.handle)); 58 } 59 auto createFromFileName()(string fileName, scope ref ChromeFilePropertyBag options) { 60 return JsPromise!(File)(Serialize_Object_VarArgCall!Handle(this._parent, "createFromFileName", "string;Handle", tuple(fileName, cast(Handle)options._parent))); 61 } 62 auto createFromFileName()(string fileName) { 63 return JsPromise!(File)(Object_Call_string__Handle(this._parent, "createFromFileName", fileName)); 64 } 65 } 66 struct FilePropertyBag { 67 nothrow: 68 libwasm.bindings.Blob.BlobPropertyBag _parent; 69 alias _parent this; 70 this(Handle h) { 71 _parent = .BlobPropertyBag(h); 72 } 73 static auto create() { 74 return FilePropertyBag(libwasm_add__object()); 75 } 76 void lastModified()(int lastModified) { 77 Object_Call_int__void(this._parent, "lastModified", lastModified); 78 } 79 int lastModified()() { 80 return Object_Getter__int(this._parent, "lastModified"); 81 } 82 } 83 84