<?xml version="1.0"?><phpdoc><class name="Bs_CsvUtil" extends="Bs_Object" undoc="false" access="private" package="util"><file>C:/usr/local/lib/php/blueshoes-4.2/core/util/Bs_CsvUtil.class.php</file><doc><author>andrej arn &amp;lt;andrej at blueshoes dot org&amp;gt;</author><inherited src="Array"/><description>features:- supports any separator char sequence, default is semicolon &amp;quot;;&amp;quot;- supports separator characters in the values. eg you use a ; as separator, your line may look likeblah;hello world;&amp;quot;foo&amp;quot;;&amp;quot;foo;bar&amp;quot;;&amp;quot;this is a &amp;quot;&amp;quot;string&amp;quot;&amp;quot;&amp;quot;;got it?;fooas you can see, the values can be in &amp;quot;quotes&amp;quot;. if your text uses quotes itself as in the &amp;quot;string&amp;quot;example, they are escaped in ms-style with 2 quotes. and by using quotes we can even have yourseparator inside the text (example &amp;quot;foo;bar&amp;quot;).- line breaks. a csv line may spread over multiple lines using crlf in a field value.see the checkMultiline param and the _checkMultiline() method.missing:- option to change quote char (&amp;quot;) to something elsethanks to: steffen at hung dot chdependencies: none.</description><shortdescription>csv util class. csv = comma separated value.</shortdescription><version>4.2.$id$</version><copyright>blueshoes.org</copyright></doc><function name="Bs_CsvUtil" undoc="false" access="public"><doc><return type="void"/><description/><shortdescription>Constructor.</shortdescription></doc></function><function name="csvFileToArray" undoc="false" access="private"><doc><see type="function">csvArrayToArray()</see><parameter name="$fullPath" type="string">(fullpath to the cvs file)</parameter><parameter name="$separator" default="&amp;apos;;&amp;apos;" type="string">(default is FALSE, see _checkMultiline())</parameter><parameter name="$trim" type="string" undoc="true"/><parameter name="$removeHeader" type="string" undoc="true"/><parameter name="$removeEmptyLines" type="string" undoc="true"/><parameter name="$checkMultiline" type="string" undoc="true"/><return type="void"/><description/><shortdescription>reads in a cvs-file and returns it as a 2-dim vector.</shortdescription></doc></function><function name="csvStringToArray" undoc="false" access="private"><doc><see type="function">csvArrayToArray()</see><parameter name="$string" type="string"/><parameter name="$separator" default="&amp;apos;;&amp;apos;" type="string">(default is FALSE, see _checkMultiline())</parameter><parameter name="$trim" type="string" undoc="true"/><parameter name="$removeHeader" type="string" undoc="true"/><parameter name="$removeEmptyLines" type="string" undoc="true"/><parameter name="$checkMultiline" type="string" undoc="true"/><return type="void"/><description/><shortdescription>takes a csv-string and returns it as a 2-dim vector.</shortdescription></doc></function><function name="csvArrayToArray" undoc="false" access="public"><doc><see type="function">csvStringToArray()</see><parameter name="$array" type="string">(fullpath to the cvs file)</parameter><return name="" type="array"> (2-dim vector. it may be an empty array if there is no data.)</return><throws>bool FALSE on any error.</throws><description>cvs = comma separated value. you can easily export that froman excel file for example. it looks like:headerCellOne;headerCellTwo;headerCellThreedataCellOne;dataCellTwo;dataCellThreeapple;peach;banana;grapefruitlinux;windows;mac1;2;3note  I: all returned array elements are strings even if the values were numeric.note II: it may be that one array has another array-length than another. in the exampleabove, the fruits have 4 elements while the others just have 3. this is notcatched. ideally every sub-array would have 4 elements. this would have to beadded when needed, maybe with another param in the function call.</description><shortdescription>reads in a cvs array and returns it as a 2-dim vector.</shortdescription></doc></function><function name="arrayToCsvString" undoc="false" access="public"><doc><parameter name="$array" type="array">(see above)</parameter><parameter name="$separator" default="&amp;apos;;&amp;apos;" type="string">(default is &amp;apos;;&amp;apos;)</parameter><parameter name="$trim" default="&amp;apos;none&amp;apos;" type="string">(if we should trim the cells, default is &amp;apos;none&amp;apos;, can also be &amp;apos;left&amp;apos;, &amp;apos;right&amp;apos; or &amp;apos;both&amp;apos;. &amp;apos;none&amp;apos; kinda makes it faster, omits many function calls, remember that.)</parameter><parameter name="$removeEmptyLines" default="TRUE" type="string">(default is TRUE. removes &amp;quot;lines&amp;quot; that have no value, would come out empty.)</parameter><return name="" type="string"> (empty string if there is nothing at all)</return><description>the given param $array may be a simple 1-dim array like this:$arr = array(&amp;apos;madonna&amp;apos;, &amp;apos;alanis morisette&amp;apos;, &amp;apos;falco&amp;apos;);that will result in the string: &amp;quot;madonna;alanis morisette;falco&amp;quot;if the param is a 2-dim array, it goes like this:$arr = array(array(&amp;apos;madonna&amp;apos;, &amp;apos;pop&amp;apos;, &amp;apos;usa&amp;apos;),array(&amp;apos;alanis morisette&amp;apos;, &amp;apos;rock&amp;apos;, &amp;apos;canada&amp;apos;),array(&amp;apos;falco&amp;apos;, &amp;apos;pop&amp;apos;, &amp;apos;austria&amp;apos;),);result: madonna;pop;usaalanis morisette;rock;canadafalco;pop;austriatodo: add param &amp;quot;fill to fit max length&amp;quot;?</description><shortdescription>takes an array and creates a csv string from it.</shortdescription></doc></function><function name="_valToCsvHelper" undoc="false" access="private"><doc><see type="function">arrayToCsvString()</see><parameter name="$val" type="string"/><parameter name="$separator" type="string"/><parameter name="$trimFunction" type="mixed">(bool FALSE or &amp;apos;rtrim&amp;apos; or so.)</parameter><return name="" type="string"/><description/><shortdescription>works on a string to include in a csv string/file.</shortdescription></doc></function><function name="_checkMultiline" undoc="false" access="private"><doc><parameter name="$in" type="array"/><return name="" type="array"/><description/><shortdescription>takes an array and combines elements (lines) if needed.</shortdescription></doc></function><constant name="BS_CSVUTIL_VERSION" undoc="true" access="private" case="default: case sensitive">4.0.$x$<doc></doc></constant><inherited src="Bs_Object" type="functions"><element>isex</element><element>isexception</element><element>tostring</element><element>tohtml</element><element>persist</element><element>unpersist</element><element>bs_object</element><element>bbsetoutput</element><element>bbawake</element><element>bbisawake</element><element>bbxmsg</element><element>bbxfunctionstart</element><element>bbxfunctionend</element><element>bbxecho</element><element>bbxvar</element><element>bbxvardump</element><element>bbforcetrace</element><element>bbbufferstart</element><element>bbbufferget</element><element>bbbufferendflush</element><element>bbbufferendclean</element></inherited><inherited src="Bs_Object" type="consts"><element>bs_object_version</element></inherited><path><parent>Bs_Object</parent></path><baseclass>Bs_Object</baseclass></class></phpdoc>