Loading...
Searching...
No Matches
juce::XmlElement::TextFormat Struct Reference

## Detailed Description

A struct containing options for formatting the text when representing an XML element as a string.

The documentation for this struct was generated from the following file:

- juce_core/xml/juce_XmlElement.h

## Public Member Functions

| TextFormat ()
| Default constructor.
TextFormat | singleLine () const
| returns a copy of this format with newLineChars set to nullptr.
TextFormat | withoutHeader () const
| returns a copy of this format with the addDefaultHeader flag set to false.

## Public Attributes

String | dtd
| If supplied, this DTD will be added to the document.
String | customHeader
| If supplied, this header will be used (and customEncoding & addDefaultHeader will be ignored).
String | customEncoding
| If not empty and addDefaultHeader is true, this will be set as the encoding.
bool | addDefaultHeader = true
| If true, a default header will be generated; otherwise just bare XML will be emitted.
int | lineWrapLength = 60
| A maximum line length before wrapping is done.
const char * | newLineChars = "\r\n"
| Allows the newline characters to be set.

## Constructors and Destructors

## TextFormat()

juce::XmlElement::TextFormat::TextFormat | ( |  | ) |

Default constructor.

Referenced by singleLine(), and withoutHeader().

## Member Functions

## singleLine()

TextFormat juce::XmlElement::TextFormat::singleLine | ( |  | ) | const

nodiscard

returns a copy of this format with newLineChars set to nullptr.

References TextFormat().

## withoutHeader()

TextFormat juce::XmlElement::TextFormat::withoutHeader | ( |  | ) | const

nodiscard

returns a copy of this format with the addDefaultHeader flag set to false.

References TextFormat().

## Member Data Documentation

## dtd

String juce::XmlElement::TextFormat::dtd

If supplied, this DTD will be added to the document.

## customHeader

String juce::XmlElement::TextFormat::customHeader

If supplied, this header will be used (and customEncoding & addDefaultHeader will be ignored).

## customEncoding

String juce::XmlElement::TextFormat::customEncoding

If not empty and addDefaultHeader is true, this will be set as the encoding.

Otherwise, a default of "UTF-8" will be used

## addDefaultHeader

bool juce::XmlElement::TextFormat::addDefaultHeader = true

If true, a default header will be generated; otherwise just bare XML will be emitted.

## lineWrapLength

int juce::XmlElement::TextFormat::lineWrapLength = 60

A maximum line length before wrapping is done.

(If newLineChars is nullptr, this is ignored)

## newLineChars

const char* juce::XmlElement::TextFormat::newLineChars = "\r\n"

Allows the newline characters to be set.

If you set this to nullptr, then the whole XML document will be placed on a single line.

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited