PageRenderTime 97ms CodeModel.GetById 60ms app.highlight 4ms RepoModel.GetById 30ms app.codeStats 1ms

/gecko_api/include/nsIScriptableInputStream.h

http://firefox-mac-pdf.googlecode.com/
C++ Header | 163 lines | 73 code | 33 blank | 57 comment | 0 complexity | ee2e2e688dbbc9c7aa4a7cfccb055650 MD5 | raw file
  1/*
  2 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/xpcom/io/nsIScriptableInputStream.idl
  3 */
  4
  5#ifndef __gen_nsIScriptableInputStream_h__
  6#define __gen_nsIScriptableInputStream_h__
  7
  8
  9#ifndef __gen_nsISupports_h__
 10#include "nsISupports.h"
 11#endif
 12
 13/* For IDL files that don't want to include root IDL files. */
 14#ifndef NS_NO_VTABLE
 15#define NS_NO_VTABLE
 16#endif
 17class nsIInputStream; /* forward declaration */
 18
 19
 20/* starting interface:    nsIScriptableInputStream */
 21#define NS_ISCRIPTABLEINPUTSTREAM_IID_STR "a2a32f90-9b90-11d3-a189-0050041caf44"
 22
 23#define NS_ISCRIPTABLEINPUTSTREAM_IID \
 24  {0xa2a32f90, 0x9b90, 0x11d3, \
 25    { 0xa1, 0x89, 0x00, 0x50, 0x04, 0x1c, 0xaf, 0x44 }}
 26
 27/**
 28 * nsIScriptableInputStream provides scriptable access to an nsIInputStream
 29 * instance.
 30 *
 31 * @status FROZEN
 32 */
 33class NS_NO_VTABLE NS_SCRIPTABLE nsIScriptableInputStream : public nsISupports {
 34 public: 
 35
 36  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEINPUTSTREAM_IID)
 37
 38  /** 
 39     * Closes the stream. 
 40     */
 41  /* void close (); */
 42  NS_SCRIPTABLE NS_IMETHOD Close(void) = 0;
 43
 44  /**
 45     * Wrap the given nsIInputStream with this nsIScriptableInputStream. 
 46     *
 47     * @param aInputStream parameter providing the stream to wrap 
 48     */
 49  /* void init (in nsIInputStream aInputStream); */
 50  NS_SCRIPTABLE NS_IMETHOD Init(nsIInputStream *aInputStream) = 0;
 51
 52  /**
 53     * Return the number of bytes currently available in the stream 
 54     *
 55     * @return the number of bytes 
 56     *
 57     * @throws NS_BASE_STREAM_CLOSED if called after the stream has been closed
 58     */
 59  /* unsigned long available (); */
 60  NS_SCRIPTABLE NS_IMETHOD Available(PRUint32 *_retval) = 0;
 61
 62  /**
 63     * Read data from the stream.
 64     *
 65     * WARNING: If the data contains a null byte, then this method will return
 66     * a truncated string.
 67     *
 68     * @param aCount the maximum number of bytes to read 
 69     *
 70     * @return the data, which will be an empty string if the stream is at EOF.
 71     *
 72     * @throws NS_BASE_STREAM_CLOSED if called after the stream has been closed
 73     * @throws NS_ERROR_NOT_INITIALIZED if init was not called
 74     */
 75  /* string read (in unsigned long aCount); */
 76  NS_SCRIPTABLE NS_IMETHOD Read(PRUint32 aCount, char **_retval) = 0;
 77
 78};
 79
 80  NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptableInputStream, NS_ISCRIPTABLEINPUTSTREAM_IID)
 81
 82/* Use this macro when declaring classes that implement this interface. */
 83#define NS_DECL_NSISCRIPTABLEINPUTSTREAM \
 84  NS_SCRIPTABLE NS_IMETHOD Close(void); \
 85  NS_SCRIPTABLE NS_IMETHOD Init(nsIInputStream *aInputStream); \
 86  NS_SCRIPTABLE NS_IMETHOD Available(PRUint32 *_retval); \
 87  NS_SCRIPTABLE NS_IMETHOD Read(PRUint32 aCount, char **_retval); 
 88
 89/* Use this macro to declare functions that forward the behavior of this interface to another object. */
 90#define NS_FORWARD_NSISCRIPTABLEINPUTSTREAM(_to) \
 91  NS_SCRIPTABLE NS_IMETHOD Close(void) { return _to Close(); } \
 92  NS_SCRIPTABLE NS_IMETHOD Init(nsIInputStream *aInputStream) { return _to Init(aInputStream); } \
 93  NS_SCRIPTABLE NS_IMETHOD Available(PRUint32 *_retval) { return _to Available(_retval); } \
 94  NS_SCRIPTABLE NS_IMETHOD Read(PRUint32 aCount, char **_retval) { return _to Read(aCount, _retval); } 
 95
 96/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
 97#define NS_FORWARD_SAFE_NSISCRIPTABLEINPUTSTREAM(_to) \
 98  NS_SCRIPTABLE NS_IMETHOD Close(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Close(); } \
 99  NS_SCRIPTABLE NS_IMETHOD Init(nsIInputStream *aInputStream) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aInputStream); } \
100  NS_SCRIPTABLE NS_IMETHOD Available(PRUint32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Available(_retval); } \
101  NS_SCRIPTABLE NS_IMETHOD Read(PRUint32 aCount, char **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Read(aCount, _retval); } 
102
103#if 0
104/* Use the code below as a template for the implementation class for this interface. */
105
106/* Header file */
107class nsScriptableInputStream : public nsIScriptableInputStream
108{
109public:
110  NS_DECL_ISUPPORTS
111  NS_DECL_NSISCRIPTABLEINPUTSTREAM
112
113  nsScriptableInputStream();
114
115private:
116  ~nsScriptableInputStream();
117
118protected:
119  /* additional members */
120};
121
122/* Implementation file */
123NS_IMPL_ISUPPORTS1(nsScriptableInputStream, nsIScriptableInputStream)
124
125nsScriptableInputStream::nsScriptableInputStream()
126{
127  /* member initializers and constructor code */
128}
129
130nsScriptableInputStream::~nsScriptableInputStream()
131{
132  /* destructor code */
133}
134
135/* void close (); */
136NS_IMETHODIMP nsScriptableInputStream::Close()
137{
138    return NS_ERROR_NOT_IMPLEMENTED;
139}
140
141/* void init (in nsIInputStream aInputStream); */
142NS_IMETHODIMP nsScriptableInputStream::Init(nsIInputStream *aInputStream)
143{
144    return NS_ERROR_NOT_IMPLEMENTED;
145}
146
147/* unsigned long available (); */
148NS_IMETHODIMP nsScriptableInputStream::Available(PRUint32 *_retval)
149{
150    return NS_ERROR_NOT_IMPLEMENTED;
151}
152
153/* string read (in unsigned long aCount); */
154NS_IMETHODIMP nsScriptableInputStream::Read(PRUint32 aCount, char **_retval)
155{
156    return NS_ERROR_NOT_IMPLEMENTED;
157}
158
159/* End of implementation class template. */
160#endif
161
162
163#endif /* __gen_nsIScriptableInputStream_h__ */