Use NS_NAMED_LITERAL_CSTRING, see [1] for plenty of examples.

-hb-

[1] https://dxr.mozilla.org/mozilla-central/search?q=NS_NAMED_LITERAL_CSTRING&case=false


On 7/4/17 3:47 PM, Dexter wrote:
Hi everyone!

Could you tell me please, how I can clearly convert char (&name)[N] to 
nsACString?

I tried this:

char* cname = new char[N];
memcpy(cname, &name, N);
nsAutoString strName;
strName.AssignWithConversion(cname, N);

I can't find out how to get nsACString. I could use nsACString instead of 
nsAutoString, but nsACString hasn't AssignWithConversion(), as I know.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to