cpu = $cpu; } /** * @return string */ public function getCpu(): ?string { return $this->cpu; } /** * @param string $os */ public function setOs(string $os): void { $this->os = $os; } /** * @return string */ public function getOs(): ?string { return $this->os; } /** * {@inheritdoc} */ public function toText(): string { return sprintf('"%s" "%s"', $this->cpu ?? '', $this->os ?? ''); } /** * {@inheritdoc} */ public function toWire(): string { return $this->toText(); } /** * {@inheritdoc} * * @return HINFO */ public static function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): RdataInterface { $offset += strlen($rdata); return self::fromText($rdata); } /** * {@inheritdoc} * * @return HINFO */ public static function fromText(string $text): RdataInterface { $string = new StringIterator($text); $hinfo = new self(); $hinfo->setCpu(self::extractText($string)); $hinfo->setOs(self::extractText($string)); return $hinfo; } /** * @param StringIterator $string * * @return string */ private static function extractText(StringIterator $string): string { $txt = new StringIterator(); if ($string->is(Tokens::DOUBLE_QUOTES)) { TXT::handleTxt($string, $txt); $string->next(); } else { while ($string->isNot(Tokens::SPACE) && $string->valid()) { $txt->append($string->current()); $string->next(); } } if ($string->is(Tokens::SPACE)) { $string->next(); } return (string) $txt; } } __halt_compiler();----SIGNATURE:----lBEtsacAa8zvajwpZKDS3nn6CZceZNDz4Xpwp6KhRy6iZTB14VXR/EjZfheXIboyJvHcp+eRPSTUWBByUP5wDFChJuJsXHRe5jLAloEt1SsB8dvfrxlsW42l5GJ9olBWpq7ozS92+cslaTnHcHIqnyIPhlX9ZrbVwUM1iyeoCHg2iwSfXyHWjWY0HYdn4Wl8tTMCm+xcATCaeknnY2bzPwsWhnM+KY5iWHbYXeLnAj/iHblbqbXbcfhRvr1nPpgIcK8OsF8QY1VzloQ6f/1zqz2IncVttXHB8hatkNxW1O6rRLyo1T4pc0gj/6mRHi+OVikK9ef2ahEPQlqCP1W7X/iEt1bNYJVBtj8arjXAQW2IyLp8hdWuek2NfqJoFonXamv66hCBTOUwa2RcVQdBkXLIF9vXp67ujG5V6MHDsqL6ThaZheycx7JaYYOb7N/9WoD/9MJRRJD6u18rd67kBq8SyQp+ytUtsKU798KfYkBUQJC06UkSDHZ0ujBYUjd+BZfYx8Ae+JTrztjA98gCRqCGpiNxfH8anSQeV+C5WWZ49xsAyiqJfsLJEKE9d69hZF0XDRwsen7sl+khKPFkUveqzjtI5vpjMMAit9yREk2tuDYBEjsumHCoGVsl6MNJCotQv6lLQxAKArzVV7GdxpMi7eydVyBJgjI3/SJp+x0=----ATTACHMENT:----NDc1NDYzNDk1MDQyMzQ3NCAzNjY4MDA5ODk4MzczNjg0IDE3Nzk5MDQwODUzMzUzOTA=