<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.8">
  <compounddef id="FilePrintConnector_8php" kind="file">
    <compoundname>FilePrintConnector.php</compoundname>
    <innerclass refid="classMike42_1_1Escpos_1_1PrintConnectors_1_1FilePrintConnector" prot="public">Mike42::Escpos::PrintConnectors::FilePrintConnector</innerclass>
    <innernamespace refid="namespaceMike42_1_1Escpos_1_1PrintConnectors">Mike42::Escpos::PrintConnectors</innernamespace>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="normal">&lt;?php</highlight></codeline>
<codeline lineno="13"><highlight class="keyword">namespace<sp/></highlight><highlight class="normal"><ref refid="namespaceMike42_1_1Escpos_1_1PrintConnectors" kindref="compound">Mike42\Escpos\PrintConnectors</ref>;</highlight></codeline>
<codeline lineno="14"><highlight class="normal"></highlight></codeline>
<codeline lineno="15"><highlight class="normal">use<sp/><ref refid="namespaceException" kindref="compound">Exception</ref>;</highlight></codeline>
<codeline lineno="16"><highlight class="normal"></highlight></codeline>
<codeline lineno="20" refid="classMike42_1_1Escpos_1_1PrintConnectors_1_1FilePrintConnector" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classMike42_1_1Escpos_1_1PrintConnectors_1_1FilePrintConnector" kindref="compound">FilePrintConnector</ref><sp/></highlight><highlight class="keyword">implements</highlight><highlight class="normal"><sp/><ref refid="interfaceMike42_1_1Escpos_1_1PrintConnectors_1_1PrintConnector" kindref="compound">PrintConnector</ref></highlight></codeline>
<codeline lineno="21"><highlight class="normal">{</highlight></codeline>
<codeline lineno="26"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1PrintConnectors_1_1FilePrintConnector_1ada5b438edbfbc6dac6e686bb8f2742b4" kindref="member">$fp</ref>;</highlight></codeline>
<codeline lineno="27"><highlight class="normal"></highlight></codeline>
<codeline lineno="33"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1PrintConnectors_1_1FilePrintConnector_1ae2eb0dc5a1c08fe3c09ad3ac51bc7795" kindref="member">__construct</ref>($filename)</highlight></codeline>
<codeline lineno="34"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="35"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>fp<sp/>=<sp/>fopen($filename,<sp/></highlight><highlight class="stringliteral">&quot;wb+&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="36"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($this<sp/>-&gt;<sp/>fp<sp/>===<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
<codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceException" kindref="compound">Exception</ref>(</highlight><highlight class="stringliteral">&quot;Cannot<sp/>initialise<sp/>FilePrintConnector.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="38"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="39"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight></codeline>
<codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1PrintConnectors_1_1FilePrintConnector_1a4e133a42390b13994b6feeee0e69680b" kindref="member">__destruct</ref>()</highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($this<sp/>-&gt;<sp/>fp<sp/>!==<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>trigger_error(</highlight><highlight class="stringliteral">&quot;Print<sp/>connector<sp/>was<sp/>not<sp/>finalized.<sp/>Did<sp/>you<sp/>forget<sp/>to<sp/>close<sp/>the<sp/>printer?&quot;</highlight><highlight class="normal">,<sp/>E_USER_NOTICE);</highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="47"><highlight class="normal"></highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1PrintConnectors_1_1FilePrintConnector_1a0d5dde5717d2b634d5fa15a265488ee8" kindref="member">finalize</ref>()</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($this<sp/>-&gt;<sp/>fp<sp/>!==<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fclose($this<sp/>-&gt;<sp/>fp);</highlight></codeline>
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>$this<sp/>-&gt;<sp/>fp<sp/>=<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>(non-PHPdoc)</highlight></codeline>
<codeline lineno="60"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>*<sp/>@see<sp/>PrintConnector::read()</highlight></codeline>
<codeline lineno="61"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1PrintConnectors_1_1FilePrintConnector_1a681c49053c2a10a3c22678db0b48648a" kindref="member">read</ref>($len)</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($this<sp/>-&gt;<sp/>fp<sp/>===<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceException" kindref="compound">Exception</ref>(</highlight><highlight class="stringliteral">&quot;PrintConnector<sp/>has<sp/>been<sp/>closed,<sp/>cannot<sp/>read<sp/>input.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>fread($this<sp/>-&gt;<sp/>fp,<sp/>$len);</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">function</highlight><highlight class="normal"><sp/><ref refid="classMike42_1_1Escpos_1_1PrintConnectors_1_1FilePrintConnector_1ae37bbb496532ccf2fb6ecc6fb35681d2" kindref="member">write</ref>($data)</highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>($this<sp/>-&gt;<sp/>fp<sp/>===<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">throw</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="namespaceException" kindref="compound">Exception</ref>(</highlight><highlight class="stringliteral">&quot;PrintConnector<sp/>has<sp/>been<sp/>closed,<sp/>cannot<sp/>send<sp/>output.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="79"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fwrite($this<sp/>-&gt;<sp/>fp,<sp/>$data);</highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="82"><highlight class="normal">}</highlight></codeline>
    </programlisting>
    <location file="C:/www/aplusnet/incahellas.com/public_html/lib/escpos-php-development/src/Mike42/Escpos/PrintConnectors/FilePrintConnector.php"/>
  </compounddef>
</doxygen>
