9 namespace Fossology\Lib\View;
15 if (! defined(
'ENT_SUBSTITUTE')) {
16 define(
'ENT_SUBSTITUTE', 0);
24 private $highlightRenderer;
28 $this->highlightRenderer = $highlightRenderer;
39 $state =
new HighlightState($this->highlightRenderer, $insertBacklink);
40 $result = $this->
render($fragment, $state,
new PagedTextResult($fragment->getStartOffset()), $splitPositions);
41 return $result->getText();
52 $result = $this->
render($fragment, $state,
new PagedHexResult($fragment->getStartOffset(), $state), $splitPositions);
53 return $result->getText();
65 foreach ($splitPositions as $actionPosition => $entries) {
66 $isBeforeVisibleRange = $actionPosition < $fragment->getStartOffset();
67 $isAfterVisibleRange = $actionPosition >= $fragment->getEndOffset();
68 if ($isBeforeVisibleRange || $isAfterVisibleRange) {
88 if ($isAfterVisibleRange) {
103 if ($result->isEmpty()) {
106 $result->appendContentText($fragment->getSlice($result->getCurrentOffset(), $actionPosition));
108 assert($result->getCurrentOffset() == $actionPosition);
118 if ($result->getCurrentOffset() < $fragment->getEndOffset()) {
119 if ($result->isEmpty()) {
122 $result->appendContentText($fragment->getSlice($result->getCurrentOffset()));
openExistingElements(PagedResult $result)
closeOpenElements(PagedResult $result)
processSplitEntries($entries)
insertElements($entries, PagedResult $result)
render(TextFragment $fragment, HighlightState $state, PagedResult $result, $splitPositions=array())
finalizeContentText(TextFragment $fragment, HighlightState $state, PagedResult $result)
renderHex(TextFragment $fragment, $splitPositions=array())
renderText(TextFragment $fragment, $splitPositions=array(), $insertBacklink=false)
processEntriesWithinVisibleRange(TextFragment $fragment, HighlightState $state, PagedResult $result, $actionPosition, $entries)
processEntriesOutsideVisibleRange(TextFragment $fragment, HighlightState $state, PagedResult $result, $entries, $isAfterVisibleRange)