mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 02:57:38 +00:00
Comments, fix for MSVC 4.2
This commit is contained in:
parent
a3fbabc790
commit
40f95bbe2f
@ -434,6 +434,8 @@ const char* nsBookmarkDataSource::kBookmarksFilename = "bookmarks.html";
|
||||
|
||||
nsBookmarkDataSource::nsBookmarkDataSource(void)
|
||||
{
|
||||
// XXX rvg there should be only one instance of this class.
|
||||
// this is actually true of all datasources.
|
||||
NS_INIT_REFCNT();
|
||||
ReadBookmarks(); // XXX do or die, eh?
|
||||
Initialize(kURI_bookmarks);
|
||||
|
@ -757,7 +757,8 @@ nsRDFElement::ChildCount(PRInt32& aResult) const
|
||||
{
|
||||
nsresult rv;
|
||||
if (!mChildren) {
|
||||
if (NS_FAILED(rv = GenerateChildren()))
|
||||
nsRDFElement* unconstThis = const_cast<nsRDFElement*>(this);
|
||||
if (NS_FAILED(rv = unconstThis->GenerateChildren()))
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -770,7 +771,8 @@ nsRDFElement::ChildAt(PRInt32 aIndex, nsIContent*& aResult) const
|
||||
{
|
||||
nsresult rv;
|
||||
if (!mChildren) {
|
||||
if (NS_FAILED(rv = GenerateChildren()))
|
||||
nsRDFElement* unconstThis = const_cast<nsRDFElement*>(this);
|
||||
if (NS_FAILED(rv = unconstThis->GenerateChildren()))
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -1243,7 +1245,7 @@ nsRDFElement::GetProperty(const nsString& aPropertyURI, nsString& rValue) const
|
||||
// would do the work of transforming it for presentation.)
|
||||
//
|
||||
nsresult
|
||||
nsRDFElement::GenerateChildren(void) const
|
||||
nsRDFElement::GenerateChildren(void)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
@ -1350,7 +1352,7 @@ done:
|
||||
|
||||
nsresult
|
||||
nsRDFElement::CreateChild(nsIRDFNode* value,
|
||||
nsIRDFContent*& result) const
|
||||
nsIRDFContent*& result)
|
||||
{
|
||||
// XXX I wish that we could avoid doing it "by hand" like this
|
||||
// (i.e., use interface methods so that we could extend to other
|
||||
@ -1380,7 +1382,7 @@ nsRDFElement::CreateChild(nsIRDFNode* value,
|
||||
nsresult
|
||||
nsRDFElement::CreateChild(nsIRDFNode* property,
|
||||
nsIRDFNode* value,
|
||||
nsIRDFContent*& result) const
|
||||
nsIRDFContent*& result)
|
||||
{
|
||||
nsresult rv;
|
||||
nsRDFElement* child = NULL;
|
||||
|
@ -127,14 +127,14 @@ protected:
|
||||
PRInt32 mNameSpaceId;
|
||||
void* mScriptObject;
|
||||
nsIRDFNode* mResource;
|
||||
mutable nsISupportsArray* mChildren;
|
||||
nsISupportsArray* mChildren;
|
||||
nsIContent* mParent;
|
||||
|
||||
nsresult GenerateChildren(void) const;
|
||||
nsresult CreateChild(nsIRDFNode* value, nsIRDFContent*& result) const;
|
||||
nsresult GenerateChildren(void);
|
||||
nsresult CreateChild(nsIRDFNode* value, nsIRDFContent*& result);
|
||||
nsresult CreateChild(nsIRDFNode* property,
|
||||
nsIRDFNode* value,
|
||||
nsIRDFContent*& result) const;
|
||||
nsIRDFContent*& result);
|
||||
};
|
||||
|
||||
#endif // nsRDFElement_h___
|
||||
|
@ -26,26 +26,25 @@
|
||||
|
||||
/*
|
||||
|
||||
XXX --- chris, are you happy with this (I rewrote it).
|
||||
|
||||
A simple "database" implementation. An RDF database is just a
|
||||
"strategy" pattern for combining individual data sources into a
|
||||
collective graph.
|
||||
|
||||
This implementation is pretty much lifted straight out of the old C
|
||||
RDF implementation. As such, it inheirits some horrible problems.
|
||||
|
||||
1) A database is a hard-coded collection of data sources. What you'd
|
||||
really like would be fore data sources to be discovered at
|
||||
runtime, and added in to the database as needed.
|
||||
1) A database is a sequence of data sources. The set of data sources
|
||||
can be specified during creation of the database. Data sources
|
||||
can also be added/deleted from a database later.
|
||||
|
||||
2) The aggregation mechanism is horribly ad hoc, specifically, with
|
||||
respect to negative assertions. It works something like this.
|
||||
Check the "first" data source for a negative assertion. If it has
|
||||
one, then return it. Otherwise, check the "rest" of the data
|
||||
sources for a positive assertion.
|
||||
2) The aggregation mechanism is based on simple super-positioning of
|
||||
the graphs from the datasources. If there is a conflict (i.e.,
|
||||
data source A has a true arc from foo to bar while data source B
|
||||
has a false arc from foo to bar), the data source that it earlier
|
||||
in the sequence wins.
|
||||
|
||||
3) Related to the above, there are no clear semantics for ordering
|
||||
or precedence. Things all depend on the order that you said "add
|
||||
this data source".
|
||||
The implementation below doesn't really do this and needs to be
|
||||
fixed.
|
||||
|
||||
*/
|
||||
|
||||
@ -173,6 +172,8 @@ MultiCursor::HasMoreElements(PRBool& result)
|
||||
return rv;
|
||||
|
||||
// See if data source zero has the negation
|
||||
// XXX --- this needs to be fixed so that we look at all the prior
|
||||
// data sources for negations
|
||||
PRBool hasNegation;
|
||||
if (NS_FAILED(rv = HasNegation(mDataSource0,
|
||||
mNextResult,
|
||||
@ -336,6 +337,8 @@ dbArcCursorImpl::HasNegation(nsIRDFDataSource* ds0,
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsSimpleDataBase
|
||||
// XXX --- shouldn't this take a char** argument indicating the data sources
|
||||
// we want to aggregate?
|
||||
|
||||
nsSimpleDataBase::nsSimpleDataBase(void)
|
||||
{
|
||||
@ -622,6 +625,9 @@ nsSimpleDataBase::Flush()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// nsIRDFDataBase methods
|
||||
// XXX We should make this take an additional argument specifying where
|
||||
// in the sequence of data sources (of the db), the new data source should
|
||||
// fit in. Right now, the new datasource gets stuck at the end.
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSimpleDataBase::AddDataSource(nsIRDFDataSource* source)
|
||||
|
Loading…
Reference in New Issue
Block a user