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
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
michael@0 | 2 | * |
michael@0 | 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 6 | * |
michael@0 | 7 | * This Original Code has been modified by IBM Corporation. |
michael@0 | 8 | * Modifications made by IBM described herein are |
michael@0 | 9 | * Copyright (c) International Business Machines |
michael@0 | 10 | * Corporation, 2000 |
michael@0 | 11 | * |
michael@0 | 12 | * Modifications to Mozilla code or documentation |
michael@0 | 13 | * identified per MPL Section 3.3 |
michael@0 | 14 | * |
michael@0 | 15 | * Date Modified by Description of modification |
michael@0 | 16 | * 03/27/2000 IBM Corp. Added PR_CALLBACK for Optlink |
michael@0 | 17 | * use in OS2 |
michael@0 | 18 | */ |
michael@0 | 19 | |
michael@0 | 20 | #ifndef nsRDFService_h__ |
michael@0 | 21 | #define nsRDFService_h__ |
michael@0 | 22 | |
michael@0 | 23 | #include "nsIRDFService.h" |
michael@0 | 24 | #include "nsWeakReference.h" |
michael@0 | 25 | #include "nsIFactory.h" |
michael@0 | 26 | #include "nsCOMPtr.h" |
michael@0 | 27 | #include "pldhash.h" |
michael@0 | 28 | #include "nsString.h" |
michael@0 | 29 | |
michael@0 | 30 | struct PLHashTable; |
michael@0 | 31 | class nsIRDFLiteral; |
michael@0 | 32 | class nsIRDFInt; |
michael@0 | 33 | class nsIRDFDate; |
michael@0 | 34 | class BlobImpl; |
michael@0 | 35 | |
michael@0 | 36 | class RDFServiceImpl : public nsIRDFService, |
michael@0 | 37 | public nsSupportsWeakReference |
michael@0 | 38 | { |
michael@0 | 39 | protected: |
michael@0 | 40 | PLHashTable* mNamedDataSources; |
michael@0 | 41 | PLDHashTable mResources; |
michael@0 | 42 | PLDHashTable mLiterals; |
michael@0 | 43 | PLDHashTable mInts; |
michael@0 | 44 | PLDHashTable mDates; |
michael@0 | 45 | PLDHashTable mBlobs; |
michael@0 | 46 | |
michael@0 | 47 | nsAutoCString mLastURIPrefix; |
michael@0 | 48 | nsCOMPtr<nsIFactory> mLastFactory; |
michael@0 | 49 | nsCOMPtr<nsIFactory> mDefaultResourceFactory; |
michael@0 | 50 | |
michael@0 | 51 | RDFServiceImpl(); |
michael@0 | 52 | nsresult Init(); |
michael@0 | 53 | virtual ~RDFServiceImpl(); |
michael@0 | 54 | |
michael@0 | 55 | public: |
michael@0 | 56 | static RDFServiceImpl *gRDFService NS_VISIBILITY_HIDDEN; |
michael@0 | 57 | static nsresult CreateSingleton(nsISupports* aOuter, |
michael@0 | 58 | const nsIID& aIID, void **aResult); |
michael@0 | 59 | |
michael@0 | 60 | // nsISupports |
michael@0 | 61 | NS_DECL_ISUPPORTS |
michael@0 | 62 | |
michael@0 | 63 | // nsIRDFService |
michael@0 | 64 | NS_DECL_NSIRDFSERVICE |
michael@0 | 65 | |
michael@0 | 66 | // Implementation methods |
michael@0 | 67 | nsresult RegisterLiteral(nsIRDFLiteral* aLiteral); |
michael@0 | 68 | nsresult UnregisterLiteral(nsIRDFLiteral* aLiteral); |
michael@0 | 69 | nsresult RegisterInt(nsIRDFInt* aInt); |
michael@0 | 70 | nsresult UnregisterInt(nsIRDFInt* aInt); |
michael@0 | 71 | nsresult RegisterDate(nsIRDFDate* aDate); |
michael@0 | 72 | nsresult UnregisterDate(nsIRDFDate* aDate); |
michael@0 | 73 | nsresult RegisterBlob(BlobImpl* aBlob); |
michael@0 | 74 | nsresult UnregisterBlob(BlobImpl* aBlob); |
michael@0 | 75 | |
michael@0 | 76 | nsresult GetDataSource(const char *aURI, bool aBlock, nsIRDFDataSource **aDataSource ); |
michael@0 | 77 | }; |
michael@0 | 78 | |
michael@0 | 79 | #endif // nsRDFService_h__ |