Class XmlEncode

Class Documentation

class XmlEncode

Helper for XML-encoding text (escaping angle brackets, quotes, etc)

Note: doesn’t take ownership of passed strings, and thus the encoded string must outlive the encoding instance.

Public Types

enum ForWhat

Values:

enumerator ForTextNodes
enumerator ForAttributes

Public Functions

XmlEncode(StringRef str, ForWhat forWhat = ForTextNodes)
void encodeTo(std::ostream &os) const

Friends

friend std::ostream &operator<<(std::ostream &os, XmlEncode const &xmlEncode)