Bluish Coder

Programming Languages, Martials Arts and Computers. The Weblog of Chris Double.


 

Getting the string value of an attribute

if (source->GetAttr(kNameSpaceID_None, nsGkAtoms::type, type)) {
} 

Comparing Strings

To compare a string against a literal value:

nsAutoString type = ...;
if (type.EqualsLiteral("application/ogg")) {
  ...
}

Converting to ASCII for printf output

nsAutoString type = ...;
printf("Type is %s\n", NS_LossyConvertUTF16toASCII(type).get());
Links