9 namespace Fossology\Lib\Data;
17 public function __construct($startOffset, $text)
20 $this->startOffset = $startOffset;
24 public function getStartOffset()
26 return $this->startOffset;
29 public function getEndOffset()
31 return $this->startOffset + strlen($this->text);
34 public function getSlice($startOffset, $endOffset =
null)
36 $adjustedStartOffset =
max($startOffset - $this->startOffset, 0);
37 if (isset($endOffset)) {
38 $adjustedEndOffset =
max($endOffset - $this->startOffset, 0);
39 return substr($this->text, $adjustedStartOffset,
40 max($adjustedEndOffset - $adjustedStartOffset, 0));
42 return substr($this->text, $adjustedStartOffset);
FUNCTION int max(int permGroup, int permPublic)
Get the maximum group privilege.