nsresult rv; nsXPIDLCString protocol; rv = aURI->GetScheme(getter_Copies(protocol)); if (NS_SUCCEEDED(rv)) { if (PL_strcmp(protocol, "file") == 0) { return PR_TRUE; } }  return PR_FALSE;
NS_ASSERTION(aURI, "bad caller"); PRBool isFile = PR_FALSE; aURI->SchemeIs("file", &isFile); return isFile;
static PRBool IsFileURI(nsIURI* aURI){  nsresult rv;  nsXPIDLCString protocol;  rv = aURI->GetScheme(getter_Copies(protocol));  if (NS_SUCCEEDED(rv)) {    if (PL_strcmp(protocol, "file") == 0) {        return PR_TRUE;    }  }  return PR_FALSE;}