BARfly Help - Node editing - Editing data - Text view

  Editing - Text view

This page describes content of the BARfly Silver and BARfly Gold builds.

Editing in text view is very straightforward.  You work with a single edit control, which displays plain text.  You edit the text, click "Accept" or press F2, and you're done.

Unlike dump view, text view does not process any type of markup.  Every character you type into the edit control translates into a character that goes into the node you have chosen to edit.

Text fields can range signficantly in size.  For this reason, the edit control is multi-line.  Small fields will only use the first line, while larger fields will use several lines.  For fields that use several lines, wrapping is implemented for long lines.  If no line break occurs on the end of a line, the line wraps around to the next line.

Keep in mind that text blocks scale the character size appropriately.  For a text block of unit type short, each short integer translates into a character in the edit control.  For non-text blocks, there is a one-to-one conversion ratio between source bytes and characters translated.

Sub-topic:  Line breaks

BARfly reports line breaks that naturally occur in the source data as physical line breaks in the edit control.  By changing the Options.Text View settings, you control what character combination BARfly treats as a line break.

By default, BARfly assumes that lines are broken with a carriage return/line feed combination.  You can set the line break code to any of the following:

  • Carriage Return + Line Feed (CR+LF) combination.  This is the default, which is ASCII 13 followed by ASCII 10.
  • Line Feed Only.  This is a common line break format for Unix-based plain text.  It consists of only ASCII 10.
  • Custom Character Code.  You can set any ASCII code, from 0 to 255, to function as a line break.
  • No Line Breaks.  You can have BARfly ignore line breaks when reading input and generating output, if desired.

If you want, you can set a custom character code for an unusual line break format.  For example, on rare occasions you will find formats that terminate lines with just a carriage return character.  By setting the custom code to 13, the text becomes much easier to read.

Some file formats place many null-terminated strings back-to-back in the same block.  By settings the custom code to 0, which is the null character, you can make "line breaks" out of the string terminators.

If an unconverted null byte appears anywhere in the source data (custom code is not 0), BARfly will not show the text beyond the null byte.

Failure to select a correct line break combination usually has the effect of not breaking the line, and in many cases, placing unprintable "box" characters on just a single line, in place of the locations where you would expect line breaks.  If you get this result, it is a simple matter to go to Options.Text View, select the correct line break combination, and then press the "Text" view style button again to update the view.

When you accept changes to text view, the line break choice is honored when updating the changes.  For example, if you selected a dollar sign ($) to act as a line break, all line breaks in the control will be translated to dollar signs.

Sub-topic:  Automatic nulls at end of line

There is more than one way to size portions of text.  There are two prevailing means of determining the size of text:

  • A length field (usually located in the data preceding the text).
  • A terminator (in most cases, a null byte).

In case you need to use the second option, and terminate all the lines of text that you enter with null bytes (ASCII 0), BARfly performs automatic null-byte append operations when you accept your changes.  You can choose the node types on which to perform this automatic null-byte append operation by selecting Options.Text View.

If you wish to append null bytes to structures edited in text view, you get an additional option:  whether to allow for "hacking off" the null byte in case the entire text you have typed, plus null byte, is 1 byte over the size of the structure itself.  For example, a four-byte structure containing a 4-byte array of characters actually ends up receiving a 5-byte value if you had typed the word "CODE" into the edit control.  Select Options.Text View and check the box "Do not place for structures if no room" to keep the string at 4 bytes in such a case.  If the box is not checked, an error results due to the string size exceeding the structure's maximum size.

Click here for information about changing text view settings.

Click here for general information about text view.


  See also: [Editing data in the data display view] [Editing - Subnode view] [Editing - Dump view] [Editing - Text view] [Editing - Raw view] [Copying and pasting data]


BARfly Help Copyright © 2009 Christopher Allen