Parse the sequence of ICONDIRENTRY structures
@param Icon $icon
@param string $data
@param integer $count
@return string
773244
private function parseIconDirEntries(Icon $icon, $data, $count)
    {
        for ($i = 0; $i < $count; ++$i) {
            $icoDirEntry = unpack(
                'Cwidth/Cheight/CcolorCount/Creserved/Splanes/SbitCount/LsizeInBytes/LfileOffset',
                $data
            );
            $icoDirEntry['fileOffset'] -= ($count * 16) + 6;
            if ($icoDirEntry['colorCount'] == 0) {
                $icoDirEntry['colorCount'] = 256;
            }
            if ($icoDirEntry['width'] == 0) {
                $icoDirEntry['width'] = 256;
            }
            if ($icoDirEntry['height'] == 0) {
                $icoDirEntry['height'] = 256;
            }

            $entry = new IconImage($icoDirEntry);
            $icon[] = $entry;

            $data = substr($data, 16);
        }

        return $data;
    }
690280
protected function getRowClassString($row, $count)
    {
        $class_string = null;

        $classes = $this->getRowClasses($row, $count);

        if (count($classes) > 0) {
            $class_string = implode(' ', $classes);
        }

        return $class_string;
    }
680910
public function render(Icon $icon)
    {
        $jsonBuilder = $this->getJsonBuilder()
            ->setValue('[url]', $icon->getUrl());

        if ($icon->hasAnchor()) {
            $jsonBuilder->setValue('[anchor]', $icon->getAnchor()->getVariable(), false);
        }

        if ($icon->hasOrigin()) {
            $jsonBuilder->setValue('[origin]', $icon->getOrigin()->getVariable(), false);
        }

        if ($icon->hasScaledSize()) {
            $jsonBuilder->setValue('[scaledSize]', $icon->getScaledSize()->getVariable(), false);
        }

        if ($icon->hasSize()) {
            $jsonBuilder->setValue('[size]', $icon->getScaledSize()->getVariable(), false);
        }

        return $this->getFormatter()->renderObjectAssignment($icon, $jsonBuilder->build());
    }
234937
public function iconAction(Request $request, $icon)
    {
        $params = $request->query->all();

        $iconBuilder = $this->get('phlexible_element.icon_builder');
        $cacheFilename = $iconBuilder->getAssetPath($icon, $params);

        return new BinaryFileResponse($cacheFilename, 200, array('Content-Type' => 'image/png'), true, ResponseHeaderBag::DISPOSITION_INLINE);
    }
931456
protected function materialDesignIconicFontListIcon($icon, $content) {

        $glyphicon = null !== $icon ? StringHelper::replace($icon, ["class=\"zmdi"], ["class=\"zmdi-hc-li zmdi"]) : "";
        $innerHTML = null !== $content ? $content : "";

        return static::coreHTMLElement("li", $glyphicon . $innerHTML);
    }
1339782
public function list(string $type, int $offset = 0, int $count = 20)
    {
        return Response::json($this->curl->post(self::LIST.$this->access_token, json_encode([
                    'type' => $type,
                    'offset' => $offset,
                    'count' => $count,
                ]
            )
        )
        );
    }
853203
public function getIconString($icon, $class = '', $width = '', $height = '')
    {
        $string = $this->loadFile(__DIR__.'/../../resources/assets/icons/'.$icon.'.svg');
        $string = substr_replace($string, ' class="'.$class.'"', 4, 0);

        if ($width) {
            $string = substr_replace($string, 'width="'.$width.'"', strpos($string, 'width='), 10);
            $string = substr_replace($string, 'height="'.$height.'"', strpos($string, 'height='), 11);
        }

        return $string;
    }
1271956
function stream_read($count) {
        $ret = substr($this->_data, $this->_position, $count);
        $this->_position += strlen($ret);
        return $ret;
    }
1079889
public function lrem($key, $count, $value) {
        return $this->returnCommand(['LREM'], $key, [$key, $count, $value]);
    }
898010
public function read(int $count): string
    {
        $data = $this->doRead($this->offset, $count);
        $this->offset += $count;
        return $data;
    }
1374790
protected function mapIconDataResult(array $iconData): array
    {
        $result = [];
        foreach ($iconData as $data) {
            $result[] = IconData::createFromArray($data);
        }
        return $result;
    }
1249855
public function build( $found, $count, $length = NULL )
	{
		$length			= is_null( $length ) ? $this->getOption( 'length' ) : $length;
		$found			= min( $found, $count );
		$ratio			= $count ? $found / $count : 0;
		$divBar			= $this->renderBar( $ratio, $length );
		$divRatio		= $this->renderRatio( $found, $count );
		$divPercentage	= $this->renderPercentage( $ratio );
		$divIndicator	= new UI_HTML_Tag( "div" );
		$divIndicator->setContent( $divBar.$divPercentage.$divRatio );
		$divIndicator->setAttribute( 'class', $this->getOption( 'classIndicator' ) );
		if( $this->getOption( 'id' ) )
			$divIndicator->setAttribute( 'id', $this->getOption( 'id' ) );
		if( $this->getOption( 'useData' ) ){
			$divIndicator->setAttribute( 'data-total', $count );
			$divIndicator->setAttribute( 'data-value', $found );
			foreach( $this->getOptions() as $key => $value )
//				if( strlen( $value ) )
//				if( preg_match( "/^use/", $key ) )
					$divIndicator->setAttribute( 'data-option-'.$key, (string) $value );
		}
		if( $this->getOption( 'useColorAtBorder' ) ){
			$color	= $this->getColorFromRatio( $ratio );
			$divIndicator->setAttribute( 'style', "border-color: rgb(".$color[0].",".$color[1].",".$color[2].")" );
		}
		return $divIndicator->build();
	}
178665
public function icon($icon, $icon2 = null)
    {
        $this->icon = trim($icon);

        if (! str_empty($icon2)) {
            $this->icon2 = trim($icon2);
        }

        return $this;
    }
917411
public function stream_read($count)
    {
        $ret = substr($this->_data, $this->_pos, $count);
        $this->_pos += strlen($ret);
        return $ret;
    }
1151334
public function writeLittleEndian($offset, $count, $data)
    {
        if (ByteBuffer::isLittleEndian()) {
            for ($i = 0; $i < $count; $i++) {
                $this->_buffer[$offset + $i] = chr($data >> $i * 8);
            }
        } else {
            for ($i = 0; $i < $count; $i++) {
                $this->_buffer[$offset + $count - 1 - $i] = chr($data >> $i * 8);
            }
        }
    }
909197
public function getCollectionAction(Request $request, $start, $count)
    {
        $mediafolder = null;
        $folderUid = $request->get('mediaFolder_uid', null);

        if (null === $folderUid) {
            $mediafolder = $this->getMediaFolderRepository()->getRoot();
        } else {
            $mediafolder = $this->getMediaFolderRepository()->find($folderUid);
        }

        if (null === $mediafolder) {
            throw new NotFoundHttpException('Cannot find a media folder');
        }

        $paginator = null;

        if ($request->query->has('content_uid')) {
            $paginator = $this->getCollectionByContent($request->query->get('content_uid'), $mediafolder);
        } else {
            $paginator = $this->getClassicCollection($request, $mediafolder, $start, $count);
        }

        $iterator = $paginator->getIterator();
        $results = [];
        while ($iterator->valid()) {

            if($this->isGranted('VIEW', $iterator->current()->getMediaFolder())){

                $results[] = $iterator->current();
            }

            $iterator->next();
        }

        $pager = $request->query->has('usePagination') ? $paginator : null;

        return $this->addRangeToContent(
            $this->createJsonResponse($this->mediaToJson($results)),
            $pager,
            $start,
            count($results)
        );
    }
345247
public function read($count = 0)
    {
        if (0 === $count) {
            $count = -1;
        }
        fseek($this->resource, $this->readPosition);
        $content = stream_get_contents($this->resource, $count);
        $this->readPosition = ftell($this->resource);
        return $content;
    }