Hoa central
Public Member Functions | List of all members
Hoa\Xml\Element\Read Class Reference
Inheritance diagram for Hoa\Xml\Element\Read:

Public Member Functions

 eof ()
 
 read ($length)
 
 readString ($length)
 
 readCharacter ()
 
 readBoolean ()
 
 readInteger ($length=1)
 
 readFloat ($length=1)
 
 readArray ($argument=null)
 
 readLine ()
 
 readAll ($offset=0)
 
 scanf ($format)
 
- Public Member Functions inherited from Hoa\Xml\Element\Basic
 selectRoot ()
 
 selectAnyElements ()
 
 selectElements ($E=null)
 
 selectDescendantElements ($F=null)
 
 selectChildElements ($F=null)
 
 selectAdjacentSiblingElement ($F)
 
 selectSiblingElements ($F=null)
 
 querySelector ($query)
 
 querySelectorAll ($query)
 
 readAttributes ()
 
 readAttribute ($name)
 
 attributeExists ($name)
 
 readAttributesAsList ()
 
 readAttributeAsList ($name)
 
 readCustomAttributes ($set)
 
 readCustomAttributesAsList ($set)
 
 readAttributesAsString ()
 
 readXML ()
 
 readDOM ()
 
 readAsPhrasingModel ($namespace= '', $element= '__text')
 
 useNamespace ($namespace)
 

Additional Inherited Members

- Static Public Member Functions inherited from Hoa\Xml\Element\Basic
static getCssToXPathInstance ()
 
- Static Protected Attributes inherited from Hoa\Xml\Element\Basic
static $_cssToXPath = null
 
static $_buffer = null
 

Detailed Description

Class .

Read a XML element.

Definition at line 51 of file Read.php.

Member Function Documentation

Hoa\Xml\Element\Read::eof ( )

Test for end-of-file.

Returns
bool

Implements Hoa\Stream\IStream\In.

Definition at line 58 of file Read.php.

59  {
60  if (null === parent::$_buffer) {
61  return true;
62  }
63 
64  return parent::$_buffer->eof();
65  }
Hoa\Xml\Element\Read::read (   $length)

Read n characters.

Parameters
int$lengthLength.
Returns
string
Exceptions

Implements Hoa\Stream\IStream\In.

Definition at line 74 of file Read.php.

75  {
76  if (0 > $length) {
77  throw new Xml\Exception(
78  'Length must be greater than 0, given %d.',
79  0,
80  $length
81  );
82  }
83 
84  if (null === parent::$_buffer) {
85  parent::$_buffer = new Stringbuffer\ReadWrite();
86  parent::$_buffer->initializeWith($this->__toString());
87  }
88 
89  return parent::$_buffer->read($length);
90  }

Here is the call graph for this function:

Hoa\Xml\Element\Read::readAll (   $offset = 0)

Read all, i.e. read as much as possible.

Parameters
int$offsetOffset (not used).
Returns
string

Implements Hoa\Stream\IStream\In.

Definition at line 179 of file Read.php.

180  {
181  return $this->__toString();
182  }

Here is the call graph for this function:

Hoa\Xml\Element\Read::readArray (   $argument = null)

Read the XML tree as an array.

Parameters
string$argumentNot use here.
Returns
array

Implements Hoa\Stream\IStream\In.

Definition at line 151 of file Read.php.

152  {
153  return (array) $this;
154  }
Hoa\Xml\Element\Read::readBoolean ( )

Read a boolean.

Returns
bool

Implements Hoa\Stream\IStream\In.

Definition at line 118 of file Read.php.

119  {
120  return (bool) $this->read(1);
121  }
read($length)
Definition: Read.php:68

Here is the call graph for this function:

Hoa\Xml\Element\Read::readCharacter ( )

Read a character.

Returns
string

Implements Hoa\Stream\IStream\In.

Definition at line 108 of file Read.php.

109  {
110  return $this->read(1);
111  }
read($length)
Definition: Read.php:68

Here is the call graph for this function:

Hoa\Xml\Element\Read::readFloat (   $length = 1)

Read a float.

Parameters
int$lengthLength.
Returns
float

Implements Hoa\Stream\IStream\In.

Definition at line 140 of file Read.php.

141  {
142  return (float) $this->read($length);
143  }
read($length)
Definition: Read.php:68

Here is the call graph for this function:

Hoa\Xml\Element\Read::readInteger (   $length = 1)

Read an integer.

Parameters
int$lengthLength.
Returns
int

Implements Hoa\Stream\IStream\In.

Definition at line 129 of file Read.php.

130  {
131  return (int) $this->read($length);
132  }
read($length)
Definition: Read.php:68

Here is the call graph for this function:

Hoa\Xml\Element\Read::readLine ( )

Read a line.

Returns
string

Implements Hoa\Stream\IStream\In.

Definition at line 161 of file Read.php.

162  {
163  $handle = $this->readAll();
164  $n = strpos($handle, "\n");
165 
166  if (false === $n) {
167  return $handle;
168  }
169 
170  return substr($handle, 0, $n);
171  }
readAll($offset=0)
Definition: Read.php:162

Here is the call graph for this function:

Hoa\Xml\Element\Read::readString (   $length)

Alias of $this->read().

Parameters
int$lengthLength.
Returns
string

Implements Hoa\Stream\IStream\In.

Definition at line 98 of file Read.php.

99  {
100  return $this->read($length);
101  }
read($length)
Definition: Read.php:68

Here is the call graph for this function:

Hoa\Xml\Element\Read::scanf (   $format)

Parse input from a stream according to a format.

Parameters
string$formatFormat (see printf's formats).
Returns
array

Implements Hoa\Stream\IStream\In.

Definition at line 190 of file Read.php.

191  {
192  return sscanf($this->readAll(), $format);
193  }
readAll($offset=0)
Definition: Read.php:162

Here is the call graph for this function:


The documentation for this class was generated from the following file: