2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-01-05 03:53:15 +00:00
|
|
|
|
1999-01-05 21:22:20 +00:00
|
|
|
/*
|
|
|
|
|
|
|
|
The default resource factory implementation. This resource factory
|
|
|
|
produces nsIRDFResource objects for any URI prefix that is not
|
|
|
|
covered by some other factory.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
1999-02-17 22:28:15 +00:00
|
|
|
#include "nsRDFResource.h"
|
1999-01-05 03:53:15 +00:00
|
|
|
|
1999-02-26 10:17:14 +00:00
|
|
|
nsresult
|
|
|
|
NS_NewDefaultResource(nsIRDFResource** aResult)
|
|
|
|
{
|
2012-07-30 14:20:58 +00:00
|
|
|
NS_PRECONDITION(aResult != nullptr, "null ptr");
|
1999-02-26 10:17:14 +00:00
|
|
|
if (! aResult)
|
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
|
|
|
|
nsRDFResource* resource = new nsRDFResource();
|
|
|
|
if (! resource)
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
|
|
|
|
NS_ADDREF(resource);
|
|
|
|
*aResult = resource;
|
|
|
|
return NS_OK;
|
|
|
|
}
|