BARfly Help - BAR Interfacial Function Reference - BAR data writing functions

  BAR::Replace_Text_Data

Purpose: To replace the current node's text data from an input buffer.

bool Replace_Text_Data(const char *Text);
bool Replace_Text_Data(LPCWSTR Text)
;


Parameters

  • const char *Text: A pointer to a source buffer (8-bit characters).
  • LPCWSTR Text: A pointer to a source buffer (16-bit characters).

Return Values

  • True: Successful copy.
  • False: Error.

Remarks

This function replaces the contents of the current node’s encompassed data, if any, with the text characters identified by Text. There are two variants:  one writes from an 8-bit character string and the other writes from a 16-bit character string.

The null character (one byte for 8-bit sources and two bytes for 16-bit sources) signifies the size of the buffer to copy. The null character is not itself copied.

No format conversion occurs unless the written-to node is a text block. In the case of text blocks, characters of a specific size are automatically converted from their source equivalents in Text. If a 16-bit character string is the source format, it is assumed to be little-endian byte order.

The error BAR_INVALID_WRITE_CONTEXT is set if the current node is not an unorganized block.

On success, this function implicitly calls Next.

The function fails if no file was loaded, if Text was an invalid location, if the type of construct was not an unorganized block, or if there was not enough memory to complete the operation.

Compatibility

  All Platforms Win32 C++ LIB
BAR version X 1.1
  All Platforms Win32
BARfly version X 1.0


  See also:  [BAR type lookup functions] [BAR loading and saving functions] [BAR node navigation functions]
[BAR node information functions] [BAR data reading functions] [BAR data writing functions] [BAR miscellaneous functions]


BARfly Help Copyright © 2009 Christopher Allen