/work/obj-fuzz/dist/include/nsIGZFileWriter.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * DO NOT EDIT. THIS FILE IS GENERATED FROM /src/mozilla-central/xpcom/base/nsIGZFileWriter.idl |
3 | | */ |
4 | | |
5 | | #ifndef __gen_nsIGZFileWriter_h__ |
6 | | #define __gen_nsIGZFileWriter_h__ |
7 | | |
8 | | |
9 | | #ifndef __gen_nsISupports_h__ |
10 | | #include "nsISupports.h" |
11 | | #endif |
12 | | |
13 | | #include "js/GCAnnotations.h" |
14 | | |
15 | | /* For IDL files that don't want to include root IDL files. */ |
16 | | #ifndef NS_NO_VTABLE |
17 | | #define NS_NO_VTABLE |
18 | | #endif |
19 | | #include "nsDependentString.h" |
20 | | #include <stdio.h> |
21 | | class nsIFile; /* forward declaration */ |
22 | | |
23 | | |
24 | | /* starting interface: nsIGZFileWriter */ |
25 | | #define NS_IGZFILEWRITER_IID_STR "6bd5642c-1b90-4499-ba4b-199f27efaba5" |
26 | | |
27 | | #define NS_IGZFILEWRITER_IID \ |
28 | | {0x6bd5642c, 0x1b90, 0x4499, \ |
29 | | { 0xba, 0x4b, 0x19, 0x9f, 0x27, 0xef, 0xab, 0xa5 }} |
30 | | |
31 | | class nsIGZFileWriter : public nsISupports { |
32 | | public: |
33 | | |
34 | | NS_DECLARE_STATIC_IID_ACCESSOR(NS_IGZFILEWRITER_IID) |
35 | | |
36 | | /* [must_use] void init (in nsIFile file); */ |
37 | | JS_HAZ_CAN_RUN_SCRIPT MOZ_MUST_USE NS_IMETHOD Init(nsIFile *file) = 0; |
38 | | |
39 | | /* [must_use,noscript] void initANSIFileDesc (in FILE file); */ |
40 | | MOZ_MUST_USE NS_IMETHOD InitANSIFileDesc(FILE * file) = 0; |
41 | | |
42 | | /* [must_use] void write (in AUTF8String str); */ |
43 | | JS_HAZ_CAN_RUN_SCRIPT MOZ_MUST_USE NS_IMETHOD Write(const nsACString& str) = 0; |
44 | | |
45 | | /** |
46 | | * Write the given char* to the file (not including the null-terminator). |
47 | | */ |
48 | | MOZ_MUST_USE nsresult Write(const char* str) |
49 | 0 | { |
50 | 0 | return Write(str, strlen(str)); |
51 | 0 | } |
52 | | /** |
53 | | * Write |length| bytes of |str| to the file. |
54 | | */ |
55 | | MOZ_MUST_USE nsresult Write(const char* str, uint32_t len) |
56 | 0 | { |
57 | 0 | return Write(nsDependentCString(str, len)); |
58 | 0 | } |
59 | | /* void finish (); */ |
60 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Finish(void) = 0; |
61 | | |
62 | | }; |
63 | | |
64 | | NS_DEFINE_STATIC_IID_ACCESSOR(nsIGZFileWriter, NS_IGZFILEWRITER_IID) |
65 | | |
66 | | /* Use this macro when declaring classes that implement this interface. */ |
67 | | #define NS_DECL_NSIGZFILEWRITER \ |
68 | | MOZ_MUST_USE NS_IMETHOD Init(nsIFile *file) override; \ |
69 | | MOZ_MUST_USE NS_IMETHOD InitANSIFileDesc(FILE * file) override; \ |
70 | | MOZ_MUST_USE NS_IMETHOD Write(const nsACString& str) override; \ |
71 | | NS_IMETHOD Finish(void) override; |
72 | | |
73 | | /* Use this macro when declaring the members of this interface when the |
74 | | class doesn't implement the interface. This is useful for forwarding. */ |
75 | | #define NS_DECL_NON_VIRTUAL_NSIGZFILEWRITER \ |
76 | | MOZ_MUST_USE nsresult Init(nsIFile *file); \ |
77 | | MOZ_MUST_USE nsresult InitANSIFileDesc(FILE * file); \ |
78 | | MOZ_MUST_USE nsresult Write(const nsACString& str); \ |
79 | | nsresult Finish(void); |
80 | | |
81 | | /* Use this macro to declare functions that forward the behavior of this interface to another object. */ |
82 | | #define NS_FORWARD_NSIGZFILEWRITER(_to) \ |
83 | | MOZ_MUST_USE NS_IMETHOD Init(nsIFile *file) override { return _to Init(file); } \ |
84 | | MOZ_MUST_USE NS_IMETHOD InitANSIFileDesc(FILE * file) override { return _to InitANSIFileDesc(file); } \ |
85 | | MOZ_MUST_USE NS_IMETHOD Write(const nsACString& str) override { return _to Write(str); } \ |
86 | | NS_IMETHOD Finish(void) override { return _to Finish(); } |
87 | | |
88 | | /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ |
89 | | #define NS_FORWARD_SAFE_NSIGZFILEWRITER(_to) \ |
90 | | MOZ_MUST_USE NS_IMETHOD Init(nsIFile *file) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(file); } \ |
91 | | MOZ_MUST_USE NS_IMETHOD InitANSIFileDesc(FILE * file) override { return !_to ? NS_ERROR_NULL_POINTER : _to->InitANSIFileDesc(file); } \ |
92 | | MOZ_MUST_USE NS_IMETHOD Write(const nsACString& str) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Write(str); } \ |
93 | | NS_IMETHOD Finish(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Finish(); } |
94 | | |
95 | | |
96 | | #endif /* __gen_nsIGZFileWriter_h__ */ |