public function getPositionRepresentation() { $i0 = com_wiris_common_WInteger::min($this->i, $this->n); $s0 = com_wiris_common_WInteger::max(0, $this->i - 20); $e0 = com_wiris_common_WInteger::min($this->n, $this->i + 20); return "..." . _hx_substr($this->str, $s0, $i0 - $s0) . " >>> . <<<" . _hx_substr($this->str, $i0, $e0); }
public function getParent() { $parent = com_wiris_util_sys_Store_0($this); if ($parent === null) { $parent = $this->file; } $i = com_wiris_common_WInteger::max(_hx_last_index_of($parent, "/", null), _hx_last_index_of($parent, "\\", null)); if ($i < 0) { return com_wiris_util_sys_Store::newStore("."); } $parent = _hx_substr($parent, 0, $i); return com_wiris_util_sys_Store::newStore($parent); }
static function getDepth($o) { if (com_wiris_system_TypeTools::isHash($o)) { $h = $o; $m = 0; if ($h->exists("_left_") || $h->exists("_right_")) { if ($h->exists("_left_")) { $m = com_wiris_common_WInteger::max(com_wiris_util_json_JSon::getDepth($h->get("_left_")), $m); } if ($h->exists("_right_")) { $m = com_wiris_common_WInteger::max(com_wiris_util_json_JSon::getDepth($h->get("_right_")), $m); } return $m; } $iter = $h->keys(); while ($iter->hasNext()) { $key = $iter->next(); $m = com_wiris_common_WInteger::max(com_wiris_util_json_JSon::getDepth($h->get($key)), $m); unset($key); } return $m + 2; } else { if (com_wiris_system_TypeTools::isArray($o)) { $a = $o; $i = null; $m = 0; $_g1 = 0; $_g = $a->length; while ($_g1 < $_g) { $i1 = $_g1++; $m = com_wiris_common_WInteger::max(com_wiris_util_json_JSon::getDepth($a[$i1]), $m); unset($i1); } return $m + 1; } else { return 1; } } }