Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsRDFResource_h__
7 #define nsRDFResource_h__
9 #include "nsCOMPtr.h"
10 #include "nsIRDFNode.h"
11 #include "nsIRDFResource.h"
12 #include "nscore.h"
13 #include "nsStringGlue.h"
14 #include "rdf.h"
16 class nsIRDFService;
18 /**
19 * This simple base class implements nsIRDFResource, and can be used as a
20 * superclass for more sophisticated resource implementations.
21 */
22 class nsRDFResource : public nsIRDFResource {
23 public:
25 NS_DECL_THREADSAFE_ISUPPORTS
27 // nsIRDFNode methods:
28 NS_IMETHOD EqualsNode(nsIRDFNode* aNode, bool* aResult);
30 // nsIRDFResource methods:
31 NS_IMETHOD Init(const char* aURI);
32 NS_IMETHOD GetValue(char* *aURI);
33 NS_IMETHOD GetValueUTF8(nsACString& aResult);
34 NS_IMETHOD GetValueConst(const char** aURI);
35 NS_IMETHOD EqualsString(const char* aURI, bool* aResult);
36 NS_IMETHOD GetDelegate(const char* aKey, REFNSIID aIID, void** aResult);
37 NS_IMETHOD ReleaseDelegate(const char* aKey);
39 // nsRDFResource methods:
40 nsRDFResource(void);
41 virtual ~nsRDFResource(void);
43 protected:
44 static nsIRDFService* gRDFService;
45 static nsrefcnt gRDFServiceRefCnt;
47 protected:
48 nsCString mURI;
50 struct DelegateEntry {
51 nsCString mKey;
52 nsCOMPtr<nsISupports> mDelegate;
53 DelegateEntry* mNext;
54 };
56 DelegateEntry* mDelegates;
57 };
59 #endif // nsRDFResource_h__