PageRenderTime 40ms CodeModel.GetById 18ms RepoModel.GetById 1ms 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. #ifndef __gen_nsIJSON_h__
  5. #define __gen_nsIJSON_h__
  6. #ifndef __gen_domstubs_h__
  7. #include "domstubs.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. class nsIInputStream; /* forward declaration */
  14. class nsIOutputStream; /* forward declaration */
  15. class nsIScriptGlobalObject; /* forward declaration */
  16. /* starting interface: nsIJSON */
  17. #define NS_IJSON_IID_STR "45464c36-efde-4cb5-8e00-07480533ff35"
  18. #define NS_IJSON_IID \
  19. {0x45464c36, 0xefde, 0x4cb5, \
  20. { 0x8e, 0x00, 0x07, 0x48, 0x05, 0x33, 0xff, 0x35 }}
  21. /**
  22. * Encode and decode JSON text.
  23. */
  24. class NS_NO_VTABLE NS_SCRIPTABLE nsIJSON : public nsISupports {
  25. public:
  26. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IJSON_IID)
  27. /* AString encode (); */
  28. NS_SCRIPTABLE NS_IMETHOD Encode(nsAString & _retval) = 0;
  29. /* void encodeToStream (in nsIOutputStream stream, in string charset, in boolean writeBOM); */
  30. NS_SCRIPTABLE NS_IMETHOD EncodeToStream(nsIOutputStream *stream, const char *charset, PRBool writeBOM) = 0;
  31. /* void decode (in AString str); */
  32. NS_SCRIPTABLE NS_IMETHOD Decode(const nsAString & str) = 0;
  33. /* void decodeFromStream (in nsIInputStream stream, in long contentLength); */
  34. NS_SCRIPTABLE NS_IMETHOD DecodeFromStream(nsIInputStream *stream, PRInt32 contentLength) = 0;
  35. };
  36. NS_DEFINE_STATIC_IID_ACCESSOR(nsIJSON, NS_IJSON_IID)
  37. /* Use this macro when declaring classes that implement this interface. */
  38. #define NS_DECL_NSIJSON \
  39. NS_SCRIPTABLE NS_IMETHOD Encode(nsAString & _retval); \
  40. NS_SCRIPTABLE NS_IMETHOD EncodeToStream(nsIOutputStream *stream, const char *charset, PRBool writeBOM); \
  41. NS_SCRIPTABLE NS_IMETHOD Decode(const nsAString & str); \
  42. NS_SCRIPTABLE NS_IMETHOD DecodeFromStream(nsIInputStream *stream, PRInt32 contentLength);
  43. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  44. #define NS_FORWARD_NSIJSON(_to) \
  45. NS_SCRIPTABLE NS_IMETHOD Encode(nsAString & _retval) { return _to Encode(_retval); } \
  46. NS_SCRIPTABLE NS_IMETHOD EncodeToStream(nsIOutputStream *stream, const char *charset, PRBool writeBOM) { return _to EncodeToStream(stream, charset, writeBOM); } \
  47. NS_SCRIPTABLE NS_IMETHOD Decode(const nsAString & str) { return _to Decode(str); } \
  48. NS_SCRIPTABLE NS_IMETHOD DecodeFromStream(nsIInputStream *stream, PRInt32 contentLength) { return _to DecodeFromStream(stream, contentLength); }
  49. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  50. #define NS_FORWARD_SAFE_NSIJSON(_to) \
  51. NS_SCRIPTABLE NS_IMETHOD Encode(nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Encode(_retval); } \
  52. NS_SCRIPTABLE NS_IMETHOD EncodeToStream(nsIOutputStream *stream, const char *charset, PRBool writeBOM) { return !_to ? NS_ERROR_NULL_POINTER : _to->EncodeToStream(stream, charset, writeBOM); } \
  53. NS_SCRIPTABLE NS_IMETHOD Decode(const nsAString & str) { return !_to ? NS_ERROR_NULL_POINTER : _to->Decode(str); } \
  54. NS_SCRIPTABLE NS_IMETHOD DecodeFromStream(nsIInputStream *stream, PRInt32 contentLength) { return !_to ? NS_ERROR_NULL_POINTER : _to->DecodeFromStream(stream, contentLength); }
  55. #if 0
  56. /* Use the code below as a template for the implementation class for this interface. */
  57. /* Header file */
  58. class nsJSON : public nsIJSON
  59. {
  60. public:
  61. NS_DECL_ISUPPORTS
  62. NS_DECL_NSIJSON
  63. nsJSON();
  64. private:
  65. ~nsJSON();
  66. protected:
  67. /* additional members */
  68. };
  69. /* Implementation file */
  70. NS_IMPL_ISUPPORTS1(nsJSON, nsIJSON)
  71. nsJSON::nsJSON()
  72. {
  73. /* member initializers and constructor code */
  74. }
  75. nsJSON::~nsJSON()
  76. {
  77. /* destructor code */
  78. }
  79. /* AString encode (); */
  80. NS_IMETHODIMP nsJSON::Encode(nsAString & _retval)
  81. {
  82. return NS_ERROR_NOT_IMPLEMENTED;
  83. }
  84. /* void encodeToStream (in nsIOutputStream stream, in string charset, in boolean writeBOM); */
  85. NS_IMETHODIMP nsJSON::EncodeToStream(nsIOutputStream *stream, const char *charset, PRBool writeBOM)
  86. {
  87. return NS_ERROR_NOT_IMPLEMENTED;
  88. }
  89. /* void decode (in AString str); */
  90. NS_IMETHODIMP nsJSON::Decode(const nsAString & str)
  91. {
  92. return NS_ERROR_NOT_IMPLEMENTED;
  93. }
  94. /* void decodeFromStream (in nsIInputStream stream, in long contentLength); */
  95. NS_IMETHODIMP nsJSON::DecodeFromStream(nsIInputStream *stream, PRInt32 contentLength)
  96. {
  97. return NS_ERROR_NOT_IMPLEMENTED;
  98. }
  99. /* End of implementation class template. */
  100. #endif
  101. #endif /* __gen_nsIJSON_h__ */