Contents
extends AbstractPart
in package
WPS CONTENTS part writer.
The stream is a list of chunks, each of them described by an entry of the index which follows the header of the stream.
Tags
Table of Contents
Constants
- ENTRY_SIZE : mixed = 0x18
- Size of an entry of the index.
- HEADER_SIZE : mixed = 0x20
- Size of the stream header, including the header of the index.
- MAGIC : mixed = "CHNKWKS\x00"
- Magic of the Microsoft Works 7/8 word processor documents.
- PAGE_BREAK : mixed = "\f"
- Page break.
- PARAGRAPH_END : mixed = "\r"
- End of paragraph.
Properties
- $parentWriter : AbstractWriter
- Parent writer.
Methods
- getParentWriter() : AbstractWriter
- Get parent writer.
- setParentWriter() : void
- Set parent writer.
- write() : string
- Write the CONTENTS stream.
- encodeText() : string
- Convert a text to the UTF-16LE encoding used by the WPS format.
- getElementText() : string
- Get the text of an element, empty for the unsupported ones.
- sanitizeText() : string
- Replace the characters which delimit the paragraphs by spaces.
- writeChunks() : string
- Write the header, the index and the data of the chunks.
- writeContainer() : string
- Write the paragraphs of a container.
- writeFontNames() : string
- Write the table of the font names.
- writeInline() : string
- Get the text of the elements of a container, without paragraph separator.
- writeParagraph() : string
- Write a paragraph, ie its text followed by an end of paragraph.
- writeTable() : string
- Write the paragraphs of the cells of a table.
Constants
ENTRY_SIZE
Size of an entry of the index.
public
mixed
ENTRY_SIZE
= 0x18
HEADER_SIZE
Size of the stream header, including the header of the index.
public
mixed
HEADER_SIZE
= 0x20
MAGIC
Magic of the Microsoft Works 7/8 word processor documents.
public
mixed
MAGIC
= "CHNKWKS\x00"
PAGE_BREAK
Page break.
public
mixed
PAGE_BREAK
= "\f"
PARAGRAPH_END
End of paragraph.
public
mixed
PARAGRAPH_END
= "\r"
Properties
$parentWriter
Parent writer.
protected
AbstractWriter
$parentWriter
Methods
getParentWriter()
Get parent writer.
public
getParentWriter() : AbstractWriter
Return values
AbstractWritersetParentWriter()
Set parent writer.
public
setParentWriter(AbstractWriter $writer) : void
Parameters
- $writer : AbstractWriter
write()
Write the CONTENTS stream.
public
write() : string
Return values
stringencodeText()
Convert a text to the UTF-16LE encoding used by the WPS format.
protected
encodeText(string $text) : string
Parameters
- $text : string
Return values
stringgetElementText()
Get the text of an element, empty for the unsupported ones.
private
getElementText(AbstractElement $element) : string
Parameters
- $element : AbstractElement
Return values
stringsanitizeText()
Replace the characters which delimit the paragraphs by spaces.
private
sanitizeText(string $text) : string
Parameters
- $text : string
Return values
stringwriteChunks()
Write the header, the index and the data of the chunks.
private
writeChunks(array<string, string> $chunks) : string
Parameters
- $chunks : array<string, string>
-
Chunk name and content pairs
Return values
stringwriteContainer()
Write the paragraphs of a container.
private
writeContainer(AbstractContainer $container) : string
Parameters
- $container : AbstractContainer
Return values
stringwriteFontNames()
Write the table of the font names.
private
writeFontNames(array<string|int, string> $fonts) : string
Parameters
- $fonts : array<string|int, string>
Return values
stringwriteInline()
Get the text of the elements of a container, without paragraph separator.
private
writeInline(AbstractContainer $container) : string
Parameters
- $container : AbstractContainer
Return values
stringwriteParagraph()
Write a paragraph, ie its text followed by an end of paragraph.
private
writeParagraph(string $text) : string
Parameters
- $text : string
Return values
stringwriteTable()
Write the paragraphs of the cells of a table.
private
writeTable(Table $table) : string
Parameters
- $table : Table