JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::XmlElement::TextFormat Struct Reference

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

#include <juce_XmlElement.h>

Collaboration diagram for juce::XmlElement::TextFormat:

Public Member Functions

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

Public Attributes

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

Detailed Description

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

Constructor & Destructor Documentation

◆ TextFormat()

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

Default constructor.

Member Function Documentation

◆ singleLine()

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

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

◆ withoutHeader()

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

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

Member Data Documentation

◆ addDefaultHeader

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

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

◆ 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

◆ customHeader

String juce::XmlElement::TextFormat::customHeader

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

◆ dtd

String juce::XmlElement::TextFormat::dtd

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

◆ 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.


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