PageRenderTime 264ms CodeModel.GetById 140ms app.highlight 4ms RepoModel.GetById 117ms app.codeStats 0ms

/gecko_api/include/nsIJSON.h

http://firefox-mac-pdf.googlecode.com/
C++ Header | 136 lines | 75 code | 35 blank | 26 comment | 0 complexity | 4dd00e45618b8d9ee9c0c5725f1b7abe MD5 | raw file
  1/*
  2 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/dom/public/idl/json/nsIJSON.idl
  3 */
  4
  5#ifndef __gen_nsIJSON_h__
  6#define __gen_nsIJSON_h__
  7
  8
  9#ifndef __gen_domstubs_h__
 10#include "domstubs.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
 19class nsIOutputStream; /* forward declaration */
 20
 21class nsIScriptGlobalObject; /* forward declaration */
 22
 23
 24/* starting interface:    nsIJSON */
 25#define NS_IJSON_IID_STR "45464c36-efde-4cb5-8e00-07480533ff35"
 26
 27#define NS_IJSON_IID \
 28  {0x45464c36, 0xefde, 0x4cb5, \
 29    { 0x8e, 0x00, 0x07, 0x48, 0x05, 0x33, 0xff, 0x35 }}
 30
 31/**
 32 * Encode and decode JSON text.
 33 */
 34class NS_NO_VTABLE NS_SCRIPTABLE nsIJSON : public nsISupports {
 35 public: 
 36
 37  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IJSON_IID)
 38
 39  /* AString encode (); */
 40  NS_SCRIPTABLE NS_IMETHOD Encode(nsAString & _retval) = 0;
 41
 42  /* void encodeToStream (in nsIOutputStream stream, in string charset, in boolean writeBOM); */
 43  NS_SCRIPTABLE NS_IMETHOD EncodeToStream(nsIOutputStream *stream, const char *charset, PRBool writeBOM) = 0;
 44
 45  /* void decode (in AString str); */
 46  NS_SCRIPTABLE NS_IMETHOD Decode(const nsAString & str) = 0;
 47
 48  /* void decodeFromStream (in nsIInputStream stream, in long contentLength); */
 49  NS_SCRIPTABLE NS_IMETHOD DecodeFromStream(nsIInputStream *stream, PRInt32 contentLength) = 0;
 50
 51};
 52
 53  NS_DEFINE_STATIC_IID_ACCESSOR(nsIJSON, NS_IJSON_IID)
 54
 55/* Use this macro when declaring classes that implement this interface. */
 56#define NS_DECL_NSIJSON \
 57  NS_SCRIPTABLE NS_IMETHOD Encode(nsAString & _retval); \
 58  NS_SCRIPTABLE NS_IMETHOD EncodeToStream(nsIOutputStream *stream, const char *charset, PRBool writeBOM); \
 59  NS_SCRIPTABLE NS_IMETHOD Decode(const nsAString & str); \
 60  NS_SCRIPTABLE NS_IMETHOD DecodeFromStream(nsIInputStream *stream, PRInt32 contentLength); 
 61
 62/* Use this macro to declare functions that forward the behavior of this interface to another object. */
 63#define NS_FORWARD_NSIJSON(_to) \
 64  NS_SCRIPTABLE NS_IMETHOD Encode(nsAString & _retval) { return _to Encode(_retval); } \
 65  NS_SCRIPTABLE NS_IMETHOD EncodeToStream(nsIOutputStream *stream, const char *charset, PRBool writeBOM) { return _to EncodeToStream(stream, charset, writeBOM); } \
 66  NS_SCRIPTABLE NS_IMETHOD Decode(const nsAString & str) { return _to Decode(str); } \
 67  NS_SCRIPTABLE NS_IMETHOD DecodeFromStream(nsIInputStream *stream, PRInt32 contentLength) { return _to DecodeFromStream(stream, contentLength); } 
 68
 69/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
 70#define NS_FORWARD_SAFE_NSIJSON(_to) \
 71  NS_SCRIPTABLE NS_IMETHOD Encode(nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Encode(_retval); } \
 72  NS_SCRIPTABLE NS_IMETHOD EncodeToStream(nsIOutputStream *stream, const char *charset, PRBool writeBOM) { return !_to ? NS_ERROR_NULL_POINTER : _to->EncodeToStream(stream, charset, writeBOM); } \
 73  NS_SCRIPTABLE NS_IMETHOD Decode(const nsAString & str) { return !_to ? NS_ERROR_NULL_POINTER : _to->Decode(str); } \
 74  NS_SCRIPTABLE NS_IMETHOD DecodeFromStream(nsIInputStream *stream, PRInt32 contentLength) { return !_to ? NS_ERROR_NULL_POINTER : _to->DecodeFromStream(stream, contentLength); } 
 75
 76#if 0
 77/* Use the code below as a template for the implementation class for this interface. */
 78
 79/* Header file */
 80class nsJSON : public nsIJSON
 81{
 82public:
 83  NS_DECL_ISUPPORTS
 84  NS_DECL_NSIJSON
 85
 86  nsJSON();
 87
 88private:
 89  ~nsJSON();
 90
 91protected:
 92  /* additional members */
 93};
 94
 95/* Implementation file */
 96NS_IMPL_ISUPPORTS1(nsJSON, nsIJSON)
 97
 98nsJSON::nsJSON()
 99{
100  /* member initializers and constructor code */
101}
102
103nsJSON::~nsJSON()
104{
105  /* destructor code */
106}
107
108/* AString encode (); */
109NS_IMETHODIMP nsJSON::Encode(nsAString & _retval)
110{
111    return NS_ERROR_NOT_IMPLEMENTED;
112}
113
114/* void encodeToStream (in nsIOutputStream stream, in string charset, in boolean writeBOM); */
115NS_IMETHODIMP nsJSON::EncodeToStream(nsIOutputStream *stream, const char *charset, PRBool writeBOM)
116{
117    return NS_ERROR_NOT_IMPLEMENTED;
118}
119
120/* void decode (in AString str); */
121NS_IMETHODIMP nsJSON::Decode(const nsAString & str)
122{
123    return NS_ERROR_NOT_IMPLEMENTED;
124}
125
126/* void decodeFromStream (in nsIInputStream stream, in long contentLength); */
127NS_IMETHODIMP nsJSON::DecodeFromStream(nsIInputStream *stream, PRInt32 contentLength)
128{
129    return NS_ERROR_NOT_IMPLEMENTED;
130}
131
132/* End of implementation class template. */
133#endif
134
135
136#endif /* __gen_nsIJSON_h__ */