Visit Mozilla.org

nsACString:Insert

From MDC

« XPCOM API Reference

Contents

[edit] Summary

The Insert family of functions inserts a value into a string's internal buffer.

 void Insert(
   const self_type& aString,
   index_type aPosition
 );

[edit] Parameters

aString
[in] A nsACString to append to this string.
aPosition
[in] An offset into the string's internal buffer specifying where to place the given characters.
 void Insert(
   const char_type* aData,
   index_type aPosition,
   size_type aDataLength = PR_UINT32_MAX
 );

[edit] Parameters

aData
[in] A raw character array to append to this string.
aPosition
[in] An offset into the string's internal buffer specifying where to place the given characters.
aDataLength
[in] The length of aData, measured in storage units. If equal to PR_UINT32_MAX, then aData is assumed to be null-terminated. Otherwise, aData need not be null terminated.
 void Insert(
   char_type aChar,
   index_type aPosition
 );

[edit] Parameters

aChar
[in] A character to append to this string.
aPosition
[in] An offset into the string's internal buffer specifying where to place the given characters.

[edit] Remarks

If insufficient memory is available to perform the assignment, then the string's internal buffer will point to a static empty (zero-length) buffer.