InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CXMLOutStream Class Referenceabstract
Inheritance diagram for CXMLOutStream:
CPMUnknown< IXMLOutStream >IXMLOutStreamIPMUnknown

Public Types

typedef K2::stack< WideString,
K2Vector< WideString > > 
TagStack
 

Public Member Functions

 CXMLOutStream (IPMUnknown *boss)
 
virtual bool16 Open (eEncodingType encoding=kUTF16, bool16 stripInvalid=kTrue)=0
 
virtual void Close ()=0
 
virtual ErrorCode Flush ()
 
virtual void DocHeader (const WideString &version, bool16 standalone)
 
virtual void TextDeclaration (const WideString &version)
 
virtual void DocType (const WideString &root, const WideString &URI)
 
virtual void DocType (const WideString &root, const WideString &name, const WideString &URI)
 
virtual void BeginDocType (const WideString &root, bool16 newLine)
 
virtual void BeginDocType (const WideString &root, const WideString &systemIDLiteral, bool16 newLine)
 
virtual void BeginDocType (const WideString &root, const WideString &publicIDLiteral, const WideString &systemIDLiteral, bool16 newLine)
 
virtual void EndDocType (bool16 newLine)
 
virtual void WriteAttributeList (const WideString &elementName, const AttributeDfnList &dfns, bool16 newLine)
 
virtual void BeginElementTypeDecl (const WideString &elementName, bool16 newLine)
 
virtual void EndElementTypeDecl (bool16 newLine)
 
virtual void BeginContentModelDecl (eContentParticleSeparator separator, bool16 newLine)
 
virtual void EndContentModelDecl (eContentParticleOccurrence occurrence, bool16 newLine)
 
virtual void BeginMixedContentModelDecl (eContentParticleSeparator separator, bool16 newLine)
 
virtual void EndMixedContentModelDecl (bool16 writeOccurrence, bool16 newLine)
 
virtual void WriteSeparator (eContentParticleSeparator separator, bool16 newLine)
 
virtual void WriteContentParticle (const WideString &contentParticleName, eContentParticleOccurrence occurrence, bool16 newLine)
 
virtual void WriteKeyword (eKeyword keyword, bool16 newLine)
 
virtual void BeginAttListDecl (const WideString &elementName, bool16 newLine)
 
virtual void EndAttListDecl (bool16 newLine)
 
virtual void WriteName (const WideString &name, bool16 newLine)
 
virtual void WriteAttributeType (eAttributeType attType, bool16 newLine)
 
virtual void WriteAttributeValue (const WideString &attValue, bool16 newLine)
 
virtual void BeginEntityDecl (const WideString &entityName, bool16 generalEntity, bool16 newLine)
 
virtual void EndEntityDecl (bool16 newLine)
 
virtual void WriteLiteral (const WideString &literal, bool16 wrapInQuotes, bool16 newLine)
 
virtual void BeginNotationDecl (const WideString &notationName, bool16 newLine)
 
virtual void EndNotationDecl (bool16 newLine)
 
virtual void Push (const WideString &tagName, bool16 newLine)
 
virtual void PushWithAttributes (const WideString &tagName, const AttributeList &attrs, bool16 newLine)
 
virtual ErrorCode Pop (bool16 newLine)
 
virtual void Write (const WideString &data, bool16 newLine, bool16 escape)
 
virtual void WritePlatformText (IPMStream *data, int32 start, int32 count, bool16 newLine=kFalse, bool16 escape=kTrue)
 
virtual void WriteEmpty (const WideString &tagName, bool16 newLine)
 
virtual void WriteEmptyWithAttributes (const WideString &tag, const AttributeList &attrs, bool16 newLine)
 
virtual void Comment (const WideString &comment, bool16 newLine)
 
virtual void BeginCData (const WideString &data, bool16 escape)
 
virtual void EndCData (bool16 newLine)
 
virtual void BeginPI (const WideString &piTarget, const WideString &piData, bool16 newLine, bool16 escape)
 
virtual void EndPI (bool16 newLine)
 
virtual void IndentLevel (bool increase)
 
virtual void Indent (bool on)
 
virtual bool16 DoIndent (void) const
 
virtual void WriteIndent (void)
 
virtual void ResetEntityMap (bool16 addStandardXMLEntity=kTrue)
 
virtual void AppendEntityMap (EntityMap &map)
 
virtual bool CheckStatus ()
 
- Public Member Functions inherited from CPMUnknown< IXMLOutStream >
IPMUnknownQueryInterface (PMIID interfaceID) const
 
void AddRef () const
 
void Release () const
 
void PreDirty (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
void PreDirtyNoMessage (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
 CPMUnknown (const CPMUnknown &)=delete
 
CPMUnknownoperator= (const CPMUnknown &)=delete
 
- Public Member Functions inherited from IXMLOutStream
void DocHeader (const UTF16TextChar *version, bool16 standalone=kTrue)
 
void TextDeclaration (const UTF16TextChar *version)
 
void DocType (const UTF16TextChar *root, const WideString &URI)
 
void DocType (const WideString &root, const UTF16TextChar *URI)
 
void DocType (const UTF16TextChar *root, const UTF16TextChar *URI)
 
void BeginDocType (const UTF16TextChar *root, bool16 newLine=kFalse)
 
void WriteAttributeList (const UTF16TextChar *elementName, const AttributeDfnList &dfns, bool16 newLine=kFalse)
 
void BeginElementTypeDecl (const UTF16TextChar *elementName, bool16 newLine=kFalse)
 
void WriteContentParticle (const UTF16TextChar *contentParticleName, eContentParticleOccurrence occurrence=kExactlyOnce, bool16 newLine=kFalse)
 
void BeginAttListDecl (const UTF16TextChar *elementName, bool16 newLine=kFalse)
 
void WriteName (const UTF16TextChar *name, bool16 newLine=kFalse)
 
void WriteAttributeValue (const UTF16TextChar *attValue, bool16 newLine=kFalse)
 
void BeginEntityDecl (const UTF16TextChar *entityName, bool16 generalEntity=kTrue, bool16 newLine=kFalse)
 
void BeginNotationDecl (const UTF16TextChar *notationName, bool16 newLine=kFalse)
 
void WriteLiteral (const UTF16TextChar *literal, bool16 wrapInQuotes=kFalse, bool16 newLine=kFalse)
 
void Push (const UTF16TextChar *tagName, bool16 newLine=kFalse)
 
void PushWithAttributes (const UTF16TextChar *tagName, const AttributeList &attrs, bool16 newLine=kFalse)
 
void Write (const UTF16TextChar *data, bool16 newLine=kFalse, bool16 escape=kTrue)
 
void WriteEmpty (const UTF16TextChar *tagName, bool16 newLine=kFalse)
 
void WriteEmptyWithAttributes (const UTF16TextChar *tag, const AttributeList &attrs, bool16 newLine=kFalse)
 
void Comment (const UTF16TextChar *comment, bool16 newLine=kFalse)
 
void BeginCData (const UTF16TextChar *data, bool16 escape=kFalse)
 

Protected Member Functions

virtual ErrorCode Initialize (std::streambuf *destBuf, eEncodingType encoding=kUTF16, bool16 stripInvalid=kTrue, bool16 showCannotEncodeAlert=kFalse)
 
virtual ErrorCode Terminate ()
 
virtual ErrorCode sputnEsc (const WideString &source, bool16 bJustWriteIt=kFalse)
 
- Protected Member Functions inherited from CPMUnknown< IXMLOutStream >
 CPMUnknown (IPMUnknown *boss)
 

Additional Inherited Members

- Protected Attributes inherited from CPMUnknown< IXMLOutStream >
HelperInterface fHelperInterface
 

Member Function Documentation

virtual void CXMLOutStream::AppendEntityMap (EntityMapmap)
virtual

Add character entity mappings ('&' to '&', '<' to '<' etc) New mappings overwrite existing ones for the same character.

Implements IXMLOutStream.

virtual void CXMLOutStream::BeginAttListDecl (const WideStringelementName,
bool16 newLine 
)
virtual

Begin an ATTLIST declaration. i.e. "<!ATTLIST elementName"

Parameters
elementNamename of the element for the attributes
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::BeginCData (const WideStringdata,
bool16 escape 
)
virtual

Begin a CData section. Data and subsequent calls to Write() will escape entities or not depending on bool.

Parameters
datacontent to write into CDATA section
escapekTrue if standard entities to be escaped, kFalse otherwise

Implements IXMLOutStream.

virtual void CXMLOutStream::BeginContentModelDecl (eContentParticleSeparator separator,
bool16 newLine 
)
virtual

Begin a content model declaration. i.e. "("

Parameters
separatormay optionally prepend a separator. i.e. ", (" Use kNone to add nothing
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::BeginDocType (const WideStringroot,
bool16 newLine 
)
virtual

Begin definition of an Internal DTD with root element.

Parameters
rootname of the root element, e.g. article
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::BeginDocType (const WideStringroot,
const WideStringsystemIDLiteral,
bool16 newLine 
)
virtual

Begin definition of an external SYSTEM DTD with root element

Parameters
rootname of the root element, e.g. article
systemIDLiteralSYSTEM ID literal
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::BeginDocType (const WideStringroot,
const WideStringpublicIDLiteral,
const WideStringsystemIDLiteral,
bool16 newLine 
)
virtual

Begin definition of an external PUBLIC DTD with root element

Parameters
rootname of the root element, e.g. article
publicIDLiteralPUBLIC ID literal
systemIDLiteralSYSTEM ID literal
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::BeginElementTypeDecl (const WideStringelementName,
bool16 newLine 
)
virtual

Begin an element type declaration. i.e. "<!ELEMENT elementName "

Parameters
elementNamespecifies name of element
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::BeginEntityDecl (const WideStringentityName,
bool16 generalEntity,
bool16 newLine 
)
virtual

Begin an ENTITY declaration. i.e. "<!ENTITY entityName " or "<!ENTITY % entityName "

Parameters
entityNamename of the entity
generalEntitykTrue to write a general entity; kFalse to write parameter entity
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::BeginMixedContentModelDecl (eContentParticleSeparator separator,
bool16 newLine 
)
virtual

Begin a mixed content model declaration. i.e. "(#PCDATA"

Parameters
separatormay optionally prepend a separator. i.e. ", (#PCDATA" Use kNone to add nothing
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::BeginNotationDecl (const WideStringnotationName,
bool16 newLine 
)
virtual

Begin a NOTATION declaration. i.e. "<!NOTATION notationName "

Parameters
notationNamename of the notation
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::BeginPI (const WideStringpiTarget,
const WideStringpiData,
bool16 newLine,
bool16 escape 
)
virtual

Begin a Processing Instruction section. until EndCdata() is called. NewLine after the tag if necessary.

Parameters
piTargetapplication to which the instruction is directed
piDatadata to pass through to target application
newLinewhether to write new-line into stream after this content
escapekTrue if standard entities to be escaped, kFalse otherwise

Implements IXMLOutStream.

virtual bool CXMLOutStream::CheckStatus ()
virtual

Utility method to check status flag on this interface

Returns
bool status flag, kSuccess if all going well

Implements IXMLOutStream.

virtual void CXMLOutStream::Close ()
pure virtual

must be called when done with stream to ensure final flush of stream content

Implements IXMLOutStream.

virtual void CXMLOutStream::Comment (const WideStringcomment,
bool16 newLine 
)
virtual

Comment will output a comment at the current stream position with no escaping of entities.

Parameters
commentspecifies comment data to write out
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::DocHeader (const WideStringversion,
bool16 standalone 
)
virtual

Write the XML header for this document.

Parameters
versionXML version (e.g. 1.0 is expected)
standalonespecifies whether the document should be described as standalone="yes" or not

Implements IXMLOutStream.

virtual void CXMLOutStream::DocType (const WideStringroot,
const WideStringURI 
)
virtual

Write a SYSTEM DocType with root element and DTD pointed to by URI.

Parameters
rootname of the root element, e.g. article
URIidentifier for the document type

Implements IXMLOutStream.

virtual void CXMLOutStream::DocType (const WideStringroot,
const WideStringname,
const WideStringURI 
)
virtual

Write a PUBLIC DocType with root element and DTD pointed to by URI and a name of public DTD.

Parameters
rootname of the root element, e.g. article
namepublic identifier
URIidentifier for the document type

Implements IXMLOutStream.

virtual bool16 CXMLOutStream::DoIndent (void ) const
virtual

return whether indent is on or not

Returns
bool16 kTrue if indent is on; kFalse otherwise

Implements IXMLOutStream.

virtual void CXMLOutStream::EndAttListDecl (bool16 newLine)
virtual

End an ATTLIST declaration. i.e. ">"

Parameters
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::EndCData (bool16 newLine)
virtual

End a CDataSection, with a newLine after if neccesary.

Parameters
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::EndContentModelDecl (eContentParticleOccurrence occurrence,
bool16 newLine 
)
virtual

End a content model declaration. i.e. ")+"

Parameters
occurrenceoccurrence of the content model
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::EndDocType (bool16 newLine)
virtual

Ends definition of an Internal DTD.

Parameters
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::EndElementTypeDecl (bool16 newLine)
virtual

End an element type declaration. i.e. ">"

Parameters
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::EndEntityDecl (bool16 newLine)
virtual

End an ENTITY declaration. i.e. ">"

Parameters
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::EndMixedContentModelDecl (bool16 writeOccurrence,
bool16 newLine 
)
virtual

End a mixed content model declaration. i.e. ")*"

Parameters
writeOccurrencewhether to write the "*" occurrence. This should be kFalse only when the PCDATA is the only content particle in a mixed content model
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::EndNotationDecl (bool16 newLine)
virtual

End a NOTATION declaration. i.e. ">"

Parameters
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::EndPI (bool16 newLine)
virtual

End a Processing Instruction, with a newLine after if neccesary

Parameters
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual ErrorCode CXMLOutStream::Flush ()
virtual

force all pending writes

Returns
kSuccess if Flush succeeds, kFailure otherwise

Implements IXMLOutStream.

virtual void CXMLOutStream::Indent (bool on)
virtual

Formatting related; enable indent. If on, each output operation is indented based on the current indent level

Parameters
onspecifies whether to turn indenting on or off

Implements IXMLOutStream.

virtual void CXMLOutStream::IndentLevel (bool increase)
virtual

Formatting related; indent level will determine how much to indent each write to the output stream, only effective if Indent is on

Parameters
increasespecifies whether to increase indent level or not

Implements IXMLOutStream.

virtual bool16 CXMLOutStream::Open (eEncodingType encoding = kUTF16,
bool16 stripInvalid = kTrue 
)
pure virtual

Must be called before any other methods to initialize stream.

Parameters
encodingkUTF16 is Big or Litle Endian, depending on platform
stripInvaliddetermines if invalid Unicode chars are stripped from the output or converted to processing instructions that contain their hexidecimal equivalent
Returns
kTrue if stream could be opened, kFalse otherwise

Implements IXMLOutStream.

virtual ErrorCode CXMLOutStream::Pop (bool16 newLine)
virtual

Use to write the end tag for the top tag on the stack and to remove it from the stack

Parameters
newLinewhether to write new-line into stream after this content
Returns
kTrue if stream IO succeeds, kFalse otherwise

Implements IXMLOutStream.

virtual void CXMLOutStream::Push (const WideStringtagName,
bool16 newLine 
)
virtual

Use to write a new tag.

Parameters
tagNamespecifies name of tag
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::PushWithAttributes (const WideStringtagName,
const AttributeListattrs,
bool16 newLine 
)
virtual

Use to write a new tag with attributes.

Parameters
tagNamespecifies name of tag
attrslist of its attributes
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::ResetEntityMap (bool16 addStandardXMLEntity = kTrue)
virtual

Clear the character entity table

Parameters
addStandardXMLEntityspecifies whether to add standard XML entity.

Implements IXMLOutStream.

virtual void CXMLOutStream::TextDeclaration (const WideStringversion)
virtual

write the XML text declaration. See XML 1.0 spec 20001006, section 4.3.1

Parameters
versionXML version (e.g. 1.0 is expected)

Implements IXMLOutStream.

virtual void CXMLOutStream::Write (const WideStringdata,
bool16 newLine,
bool16 escape 
)
virtual

Write will output data to stream at current position, and escape the standard 5 entities, unless a CData or PI section has been started with escaping off.

Parameters
dataspecifies content to write out
escapekTrue if data to be escaped, kFalse otherwise
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::WriteAttributeList (const WideStringelementName,
const AttributeDfnListdfns,
bool16 newLine 
)
virtual

Write a declaration for an ATTLIST..

Parameters
elementNamename of the element, e.g. document
attrDfnslist of its attribute definitions
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::WriteAttributeType (eAttributeType attType,
bool16 newLine 
)
virtual

Write an attribute type. i.e. " CDATA"

Parameters
attTypeattribute type to write
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::WriteAttributeValue (const WideStringattValue,
bool16 newLine 
)
virtual

Write an attribute value. i.e. ""true""

Parameters
attValueattribute value to write
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::WriteContentParticle (const WideStringcontentParticleName,
eContentParticleOccurrence occurrence,
bool16 newLine 
)
virtual

Write a content particle. i.e. "contentParticleName+"

Parameters
contentParticleNamecontent particle name
occurrencecontent particle occurrence
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::WriteEmpty (const WideStringtagName,
bool16 newLine 
)
virtual

Write an empty tag such as '<foo/>'

Parameters
tagNamespecifies name of tag to write
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::WriteEmptyWithAttributes (const WideStringtag,
const AttributeListattrs,
bool16 newLine 
)
virtual

Write an empty tag with attributes such as '<foo bar = true/>'.

Parameters
tagspecifies tag name
attrslist of attributes to write out
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::WriteIndent (void )
virtual

output the current indent

Implements IXMLOutStream.

virtual void CXMLOutStream::WriteKeyword (eKeyword keyword,
bool16 newLine 
)
virtual

Write a keyword. i.e. "#PCDATA"

Parameters
keywordkeyword to write
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::WriteLiteral (const WideStringliteral,
bool16 wrapInQuotes,
bool16 newLine 
)
virtual

Write a literal enclosed in quotes. i.e. ""literal""

Parameters
literalliteral to write
wrapInQuoteswhether to wrap the literal in quotes
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::WriteName (const WideStringname,
bool16 newLine 
)
virtual

Write a name. i.e. "name"

Parameters
namename to write
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::WritePlatformText (IPMStreamdata,
int32 start,
int32 count,
bool16 newLine = kFalse,
bool16 escape = kTrue 
)
virtual

WritePlatformText will output data to stream at current position, and escape the standard 5 entities, unless a CData or PI section has been started with escaping off.

Parameters
datastream containing platform characters
startstream offset of the first character to write
countthe number of characters to write
escapekTrue if data to be escaped, kFalse otherwise
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.

virtual void CXMLOutStream::WriteSeparator (eContentParticleSeparator separator,
bool16 newLine 
)
virtual

Write a separator. i.e. " | "

Parameters
separatorcontent particle separator
newLinewhether to write new-line into stream after this content

Implements IXMLOutStream.