Lines Matching defs:indent
92 private $indent;
174 * Oh, and you can decide how big the indent is and what the wordwrap
184 * @param int $indent Pass in false to use the default, which is 2
187 public static function YAMLDump($array,$indent = false,$wordwrap = false) {
189 return $spyc->dump($array,$indent,$wordwrap);
200 * Oh, and you can decide how big the indent is and what the wordwrap
210 * @param int $indent Pass in false to use the default, which is 2
213 public function dump($array,$indent = false,$wordwrap = false) {
218 if ($indent === false or !is_numeric($indent)) {
221 $this->_dumpIndent = $indent;
252 * @param $indent The indent of the current node
254 private function _yamlize($key,$value,$indent, $previous_key = -1, $first_key = 0, $source_array = null) {
257 return $this->_dumpNode($key, array(), $indent, $previous_key, $first_key, $source_array);
260 $string = $this->_dumpNode($key, self::REMPTY, $indent, $previous_key, $first_key, $source_array);
261 // Add the indent
262 $indent += $this->_dumpIndent;
264 $string .= $this->_yamlizeArray($value,$indent);
267 $string = $this->_dumpNode($key, $value, $indent, $previous_key, $first_key, $source_array);
277 * @param $indent The indent of the current level
279 private function _yamlizeArray($array,$indent) {
285 $string .= $this->_yamlize($key, $value, $indent, $previous_key, $first_key, $array);
300 * @param $indent The indent of the current node
302 private function _dumpNode($key, $value, $indent, $previous_key = -1, $first_key = 0, $source_array = null) {
309 $value = $this->_doLiteralBlock($value,$indent);
311 $value = $this->_doFolding($value,$indent);
316 $value = $this->_doLiteralBlock($value,$indent);
319 $value = $this->_doLiteralBlock($value,$indent);
328 $spaces = str_repeat(' ',$indent);
348 * @param $indent int The value of the indent
350 private function _doLiteralBlock($value,$indent) {
360 $indent += $this->_dumpIndent;
361 $spaces = str_repeat(' ',$indent);
374 private function _doFolding($value,$indent) {
378 $indent += $this->_dumpIndent;
379 $indent = str_repeat(' ',$indent);
380 $wrapped = wordwrap($value,$this->_dumpWordWrap,"\n$indent");
381 $value = ">\n".$indent.$wrapped;
417 $this->indent = strlen($line) - strlen(ltrim($line));
418 $tempPath = $this->getParentPathByIndent($this->indent);
419 $line = self::stripIndent($line, $this->indent);
430 while (++$i < $cnt && $this->literalBlockContinues($Source[$i], $this->indent)) {
453 $this->addArray($lineArray, $this->indent);
455 foreach ($this->delayedPath as $indent => $delayedPath)
456 $this->path[$indent] = $delayedPath;
738 private function addArrayInline ($array, $indent) {
743 $this->addArray(array($k => $_), $indent);
842 private function addLiteralLine ($literalBlock, $line, $literalBlockStyle, $indent = -1) {
843 $line = self::stripIndent($line, $indent);
871 private static function stripIndent ($line, $indent = -1) {
872 if ($indent == -1) $indent = strlen($line) - strlen(ltrim($line));
873 return substr ($line, $indent);
876 private function getParentPathByIndent ($indent) {
877 if ($indent == 0) return array();
881 if ($indent <= $lastIndentInParentPath) array_pop ($linePath);
882 } while ($indent <= $lastIndentInParentPath);
887 private function clearBiggerPathValues ($indent) {
890 if ($indent == 0) $this->path = array();
894 if ($k > $indent) unset ($this->path[$k]);
949 $this->delayedPath = array(strpos ($line, $key) + $this->indent => $key);