michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: michael@0: The default resource factory implementation. This resource factory michael@0: produces nsIRDFResource objects for any URI prefix that is not michael@0: covered by some other factory. michael@0: michael@0: */ michael@0: michael@0: #include "nsRDFResource.h" michael@0: michael@0: nsresult michael@0: NS_NewDefaultResource(nsIRDFResource** aResult) michael@0: { michael@0: NS_PRECONDITION(aResult != nullptr, "null ptr"); michael@0: if (! aResult) michael@0: return NS_ERROR_NULL_POINTER; michael@0: michael@0: nsRDFResource* resource = new nsRDFResource(); michael@0: if (! resource) michael@0: return NS_ERROR_OUT_OF_MEMORY; michael@0: michael@0: NS_ADDREF(resource); michael@0: *aResult = resource; michael@0: return NS_OK; michael@0: }