<write-segments>

Purpose/Function

Writes bytes to file using the ncsa.tools.ogrescript.file.types.WriteSegment descriptor, which allows greater flexibility in specifying whitespace and returns (see below).

Attributes

NAME

TYPE

DEFAULT VALUE

DESCRIPTION

path

java.lang.String

required

file to write to

append

boolean

false

if true, appends; else overwrites

Elements

TAG

TYPE

COUNT

DESCRIPTION

<segment>

ncsa.tools.ogrescript.file.types.WriteSegment

0:N

segment to add to the list

<segments>

java.util.ArrayList of segments

0:N

entire list of segments to write (will be added to the main list)

See below.

ReturnValues

None.

Examples

...
<write-segments path="test.txt">
   <segment lines="2">TITLE</segment>
   <segments>
      <write-segment tabs="1" line="1">Indented once</write-segment>
      <write-segment tabs="2" line="1">Indented twice</write-segment>
   </segments>
</write-segments>
...

ncsa.tools.ogrescript.file.types.WriteSegment

<write-segment>

Defines a string with the given number of tabulations ('\t') prepended and the given number of line-breaks appended. The toString() method on the element gives the constructed string.

Contents should be provided using the element's TEXT (or a text attribute). Segments can be textless (i.e., comprised of only tabs and/or line breaks).

Attributes

NAME

TYPE

DEFAULT VALUE

DESCRIPTION

tabs

int

0

number of tabs to prepend to text

lineBreaks

int

0

number of line breaks to append to text

Elements

None.

Examples

See above.

  • No labels