mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-08 04:09:03 +02:00
This function is an infallible alternative to nsIURI::GetSpec(). It's useful
when it's appropriate to handle a GetSpec() failure with a failure string, e.g.
for log/warning/error messages. It allows code like this:
nsAutoCString spec;
uri->GetSpec(spec);
printf("uri: %s", spec.get());
to be changed to this:
printf("uri: %s", uri->GetSpecOrDefault().get());
This introduces a slight behavioural change. Previously, if GetSpec() failed,
an empty string would be used here. Now, "[nsIURI::GetSpec failed]" will be
produced instead. In most cases this failure string will make for a clearer
log/warning/error message than the empty string.
* * *
Bug 1297961 (part 1b) - More GetSpecOrDefault() additions. r=hurley.
I will fold this into part 1 before landing.
--HG--
extra : rebase_source : ddc19a5624354ac098be019ca13cc24b99b80ddc
|
||
|---|---|---|
| .. | ||
| moz.build | ||
| nsCompositeDataSource.cpp | ||
| nsContainerEnumerator.cpp | ||
| nsDefaultResourceFactory.cpp | ||
| nsInMemoryDataSource.cpp | ||
| nsIRDFCompositeDataSource.idl | ||
| nsIRDFContainer.idl | ||
| nsIRDFContainerUtils.idl | ||
| nsIRDFContentSink.h | ||
| nsIRDFDataSource.idl | ||
| nsIRDFDelegateFactory.idl | ||
| nsIRDFInferDataSource.idl | ||
| nsIRDFInMemoryDataSource.idl | ||
| nsIRDFLiteral.idl | ||
| nsIRDFNode.idl | ||
| nsIRDFObserver.idl | ||
| nsIRDFPropagatableDataSource.idl | ||
| nsIRDFPurgeableDataSource.idl | ||
| nsIRDFRemoteDataSource.idl | ||
| nsIRDFResource.idl | ||
| nsIRDFService.idl | ||
| nsIRDFXMLParser.idl | ||
| nsIRDFXMLSerializer.idl | ||
| nsIRDFXMLSink.idl | ||
| nsIRDFXMLSource.idl | ||
| nsNameSpaceMap.cpp | ||
| nsNameSpaceMap.h | ||
| nsRDFBaseDataSources.h | ||
| nsRDFContainer.cpp | ||
| nsRDFContainerUtils.cpp | ||
| nsRDFContentSink.cpp | ||
| nsRDFContentSinkAtomList.h | ||
| nsRDFService.cpp | ||
| nsRDFService.h | ||
| nsRDFXMLDataSource.cpp | ||
| nsRDFXMLParser.cpp | ||
| nsRDFXMLParser.h | ||
| nsRDFXMLSerializer.cpp | ||
| nsRDFXMLSerializer.h | ||
| rdf.h | ||
| rdfIDataSource.idl | ||
| rdfISerializer.idl | ||
| rdfITripleVisitor.idl | ||
| rdfTriplesSerializer.cpp | ||
| rdfutil.cpp | ||
| rdfutil.h | ||