Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
LocalStoreImpl Class Reference
Inheritance diagram for LocalStoreImpl:
Inheritance graph
[legend]
Collaboration diagram for LocalStoreImpl:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS NS_IMETHOD GetURI (char **aURI)
NS_IMETHOD GetSource (nsIRDFResource *aProperty, nsIRDFNode *aTarget, PRBool aTruthValue, nsIRDFResource **aSource)
NS_IMETHOD GetSources (nsIRDFResource *aProperty, nsIRDFNode *aTarget, PRBool aTruthValue, nsISimpleEnumerator **aSources)
NS_IMETHOD GetTarget (nsIRDFResource *aSource, nsIRDFResource *aProperty, PRBool aTruthValue, nsIRDFNode **aTarget)
NS_IMETHOD GetTargets (nsIRDFResource *aSource, nsIRDFResource *aProperty, PRBool aTruthValue, nsISimpleEnumerator **aTargets)
NS_IMETHOD Assert (nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget, PRBool aTruthValue)
NS_IMETHOD Unassert (nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget)
NS_IMETHOD Change (nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aOldTarget, nsIRDFNode *aNewTarget)
NS_IMETHOD Move (nsIRDFResource *aOldSource, nsIRDFResource *aNewSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget)
NS_IMETHOD HasAssertion (nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget, PRBool aTruthValue, PRBool *hasAssertion)
NS_IMETHOD AddObserver (nsIRDFObserver *aObserver)
NS_IMETHOD RemoveObserver (nsIRDFObserver *aObserver)
NS_IMETHOD HasArcIn (nsIRDFNode *aNode, nsIRDFResource *aArc, PRBool *_retval)
NS_IMETHOD HasArcOut (nsIRDFResource *aSource, nsIRDFResource *aArc, PRBool *_retval)
NS_IMETHOD ArcLabelsIn (nsIRDFNode *aNode, nsISimpleEnumerator **aLabels)
NS_IMETHOD ArcLabelsOut (nsIRDFResource *aSource, nsISimpleEnumerator **aLabels)
NS_IMETHOD GetAllResources (nsISimpleEnumerator **aResult)
NS_IMETHOD GetAllCmds (nsIRDFResource *aSource, nsISimpleEnumerator **aCommands)
NS_IMETHOD IsCommandEnabled (nsISupportsArray *aSources, nsIRDFResource *aCommand, nsISupportsArray *aArguments, PRBool *aResult)
NS_IMETHOD DoCommand (nsISupportsArray *aSources, nsIRDFResource *aCommand, nsISupportsArray *aArguments)
NS_IMETHOD BeginUpdateBatch ()
NS_IMETHOD EndUpdateBatch ()
NS_IMETHOD GetLoaded (PRBool *_result)
NS_IMETHOD Init (const char *uri)
NS_IMETHOD Flush ()
 Request that a data source write it's contents out to permanent storage, if applicable.
NS_IMETHOD FlushTo (const char *aURI)
NS_IMETHOD Refresh (PRBool sync)
nsIRDFResource GetSource (in nsIRDFResource aProperty, in nsIRDFNode aTarget, in boolean aTruthValue)
 Find an RDF resource that points to a given node over the specified arc & truth value.
nsISimpleEnumerator GetSources (in nsIRDFResource aProperty, in nsIRDFNode aTarget, in boolean aTruthValue)
 Find all RDF resources that point to a given node over the specified arc & truth value.
nsIRDFNode GetTarget (in nsIRDFResource aSource, in nsIRDFResource aProperty, in boolean aTruthValue)
 Find a child of that is related to the source by the given arc arc and truth value.
nsISimpleEnumerator GetTargets (in nsIRDFResource aSource, in nsIRDFResource aProperty, in boolean aTruthValue)
 Find all children of that are related to the source by the given arc arc and truth value.
void Assert (in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget, in boolean aTruthValue)
 Add an assertion to the graph.
void Unassert (in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget)
 Remove an assertion from the graph.
void Change (in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aOldTarget, in nsIRDFNode aNewTarget)
 Change an assertion from.
void Move (in nsIRDFResource aOldSource, in nsIRDFResource aNewSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget)
 'Move' an assertion from
boolean HasAssertion (in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget, in boolean aTruthValue)
 Query whether an assertion exists in this graph.
void AddObserver (in nsIRDFObserver aObserver)
 Add an observer to this data source.
void RemoveObserver (in nsIRDFObserver aObserver)
 Remove an observer from this data source.
nsISimpleEnumerator ArcLabelsIn (in nsIRDFNode aNode)
 Get a cursor to iterate over all the arcs that point into a node.
nsISimpleEnumerator ArcLabelsOut (in nsIRDFResource aSource)
 Get a cursor to iterate over all the arcs that originate in a resource.
nsISimpleEnumerator GetAllResources ()
 Retrieve all of the resources that the data source currently refers to.
boolean IsCommandEnabled (in nsISupportsArray aSources, in nsIRDFResource aCommand, in nsISupportsArray aArguments)
 Returns whether a given command is enabled for a set of sources.
void DoCommand (in nsISupportsArray aSources, in nsIRDFResource aCommand, in nsISupportsArray aArguments)
 Perform the specified command on set of sources.
nsISimpleEnumerator GetAllCmds (in nsIRDFResource aSource)
 Returns the set of all commands defined for a given source.
boolean hasArcIn (in nsIRDFNode aNode, in nsIRDFResource aArc)
 Returns true if the specified node is pointed to by the specified arc.
boolean hasArcOut (in nsIRDFResource aSource, in nsIRDFResource aArc)
 Returns true if the specified node has the specified outward arc.
void beginUpdateBatch ()
 Notify observers that the datasource is about to send several notifications at once.
void endUpdateBatch ()
 Notify observers that the datasource has completed issuing a notification group.
void Init (in string aURI)
 Specify the URI for the data source: this is the prefix that will be used to register the data source in the data source registry.
void Refresh (in boolean aBlocking)
 Refresh the remote datasource, re-loading its contents from the URI.
void FlushTo (in string aURI)
void observe (in nsISupports aSubject, in string aTopic, in wstring aData)
 Observe will be called when there is a notification for the topic |aTopic|.

Public Attributes

readonly attribute string URI
 The "URI" of the data source.
readonly attribute boolean loaded
 This value is true when the datasource has fully loaded itself.

Protected Member Functions

 LocalStoreImpl ()
virtual ~LocalStoreImpl ()
nsresult Init ()
nsresult CreateLocalStore (nsIFile *aFile)
nsresult LoadData ()

Protected Attributes

nsCOMPtr< nsIRDFDataSourcemInner
nsCOMPtr< nsISupportsArraymObservers

Static Protected Attributes

static nsWeakPtr gRDF

Friends

NS_IMETHODIMP NS_NewLocalStore (nsISupports *aOuter, REFNSIID aIID, void **aResult)

Detailed Description

Definition at line 70 of file nsLocalStore.cpp.


Constructor & Destructor Documentation

Definition at line 243 of file nsLocalStore.cpp.

{
}
LocalStoreImpl::~LocalStoreImpl ( void  ) [protected, virtual]

Definition at line 247 of file nsLocalStore.cpp.

{
    nsCOMPtr<nsIRDFService> rdf = do_QueryReferent(gRDF);
    if (rdf)
        rdf->UnregisterDataSource(this);
}

Here is the call graph for this function:


Member Function Documentation

Add an observer to this data source.

If the datasource supports observers, the datasource source should hold a strong reference to the observer.

Here is the caller graph for this function:

Definition at line 165 of file nsLocalStore.cpp.

                                                      {
        // Observers are _never_ notified, but we still have to play
        // nice.
        if (! mObservers) {
            nsresult rv;
            rv = NS_NewISupportsArray(getter_AddRefs(mObservers));
            if (NS_FAILED(rv)) return rv;
        }

        mObservers->AppendElement(aObserver);
        return NS_OK;
    }

Here is the call graph for this function:

Get a cursor to iterate over all the arcs that point into a node.

Returns:
NS_OK unless a catastrophic error occurs. If the method returns NS_OK, you may assume that labels points to a valid (but possible empty) nsISimpleEnumerator object.

Here is the caller graph for this function:

NS_IMETHOD LocalStoreImpl::ArcLabelsIn ( nsIRDFNode aNode,
nsISimpleEnumerator **  aLabels 
) [inline]

Definition at line 193 of file nsLocalStore.cpp.

                                                          {
        return mInner->ArcLabelsIn(aNode, aLabels);
    }

Get a cursor to iterate over all the arcs that originate in a resource.

Returns:
NS_OK unless a catastrophic error occurs. If the method returns NS_OK, you may assume that labels points to a valid (but possible empty) nsISimpleEnumerator object.

Here is the caller graph for this function:

Definition at line 198 of file nsLocalStore.cpp.

                                                           {
        return mInner->ArcLabelsOut(aSource, aLabels);
    }
void nsIRDFDataSource::Assert ( in nsIRDFResource  aSource,
in nsIRDFResource  aProperty,
in nsIRDFNode  aTarget,
in boolean  aTruthValue 
) [inherited]

Add an assertion to the graph.

Here is the caller graph for this function:

NS_IMETHOD LocalStoreImpl::Assert ( nsIRDFResource aSource,
nsIRDFResource aProperty,
nsIRDFNode aTarget,
PRBool  aTruthValue 
) [inline]

Definition at line 130 of file nsLocalStore.cpp.

                                          {
        return mInner->Assert(aSource, aProperty, aTarget, aTruthValue);
    }

Definition at line 219 of file nsLocalStore.cpp.

                                  {
        return mInner->BeginUpdateBatch();
    }

Notify observers that the datasource is about to send several notifications at once.

This must be followed by calling endUpdateBatch(), otherwise viewers will get out of sync.

void nsIRDFDataSource::Change ( in nsIRDFResource  aSource,
in nsIRDFResource  aProperty,
in nsIRDFNode  aOldTarget,
in nsIRDFNode  aNewTarget 
) [inherited]

Change an assertion from.

[aSource]--[aProperty]-->[aOldTarget]

to

[aSource]--[aProperty]-->[aNewTarget]

Here is the caller graph for this function:

NS_IMETHOD LocalStoreImpl::Change ( nsIRDFResource aSource,
nsIRDFResource aProperty,
nsIRDFNode aOldTarget,
nsIRDFNode aNewTarget 
) [inline]

Definition at line 143 of file nsLocalStore.cpp.

                                              {
        return mInner->Change(aSource, aProperty, aOldTarget, aNewTarget);
    }

Definition at line 408 of file nsLocalStore.cpp.

{
    nsresult rv;

    rv = aFile->Create(nsIFile::NORMAL_FILE_TYPE, 0666);
    if (NS_FAILED(rv)) return rv;

    nsCOMPtr<nsIOutputStream> outStream;
    rv = NS_NewLocalFileOutputStream(getter_AddRefs(outStream), aFile);
    if (NS_FAILED(rv)) return rv;

    const char defaultRDF[] = 
        "<?xml version=\"1.0\"?>\n" \
        "<RDF:RDF xmlns:RDF=\"" RDF_NAMESPACE_URI "\"\n" \
        "         xmlns:NC=\""  NC_NAMESPACE_URI "\">\n" \
        "  <!-- Empty -->\n" \
        "</RDF:RDF>\n";

    PRUint32 count;
    rv = outStream->Write(defaultRDF, sizeof(defaultRDF)-1, &count);
    if (NS_FAILED(rv)) return rv;

    if (count != sizeof(defaultRDF)-1)
        return NS_ERROR_UNEXPECTED;

    // Okay, now see if the file exists _for real_. If it's still
    // not there, it could be that the profile service gave us
    // back a read-only directory. Whatever.
    PRBool fileExistsFlag = PR_FALSE;
    aFile->Exists(&fileExistsFlag);
    if (!fileExistsFlag)
        return NS_ERROR_UNEXPECTED;

    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIRDFDataSource::DoCommand ( in nsISupportsArray  aSources,
in nsIRDFResource  aCommand,
in nsISupportsArray  aArguments 
) [inherited]

Perform the specified command on set of sources.

Here is the caller graph for this function:

Definition at line 530 of file nsLocalStore.cpp.

{
    // no-op
    return NS_OK;
}

Definition at line 223 of file nsLocalStore.cpp.

                                {
        return mInner->EndUpdateBatch();
    }

Notify observers that the datasource has completed issuing a notification group.

Request that a data source write it's contents out to permanent storage, if applicable.

Implements nsIRDFRemoteDataSource.

Definition at line 349 of file nsLocalStore.cpp.

{
       nsCOMPtr<nsIRDFRemoteDataSource> remote = do_QueryInterface(mInner);
    NS_ASSERTION(remote != nsnull, "not an nsIRDFRemoteDataSource");
       if (! remote)
        return NS_ERROR_UNEXPECTED;

    return remote->Flush();
}

Here is the call graph for this function:

Definition at line 360 of file nsLocalStore.cpp.

{
  // Do not ever implement this (security)
  return NS_ERROR_NOT_IMPLEMENTED;
}

Definition at line 513 of file nsLocalStore.cpp.

Here is the call graph for this function:

Returns the set of all commands defined for a given source.

Here is the caller graph for this function:

Retrieve all of the resources that the data source currently refers to.

Here is the caller graph for this function:

Definition at line 203 of file nsLocalStore.cpp.

                                                              {
        return mInner->GetAllResources(aResult);
    }

Definition at line 331 of file nsLocalStore.cpp.

{
       nsCOMPtr<nsIRDFRemoteDataSource> remote = do_QueryInterface(mInner);
    NS_ASSERTION(remote != nsnull, "not an nsIRDFRemoteDataSource");
       if (! remote)
        return NS_ERROR_UNEXPECTED;

    return remote->GetLoaded(_result);
}

Here is the call graph for this function:

nsIRDFResource nsIRDFDataSource::GetSource ( in nsIRDFResource  aProperty,
in nsIRDFNode  aTarget,
in boolean  aTruthValue 
) [inherited]

Find an RDF resource that points to a given node over the specified arc & truth value.

Returns:
NS_RDF_NO_VALUE if there is no source that leads to the target with the specified property.

Here is the caller graph for this function:

NS_IMETHOD LocalStoreImpl::GetSource ( nsIRDFResource aProperty,
nsIRDFNode aTarget,
PRBool  aTruthValue,
nsIRDFResource **  aSource 
) [inline]

Definition at line 102 of file nsLocalStore.cpp.

                                                   {
        return mInner->GetSource(aProperty, aTarget, aTruthValue, aSource);
    }
nsISimpleEnumerator nsIRDFDataSource::GetSources ( in nsIRDFResource  aProperty,
in nsIRDFNode  aTarget,
in boolean  aTruthValue 
) [inherited]

Find all RDF resources that point to a given node over the specified arc & truth value.

Returns:
NS_OK unless a catastrophic error occurs. If the method returns NS_OK, you may assume that nsISimpleEnumerator points to a valid (but possibly empty) cursor.

Here is the caller graph for this function:

NS_IMETHOD LocalStoreImpl::GetSources ( nsIRDFResource aProperty,
nsIRDFNode aTarget,
PRBool  aTruthValue,
nsISimpleEnumerator **  aSources 
) [inline]

Definition at line 109 of file nsLocalStore.cpp.

                                                          {
        return mInner->GetSources(aProperty, aTarget, aTruthValue, aSources);
    }
nsIRDFNode nsIRDFDataSource::GetTarget ( in nsIRDFResource  aSource,
in nsIRDFResource  aProperty,
in boolean  aTruthValue 
) [inherited]

Find a child of that is related to the source by the given arc arc and truth value.

Returns:
NS_RDF_NO_VALUE if there is no target accessable from the source via the specified property.

Here is the caller graph for this function:

NS_IMETHOD LocalStoreImpl::GetTarget ( nsIRDFResource aSource,
nsIRDFResource aProperty,
PRBool  aTruthValue,
nsIRDFNode **  aTarget 
) [inline]

Definition at line 116 of file nsLocalStore.cpp.

                                               {
        return mInner->GetTarget(aSource, aProperty, aTruthValue, aTarget);
    }
nsISimpleEnumerator nsIRDFDataSource::GetTargets ( in nsIRDFResource  aSource,
in nsIRDFResource  aProperty,
in boolean  aTruthValue 
) [inherited]

Find all children of that are related to the source by the given arc arc and truth value.

Returns:
NS_OK unless a catastrophic error occurs. If the method returns NS_OK, you may assume that nsISimpleEnumerator points to a valid (but possibly empty) cursor.

Here is the caller graph for this function:

NS_IMETHOD LocalStoreImpl::GetTargets ( nsIRDFResource aSource,
nsIRDFResource aProperty,
PRBool  aTruthValue,
nsISimpleEnumerator **  aTargets 
) [inline]

Definition at line 123 of file nsLocalStore.cpp.

                                                          {
        return mInner->GetTargets(aSource, aProperty, aTruthValue, aTargets);
    }

Definition at line 498 of file nsLocalStore.cpp.

{
    NS_PRECONDITION(aURI != nsnull, "null ptr");
    if (! aURI)
        return NS_ERROR_NULL_POINTER;

    *aURI = nsCRT::strdup("rdf:local-store");
    if (! *aURI)
        return NS_ERROR_OUT_OF_MEMORY;

    return NS_OK;
}
NS_IMETHOD LocalStoreImpl::HasArcIn ( nsIRDFNode aNode,
nsIRDFResource aArc,
PRBool _retval 
) [inline]

Definition at line 185 of file nsLocalStore.cpp.

                                                                                  {
        return mInner->HasArcIn(aNode, aArc, _retval);
    }
boolean nsIRDFDataSource::hasArcIn ( in nsIRDFNode  aNode,
in nsIRDFResource  aArc 
) [inherited]

Returns true if the specified node is pointed to by the specified arc.

Equivalent to enumerating ArcLabelsIn and comparing for the specified arc.

NS_IMETHOD LocalStoreImpl::HasArcOut ( nsIRDFResource aSource,
nsIRDFResource aArc,
PRBool _retval 
) [inline]

Definition at line 189 of file nsLocalStore.cpp.

                                                                                         {
        return mInner->HasArcOut(aSource, aArc, _retval);
    }

Returns true if the specified node has the specified outward arc.

Equivalent to enumerating ArcLabelsOut and comparing for the specified arc.

boolean nsIRDFDataSource::HasAssertion ( in nsIRDFResource  aSource,
in nsIRDFResource  aProperty,
in nsIRDFNode  aTarget,
in boolean  aTruthValue 
) [inherited]

Query whether an assertion exists in this graph.

Here is the caller graph for this function:

NS_IMETHOD LocalStoreImpl::HasAssertion ( nsIRDFResource aSource,
nsIRDFResource aProperty,
nsIRDFNode aTarget,
PRBool  aTruthValue,
PRBool hasAssertion 
) [inline]

Definition at line 157 of file nsLocalStore.cpp.

                                                  {
        return mInner->HasAssertion(aSource, aProperty, aTarget, aTruthValue, hasAssertion);
    }
void nsIRDFRemoteDataSource::Init ( in string  aURI) [inherited]

Specify the URI for the data source: this is the prefix that will be used to register the data source in the data source registry.

Parameters:
aURIthe URI to load
nsresult LocalStoreImpl::Init ( void  ) [protected]

Definition at line 378 of file nsLocalStore.cpp.

{
    nsresult rv;

    rv = LoadData();
    if (NS_FAILED(rv)) return rv;

    // register this as a named data source with the RDF service
    nsCOMPtr<nsIRDFService> rdf = do_GetService(NS_RDF_CONTRACTID "/rdf-service;1", &rv);
    if (NS_FAILED(rv)) return rv;

    // for later
    if (!gRDF)
        gRDF = do_GetWeakReference(rdf);

    rdf->RegisterDataSource(this, PR_FALSE);

    // Register as an observer of profile changes
    nsCOMPtr<nsIObserverService> obs =
        do_GetService("@mozilla.org/observer-service;1");

    if (obs) {
        obs->AddObserver(this, "profile-before-change", PR_TRUE);
        obs->AddObserver(this, "profile-do-change", PR_TRUE);
    }

    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 343 of file nsLocalStore.cpp.

{
       return(NS_OK);
}
boolean nsIRDFDataSource::IsCommandEnabled ( in nsISupportsArray  aSources,
in nsIRDFResource  aCommand,
in nsISupportsArray  aArguments 
) [inherited]

Returns whether a given command is enabled for a set of sources.

Here is the caller graph for this function:

NS_IMETHODIMP LocalStoreImpl::IsCommandEnabled ( nsISupportsArray aSources,
nsIRDFResource aCommand,
nsISupportsArray aArguments,
PRBool aResult 
)

Definition at line 520 of file nsLocalStore.cpp.

Definition at line 445 of file nsLocalStore.cpp.

{
    nsresult rv;

    // Look for localstore.rdf in the current profile
    // directory. Bomb if we can't find it.

    nsCOMPtr<nsIFile> aFile;
    rv = NS_GetSpecialDirectory(NS_APP_LOCALSTORE_50_FILE, getter_AddRefs(aFile));
    if (NS_FAILED(rv)) return rv;

    PRBool fileExistsFlag = PR_FALSE;
    (void)aFile->Exists(&fileExistsFlag);
    if (!fileExistsFlag) {
        // if file doesn't exist, create it
        rv = CreateLocalStore(aFile);
        if (NS_FAILED(rv)) return rv;
    }

    mInner = do_CreateInstance(NS_RDF_DATASOURCE_CONTRACTID_PREFIX "xml-datasource", &rv);
    if (NS_FAILED(rv)) return rv;

    nsCOMPtr<nsIRDFRemoteDataSource> remote = do_QueryInterface(mInner, &rv);
    if (NS_FAILED(rv)) return rv;

    nsCOMPtr<nsIURI> aURI;
    rv = NS_NewFileURI(getter_AddRefs(aURI), aFile);
    if (NS_FAILED(rv)) return rv;

    nsCAutoString spec;
    rv = aURI->GetSpec(spec);
    if (NS_FAILED(rv)) return rv;

    rv = remote->Init(spec.get());
    if (NS_FAILED(rv)) return rv;

    // Read the datasource synchronously.
    rv = remote->Refresh(PR_TRUE);
    
    if (NS_FAILED(rv)) {
        // Load failed, delete and recreate a fresh localstore
        aFile->Remove(PR_TRUE);
        rv = CreateLocalStore(aFile);
        if (NS_FAILED(rv)) return rv;
        
        rv = remote->Refresh(PR_TRUE);
    }

    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIRDFDataSource::Move ( in nsIRDFResource  aOldSource,
in nsIRDFResource  aNewSource,
in nsIRDFResource  aProperty,
in nsIRDFNode  aTarget 
) [inherited]

'Move' an assertion from

[aOldSource]--[aProperty]-->[aTarget]

to

[aNewSource]--[aProperty]-->[aTarget]

Here is the caller graph for this function:

NS_IMETHOD LocalStoreImpl::Move ( nsIRDFResource aOldSource,
nsIRDFResource aNewSource,
nsIRDFResource aProperty,
nsIRDFNode aTarget 
) [inline]

Definition at line 150 of file nsLocalStore.cpp.

                                         {
        return mInner->Move(aOldSource, aNewSource, aProperty, aTarget);
    }
void nsIObserver::observe ( in nsISupports  aSubject,
in string  aTopic,
in wstring  aData 
) [inherited]

Observe will be called when there is a notification for the topic |aTopic|.

This assumes that the object implementing this interface has been registered with an observer service such as the nsIObserverService.

If you expect multiple topics/subjects, the impl is responsible for filtering.

You should not modify, add, remove, or enumerate notifications in the implemention of observe.

Parameters:
aSubject: Notification specific interface pointer.
aTopic: The notification topic or subject.
aData: Notification specific wide string. subject event.
void nsIRDFRemoteDataSource::Refresh ( in boolean  aBlocking) [inherited]

Refresh the remote datasource, re-loading its contents from the URI.

Parameters:
aBlockingIf true, the call will block until the datasource has completely reloaded.

Definition at line 367 of file nsLocalStore.cpp.

{
       nsCOMPtr<nsIRDFRemoteDataSource> remote = do_QueryInterface(mInner);
    NS_ASSERTION(remote != nsnull, "not an nsIRDFRemoteDataSource");
       if (! remote)
        return NS_ERROR_UNEXPECTED;

    return remote->Refresh(sync);
}

Here is the call graph for this function:

Remove an observer from this data source.

Here is the caller graph for this function:

Definition at line 178 of file nsLocalStore.cpp.

                                                         {
        if (mObservers) {
            mObservers->RemoveElement(aObserver);
        }
        return NS_OK;
    }
void nsIRDFDataSource::Unassert ( in nsIRDFResource  aSource,
in nsIRDFResource  aProperty,
in nsIRDFNode  aTarget 
) [inherited]

Remove an assertion from the graph.

Here is the caller graph for this function:

NS_IMETHOD LocalStoreImpl::Unassert ( nsIRDFResource aSource,
nsIRDFResource aProperty,
nsIRDFNode aTarget 
) [inline]

Definition at line 137 of file nsLocalStore.cpp.

                                             {
        return mInner->Unassert(aSource, aProperty, aTarget);
    }

Friends And Related Function Documentation

NS_IMETHODIMP NS_NewLocalStore ( nsISupports *  aOuter,
REFNSIID  aIID,
void **  aResult 
) [friend]

Definition at line 256 of file nsLocalStore.cpp.

{
    NS_PRECONDITION(aOuter == nsnull, "no aggregation");
    if (aOuter)
        return NS_ERROR_NO_AGGREGATION;

    NS_PRECONDITION(aResult != nsnull, "null ptr");
    if (! aResult)
        return NS_ERROR_NULL_POINTER;

    LocalStoreImpl* impl = new LocalStoreImpl();
    if (! impl)
        return NS_ERROR_OUT_OF_MEMORY;

    NS_ADDREF(impl);

    nsresult rv;
    rv = impl->Init();
    if (NS_SUCCEEDED(rv)) {
        // Set up the result pointer
        rv = impl->QueryInterface(aIID, aResult);
    }

    NS_RELEASE(impl);
    return rv;
}

Member Data Documentation

nsWeakPtr LocalStoreImpl::gRDF [static, protected]

Definition at line 90 of file nsLocalStore.cpp.

This value is true when the datasource has fully loaded itself.

Definition at line 50 of file nsIRDFRemoteDataSource.idl.

Definition at line 77 of file nsLocalStore.cpp.

Definition at line 88 of file nsLocalStore.cpp.

readonly attribute string nsIRDFDataSource::URI [inherited]

The "URI" of the data source.

This used by the RDF service's |GetDataSource()| method to cache datasources.

Definition at line 56 of file nsIRDFDataSource.idl.


The documentation for this class was generated from the following file: