-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added BaseWriter
- Loading branch information
Showing
13 changed files
with
419 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash -e | ||
|
||
rm -f phpoffice.zip | ||
zip -9 -r -q phpoffice.zip src haxelib.json hxformat.json README.md CHANGES.md LICENSE | ||
zip -9 -r -q phpoffice.zip src haxelib.json hxformat.json README.md CHANGELOG.md LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
package php.phpoffice.phpspreadsheet.reader; | ||
|
||
import php.phpoffice.phpspreadsheet.Spreadsheet; | ||
|
||
@:native("PhpOffice\\PhpSpreadsheet\\Reader\\BaseReader") | ||
extern class BaseReader { | ||
/** | ||
* Read data only? | ||
* If this is true, then the Reader will only read data values for cells, it will not read any formatting information. | ||
* If false (the default) it will read data and formatting. | ||
* | ||
* @return bool | ||
*/ | ||
public function getReadDataOnly():Bool; | ||
|
||
/** | ||
* Set read data only | ||
* Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information. | ||
* Set to false (the default) to advise the Reader to read both data and formatting for cells. | ||
* | ||
* @param bool $pValue | ||
* | ||
* @return IReader | ||
*/ | ||
public function setReadDataOnly(value:Bool):IReader; | ||
|
||
/** | ||
* Read empty cells? | ||
* If this is true (the default), then the Reader will read data values for all cells, irrespective of value. | ||
* If false it will not read data for cells containing a null value or an empty string. | ||
* | ||
* @return bool | ||
*/ | ||
public function getReadEmptyCells():Bool; | ||
|
||
/** | ||
* Set read empty cells | ||
* Set to true (the default) to advise the Reader read data values for all cells, irrespective of value. | ||
* Set to false to advise the Reader to ignore cells containing a null value or an empty string. | ||
* | ||
* @param bool $pValue | ||
* | ||
* @return IReader | ||
*/ | ||
public function setReadEmptyCells(value:Bool):IReader; | ||
|
||
/** | ||
* Read charts in workbook? | ||
* If this is true, then the Reader will include any charts that exist in the workbook. | ||
* Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. | ||
* If false (the default) it will ignore any charts defined in the workbook file. | ||
* | ||
* @return bool | ||
*/ | ||
public function getIncludeCharts():Bool; | ||
|
||
/** | ||
* Set read charts in workbook | ||
* Set to true, to advise the Reader to include any charts that exist in the workbook. | ||
* Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. | ||
* Set to false (the default) to discard charts. | ||
* | ||
* @param bool $pValue | ||
* | ||
* @return IReader | ||
*/ | ||
public function setIncludeCharts(value:Bool):IReader; | ||
|
||
/** | ||
* Get which sheets to load | ||
* Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null | ||
* indicating that all worksheets in the workbook should be loaded. | ||
* | ||
* @return mixed | ||
*/ | ||
public function getLoadSheetsOnly():Any; | ||
|
||
/** | ||
* Set which sheets to load. | ||
* | ||
* @param mixed $value | ||
* This should be either an array of worksheet names to be loaded, or a string containing a single worksheet name. | ||
* If NULL, then it tells the Reader to read all worksheets in the workbook | ||
* | ||
* @return IReader | ||
*/ | ||
public function setLoadSheetsOnly(value:Any):IReader; | ||
|
||
/** | ||
* Set all sheets to load | ||
* Tells the Reader to load all worksheets from the workbook. | ||
* | ||
* @return IReader | ||
*/ | ||
public function setLoadAllSheets():IReader; | ||
|
||
/** | ||
* Read filter. | ||
* | ||
* @return IReadFilter | ||
*/ | ||
public function getReadFilter():Any; | ||
|
||
/** | ||
* Set read filter. | ||
* | ||
* @param IReadFilter $pValue | ||
* | ||
* @return IReader | ||
*/ | ||
public function setReadFilter(value:Any):IReader; | ||
|
||
public function getSecuritySCanner():Any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package php.phpoffice.phpspreadsheet.reader; | ||
|
||
import php.phpoffice.phpspreadsheet.Spreadsheet; | ||
|
||
@:native("PhpOffice\\PhpSpreadsheet\\Reader\\IReader") | ||
extern interface IReader { | ||
/** | ||
* Can the current IReader read the file? | ||
* | ||
* @param string $pFilename | ||
* | ||
* @return bool | ||
*/ | ||
public function canRead(filename:String):Bool; | ||
|
||
/** | ||
* Loads PhpSpreadsheet from file. | ||
* | ||
* @param string $pFilename | ||
* | ||
* @throws Exception | ||
* | ||
* @return \PhpOffice\PhpSpreadsheet\Spreadsheet | ||
*/ | ||
public function load(filename:String):Spreadsheet; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package php.phpoffice.phpspreadsheet.reader; | ||
|
||
import php.phpoffice.phpspreadsheet.Spreadsheet; | ||
|
||
// Original file header of ParseXL (used as the base for this class): | ||
// -------------------------------------------------------------------------------- | ||
// Adapted from Excel_Spreadsheet_Reader developed by users bizon153, | ||
// trex005, and mmp11 (SourceForge.net) | ||
// https://sourceforge.net/projects/phpexcelreader/ | ||
// Primary changes made by canyoncasa (dvc) for ParseXL 1.00 ... | ||
// Modelled moreso after Perl Excel Parse/Write modules | ||
// Added Parse_Excel_Spreadsheet object | ||
// Reads a whole worksheet or tab as row,column array or as | ||
// associated hash of indexed rows and named column fields | ||
// Added variables for worksheet (tab) indexes and names | ||
// Added an object call for loading individual woorksheets | ||
// Changed default indexing defaults to 0 based arrays | ||
// Fixed date/time and percent formats | ||
// Includes patches found at SourceForge... | ||
// unicode patch by nobody | ||
// unpack("d") machine depedency patch by matchy | ||
// boundsheet utf16 patch by bjaenichen | ||
// Renamed functions for shorter names | ||
// General code cleanup and rigor, including <80 column width | ||
// Included a testcase Excel file and PHP example calls | ||
// Code works for PHP 5.x | ||
// Primary changes made by canyoncasa (dvc) for ParseXL 1.10 ... | ||
// http://sourceforge.net/tracker/index.php?func=detail&aid=1466964&group_id=99160&atid=623334 | ||
// Decoding of formula conditions, results, and tokens. | ||
// Support for user-defined named cells added as an array "namedcells" | ||
// Patch code for user-defined named cells supports single cells only. | ||
// NOTE: this patch only works for BIFF8 as BIFF5-7 use a different | ||
// external sheet reference structure | ||
@:native("PhpOffice\\PhpSpreadsheet\\Reader\\Xls") | ||
extern class Xls extends BaseReader implements IReader { | ||
/** | ||
* Create a new Xls Reader instance. | ||
*/ | ||
public function new(); | ||
|
||
/** | ||
* Can the current IReader read the file? | ||
* | ||
* @param string $pFilename | ||
* | ||
* @return bool | ||
*/ | ||
public function canRead(filename:String):Bool; | ||
|
||
/** | ||
* Reads names of the worksheets from a file, without parsing the whole file to a PhpSpreadsheet object. | ||
* | ||
* @param string $pFilename | ||
* | ||
* @throws Exception | ||
* | ||
* @return array | ||
*/ | ||
public function listWorksheetNames(filename:String):NativeArray; | ||
|
||
/** | ||
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns). | ||
* | ||
* @param string $pFilename | ||
* | ||
* @throws Exception | ||
* | ||
* @return array | ||
*/ | ||
public function listWorksheetInfo(filename:String):NativeArray; | ||
|
||
/** | ||
* Loads PhpSpreadsheet from file. | ||
* | ||
* @param string $pFilename | ||
* | ||
* @throws Exception | ||
* | ||
* @return Spreadsheet | ||
*/ | ||
public function load(filename:String):Spreadsheet; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package php.phpoffice.phpspreadsheet.reader; | ||
|
||
import php.phpoffice.phpspreadsheet.Spreadsheet; | ||
|
||
@:native("PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx") | ||
extern class Xlsx extends BaseReader implements IReader { | ||
/** | ||
* Create a new Xls Reader instance. | ||
*/ | ||
public function new(); | ||
|
||
/** | ||
* Can the current IReader read the file? | ||
* | ||
* @param string $pFilename | ||
* | ||
* @return bool | ||
*/ | ||
public function canRead(filename:String):Bool; | ||
|
||
/** | ||
* Reads names of the worksheets from a file, without parsing the whole file to a PhpSpreadsheet object. | ||
* | ||
* @param string $pFilename | ||
* | ||
* @throws Exception | ||
* | ||
* @return array | ||
*/ | ||
public function listWorksheetNames(filename:String):NativeArray; | ||
|
||
/** | ||
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns). | ||
* | ||
* @param string $pFilename | ||
* | ||
* @throws Exception | ||
* | ||
* @return array | ||
*/ | ||
public function listWorksheetInfo(filename:String):NativeArray; | ||
|
||
/** | ||
* Loads PhpSpreadsheet from file. | ||
* | ||
* @param string $pFilename | ||
* | ||
* @throws Exception | ||
* | ||
* @return Spreadsheet | ||
*/ | ||
public function load(filename:String):Spreadsheet; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package php.phpoffice.phpspreadsheet.writer; | ||
|
||
import php.phpoffice.phpspreadsheet.Spreadsheet; | ||
|
||
@:native("PhpOffice\\PhpSpreadsheet\\Writer\\BaseWriter") | ||
extern class BaseWriter { | ||
/** | ||
* Write charts in workbook? | ||
* If this is true, then the Writer will write definitions for any charts that exist in the PhpSpreadsheet object. | ||
* If false (the default) it will ignore any charts defined in the PhpSpreadsheet object. | ||
* | ||
* @return bool | ||
*/ | ||
public function getIncludeCharts():Bool; | ||
|
||
/** | ||
* Set write charts in workbook | ||
* Set to true, to advise the Writer to include any charts that exist in the PhpSpreadsheet object. | ||
* Set to false (the default) to ignore charts. | ||
* | ||
* @param bool $pValue | ||
* | ||
* @return IWriter | ||
*/ | ||
public function setIncludeCharts(value:Bool):IWriter; | ||
|
||
/** | ||
* Get Pre-Calculate Formulas flag | ||
* If this is true (the default), then the writer will recalculate all formulae in a workbook when saving, | ||
* so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet | ||
* viewer when opening the file | ||
* If false, then formulae are not calculated on save. This is faster for saving in PhpSpreadsheet, but slower | ||
* when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself. | ||
* | ||
* @return bool | ||
*/ | ||
public function getPreCalculateFormulas():Bool; | ||
|
||
/** | ||
* Set Pre-Calculate Formulas | ||
* Set to true (the default) to advise the Writer to calculate all formulae on save | ||
* Set to false to prevent precalculation of formulae on save. | ||
* | ||
* @param bool $pValue Pre-Calculate Formulas? | ||
* | ||
* @return IWriter | ||
*/ | ||
public function setPreCalculateFormulas(value:Bool):IWriter; | ||
|
||
/** | ||
* Get use disk caching where possible? | ||
* | ||
* @return bool | ||
*/ | ||
public function getUseDiskCaching():Bool; | ||
|
||
/** | ||
* Set use disk caching where possible? | ||
* | ||
* @param bool $pValue | ||
* @param string $pDirectory Disk caching directory | ||
* | ||
* @throws Exception when directory does not exist | ||
* | ||
* @return IWriter | ||
*/ | ||
public function setUseDiskCaching(value:Bool, directory:Null<String> = null):IWriter; | ||
|
||
/** | ||
* Get disk caching directory. | ||
* | ||
* @return string | ||
*/ | ||
public function getDiskCachingDirectory():String; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package php.phpoffice.phpspreadsheet.writer; | ||
|
||
import php.phpoffice.phpspreadsheet.Spreadsheet; | ||
|
||
@:native("PhpOffice\\PhpSpreadsheet\\Writer\\IWriter") | ||
extern interface IWriter { | ||
/** | ||
* Save PhpSpreadsheet to file. | ||
* | ||
* @param string $pFilename Name of the file to save | ||
* | ||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception | ||
*/ | ||
public function save(filename:String):Void; | ||
} |
Oops, something went wrong.