Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsSchemaParticles.cpp File Reference
#include "nsSchemaPrivate.h"

Go to the source code of this file.

Functions

 NS_IMPL_ISUPPORTS3_CI (nsSchemaModelGroup, nsISchemaComponent, nsISchemaParticle, nsISchemaModelGroup) NS_IMETHODIMP nsSchemaModelGroup
 NS_IMPL_ISUPPORTS3_CI (nsSchemaModelGroupRef, nsISchemaComponent, nsISchemaParticle, nsISchemaModelGroup) NS_IMETHODIMP nsSchemaModelGroupRef
 NS_IMPL_ISUPPORTS3_CI (nsSchemaAnyParticle, nsISchemaComponent, nsISchemaParticle, nsISchemaAnyParticle) NS_IMETHODIMP nsSchemaAnyParticle
 NS_IMPL_ISUPPORTS3_CI (nsSchemaElement, nsISchemaComponent, nsISchemaParticle, nsISchemaElement) NS_IMETHODIMP nsSchemaElement
 NS_IMPL_ISUPPORTS3_CI (nsSchemaElementRef, nsISchemaComponent, nsISchemaParticle, nsISchemaElement) NS_IMETHODIMP nsSchemaElementRef

Function Documentation

Definition at line 114 of file nsSchemaParticles.cpp.

{
  if (mIsResolved) {
    return NS_OK;
  }

  mIsResolved = PR_TRUE;
  nsresult rv;
  PRUint32 i, count;

  count = mParticles.Count();
  for (i = 0; i < count; ++i) {
    rv = mParticles.ObjectAt(i)->Resolve(aErrorHandler);
    if (NS_FAILED(rv)) {
      nsAutoString name;
      nsresult rc = mParticles.ObjectAt(i)->GetName(name);
      NS_ENSURE_SUCCESS(rc, rc);
      
      nsAutoString errorMsg;
      errorMsg.AppendLiteral("Failure resolving schema particle, cannot ");
      errorMsg.AppendLiteral("resolve particle \"");
      errorMsg.Append(name);
      errorMsg.AppendLiteral("\"");
      
      NS_SCHEMALOADER_FIRE_ERROR(rv, errorMsg);
      
      return rv;
    }
  }

  return NS_OK;
}

Definition at line 299 of file nsSchemaParticles.cpp.

{
  nsresult rv = NS_OK;

  if (mIsResolved) {
    return NS_OK;
  }

  mIsResolved = PR_TRUE;
  if (!mModelGroup && mSchema) {
    // use the namespace and type
    nsCOMPtr<nsISchemaCollection> schemaColl;
    mSchema->GetCollection(getter_AddRefs(schemaColl));
    NS_ENSURE_STATE(schemaColl);

    // get the right schema
    nsCOMPtr<nsISchema> schema;
    schemaColl->GetSchema(mRefNS, getter_AddRefs(schema));
    NS_ENSURE_STATE(schema);

    schema->GetModelGroupByName(mRef, getter_AddRefs(mModelGroup));
  }

  if (mModelGroup) {
    rv = mModelGroup->Resolve(aErrorHandler);
  }

  return rv;
}

Here is the call graph for this function:

Definition at line 440 of file nsSchemaParticles.cpp.

{
  return NS_OK;
}

Definition at line 529 of file nsSchemaParticles.cpp.

{
  if (mIsResolved) {
    return NS_OK;
  }

  mIsResolved = PR_TRUE;
  nsresult rv = NS_OK;
  if (mType && mSchema) {
    nsCOMPtr<nsISchemaType> type;
    rv = mSchema->ResolveTypePlaceholder(aErrorHandler, mType, getter_AddRefs(type));
    if (NS_FAILED(rv)) {
      return rv;
    }
    
    mType = type;
    rv = mType->Resolve(aErrorHandler);
  }

  return rv;
}

Here is the call graph for this function:

Definition at line 697 of file nsSchemaParticles.cpp.

{
  nsresult rv = NS_OK;
  if (mIsResolved) {
    return NS_OK;
  }

  mIsResolved = PR_TRUE;
  if (!mElement && mSchema) {
    if (mRefNS.IsEmpty()) {
      mSchema->GetElementByName(mRef, getter_AddRefs(mElement));
    } else {
      // use the namespace and type
      nsCOMPtr<nsISchemaCollection> schemaColl;
      mSchema->GetCollection(getter_AddRefs(schemaColl));
      NS_ENSURE_STATE(schemaColl);

      schemaColl->GetElement(mRef, mRefNS, getter_AddRefs(mElement));
    }
  }

  if (mElement) {
    rv = mElement->Resolve(aErrorHandler);
  }

  return rv;
}

Here is the call graph for this function: