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

Public Member Functions

 __construct (Stream\IStream\Out $stream, $initializeNamespace=true, $entityResolver=null)
 
 _close (Core\Event\Bucket $bucket)
 
 write ($string, $length)
 
 writeString ($string)
 
 writeCharacter ($char)
 
 writeBoolean ($boolean)
 
 writeInteger ($integer)
 
 writeFloat ($float)
 
 writeArray (Array $array)
 
 writeLine ($line)
 
 writeAll ($string)
 
 truncate ($size)
 
 writeDOM (\DOMNode $dom)
 
 writeAttributes (Array $attributes)
 
 writeAttribute ($name, $value)
 
- Public Member Functions inherited from Hoa\Xml\Xml
 __construct ($stream, Stream $innerStream, $initializeNamespace=true, $entityResolver=null)
 
 initializeNamespaces ()
 
 namespaceExists ($namespace)
 
 useNamespace ($namespace)
 
 getPrefix ($namespace)
 
 getNamespaces ()
 
 selectRoot ()
 
 selectAnyElements ()
 
 selectElements ($E=null)
 
 selectDescendantElements ($F=null)
 
 selectChildElements ($F=null)
 
 selectAdjacentSiblingElement ($F)
 
 selectSiblingElements ($F=null)
 
 querySelector ($query)
 
 querySelectorAll ($query)
 
 xpath ($path)
 
 __toString ()
 
 readAttributes ()
 
 readAttribute ($name)
 
 attributeExists ($name)
 
 readAttributesAsList ()
 
 readAttributeAsList ($name)
 
 readAttributesAsString ()
 
 readXML ()
 
 readDOM ()
 
 getName ()
 
 count ()
 
 getIterator ()
 
 __set ($name, $value)
 
 __get ($name)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 hasError ()
 
 getErrors ()
 
- Public Member Functions inherited from Hoa\Stream\Composite
 getInnerStream ()
 

Additional Inherited Members

- Protected Member Functions inherited from Hoa\Xml\Xml
 clearErrors ()
 
- Protected Member Functions inherited from Hoa\Stream\Composite
 setStream ($stream)
 
 getStream ()
 
 setInnerStream (Stream $innerStream)
 
- Protected Attributes inherited from Hoa\Xml\Xml
 $_namespaces = null
 
 $_errors = null
 
- Protected Attributes inherited from Hoa\Stream\Composite
 $_stream = null
 
 $_innerStream = null
 

Detailed Description

Class .

Write into a XML element.

Definition at line 50 of file Write.php.

Constructor & Destructor Documentation

Hoa\Xml\Write::__construct ( Stream\IStream\Out  $stream,
  $initializeNamespace = true,
  $entityResolver = null 
)

Start the stream reader/writer as if it is a XML document.

Parameters
\Hoa\Stream\IStream\Out$streamStream to read/write.
bool$initializeNamespaceWhether we initialize namespaces.
mixed$entityResolverEntity resolver.
Returns
void

Definition at line 63 of file Write.php.

67  {
68  parent::__construct(
69  '\Hoa\Xml\Element\Write',
70  $stream,
71  $initializeNamespace,
72  $entityResolver
73  );
74 
75  event('hoa://Event/Stream/' . $stream->getStreamName() . ':close-before')
76  ->attach(xcallable($this, '_close'));
77 
78  return;
79  }

Member Function Documentation

Hoa\Xml\Write::_close ( Core\Event\Bucket  $bucket)

Do not use this method. It is called from the hoa://Event/Stream/...:close-before event. It transforms the XML tree as a XML string, truncates the stream to zero and writes all this string into the stream.

Parameters
\Hoa\Core\Event\Bucket$bucketEvent's bucket.
Returns
void

Definition at line 90 of file Write.php.

91  {
92  $handle = $this->getStream()->selectRoot()->asXML();
93 
94  if (true === $this->getInnerStream()->truncate(0)) {
95  $this->getInnerStream()->writeAll($handle);
96  }
97 
98  return;
99  }
truncate($size)
Definition: Write.php:208

Here is the call graph for this function:

Hoa\Xml\Write::truncate (   $size)

Truncate to a given length.

Parameters
int$sizeSize.
Returns
bool

Implements Hoa\Stream\IStream\Out.

Definition at line 208 of file Write.php.

209  {
210  return $this->getStream()->truncate($size);
211  }

Here is the call graph for this function:

Here is the caller graph for this function:

Hoa\Xml\Write::write (   $string,
  $length 
)

Write n characters.

Parameters
string$stringString.
int$lengthLength.
Returns
mixed
Exceptions

Implements Hoa\Stream\IStream\Out.

Definition at line 109 of file Write.php.

110  {
111  return $this->getStream()->write($string, $length);
112  }

Here is the call graph for this function:

Hoa\Xml\Write::writeAll (   $string)

Write all, i.e. as much as possible.

Parameters
string$stringString.
Returns
mixed

Implements Hoa\Stream\IStream\Out.

Definition at line 197 of file Write.php.

198  {
199  return $this->getStream()->writeAll($string);
200  }

Here is the call graph for this function:

Hoa\Xml\Write::writeArray ( Array  $array)

Write an array.

Parameters
array$arrayArray.
Returns
mixed

Implements Hoa\Stream\IStream\Out.

Definition at line 175 of file Write.php.

176  {
177  return $this->getStream()->writeArray($array);
178  }

Here is the call graph for this function:

Hoa\Xml\Write::writeAttribute (   $name,
  $value 
)

Write an attribute.

Parameters
string$nameName.
string$valueValue.
Returns
void

Definition at line 242 of file Write.php.

243  {
244  return $this->getStream()->writeAttribute($name, $value);
245  }

Here is the call graph for this function:

Hoa\Xml\Write::writeAttributes ( Array  $attributes)

Write attributes.

Parameters
array$attributesAttributes.
Returns
void

Definition at line 230 of file Write.php.

231  {
232  return $this->getStream()->writeAttributes($attributes);
233  }

Here is the call graph for this function:

Hoa\Xml\Write::writeBoolean (   $boolean)

Write a boolean.

Parameters
bool$booleanBoolean.
Returns
mixed

Implements Hoa\Stream\IStream\Out.

Definition at line 142 of file Write.php.

143  {
144  return $this->getStream()->writeBoolean($boolean);
145  }

Here is the call graph for this function:

Hoa\Xml\Write::writeCharacter (   $char)

Write a character.

Parameters
string$charCharacter.
Returns
mixed

Implements Hoa\Stream\IStream\Out.

Definition at line 131 of file Write.php.

132  {
133  return $this->getStream()->writeCharacter($char);
134  }

Here is the call graph for this function:

Hoa\Xml\Write::writeDOM ( \DOMNode  $dom)

Write a DOM tree.

Parameters
\DOMNode$domDOM tree.
Returns
mixed

Definition at line 219 of file Write.php.

220  {
221  return $this->getStream()->writeDOM($dom);
222  }

Here is the call graph for this function:

Hoa\Xml\Write::writeFloat (   $float)

Write a float.

Parameters
float$floatFloat.
Returns
mixed

Implements Hoa\Stream\IStream\Out.

Definition at line 164 of file Write.php.

165  {
166  return $this->getStream()->writeFloat($float);
167  }

Here is the call graph for this function:

Hoa\Xml\Write::writeInteger (   $integer)

Write an integer.

Parameters
int$integerInteger.
Returns
mixed

Implements Hoa\Stream\IStream\Out.

Definition at line 153 of file Write.php.

154  {
155  return $this->getStream()->writeInteger($integer);
156  }

Here is the call graph for this function:

Hoa\Xml\Write::writeLine (   $line)

Write a line.

Parameters
string$lineLine.
Returns
mixed

Implements Hoa\Stream\IStream\Out.

Definition at line 186 of file Write.php.

187  {
188  return $this->getStream()->writeLine($line);
189  }

Here is the call graph for this function:

Hoa\Xml\Write::writeString (   $string)

Write a string.

Parameters
string$stringString.
Returns
mixed

Implements Hoa\Stream\IStream\Out.

Definition at line 120 of file Write.php.

121  {
122  return $this->getStream()->writeString($string);
123  }

Here is the call graph for this function:


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