close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Changes between Initial Version and Version 6 of Ticket #740


Ignore:
Timestamp:
Mar 24, 2011, 10:51:28 AM (14 years ago)
Author:
Víctor de Buen Remiro
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #740

    • Property Status changed from new to accepted
    • Property Cc vdebuen@… added
    • Property Version changed from to head
  • Ticket #740 – Description

    initial v6  
    99Anything y poco podemos saber de ellas, quizá sería útil
    1010poder ver los constructores (métodos Static) que tienen.
     11
     12
     13{{{
     14#!cpp
     15///////////////////////////////////////////////////////////////////////////////
     16Class ImportExport::@Excel
     17
     18///////////////////////////////////////////////////////////////////////////////
     19
     20
     21{
     22 
     23/* ////////////////////////////////////////////////////////////////////////////
     24Non static method defined at ImportExport::@Excel
     25Call to methodSet ReadVMatrix(firstRow, col, _.maxRow-firstRow+1, 1)
     26where col is the index of the column which first row has the specified name.Method GetSheetMaxRange must be called before.
     27You must set minRow and minCol members before to calling GetSheetMaxRange if there are empty rows or columns before the data cells
     28Returns a VMatrix with the numeric values of a rectangle of cells in the current work sheet. Non numeric or empty cells will be interpreted as unknown values.
     29//////////////////////////////////////////////////////////////////////////// */
     30VMatrix GetFullVColumnByName(Text name, Real firstRow);
     31
     32/* ////////////////////////////////////////////////////////////////////////////
     33Non static method defined at ImportExport::@Excel
     34Reads from current active work sheet the content of specified cell returning one of these types: Text, Date, Real
     35//////////////////////////////////////////////////////////////////////////// */
     36Anything ReadCell(Real row, Real col);
     37
     38/* ////////////////////////////////////////////////////////////////////////////
     39Non static method defined at ImportExport::@Excel
     40Returns a Set of Sets with the values of a rectangle of cells in the current work sheet. Each cell will have any of allowed types : Text, Real, Date.
     41When argument columnDefaults is not the empty set, then if a cell hasn't the specified type for its column in argument columnDefaults, then the unknown value of the type will be returned.
     42//////////////////////////////////////////////////////////////////////////// */
     43Set ReadRange(Real row_ini_, Real col_ini_, Real row_num, Real col_num, Set columnDefaults);
     44
     45/* ////////////////////////////////////////////////////////////////////////////
     46Non static method defined at ImportExport::@Excel
     47Call to methodSet ReadVMatrix(minRow=1, minCol=1, _.numRow, _.numCol)
     48Method GetSheetMaxRange must be called before.
     49You must set minRow and minCol members before to calling GetSheetMaxRange if there are empty rows or columns before the data cells
     50Returns a VMatrix with the numeric values of a rectangle of cells in the current work sheet. Non numeric or empty cells will be interpreted as unknown values.
     51//////////////////////////////////////////////////////////////////////////// */
     52Matrix GetFullVMatrix(Real void);
     53
     54/* ////////////////////////////////////////////////////////////////////////////
     55Non static member defined at ImportExport::@Excel
     56First column to be readed in method GetSheetMaxRange. Must be set by user if it's not the fiersdt one before to calling GetSheetMaxRange
     57//////////////////////////////////////////////////////////////////////////// */
     58Real minCol = 1;
     59
     60/* ////////////////////////////////////////////////////////////////////////////
     61Static member defined at ImportExport::@Excel
     62Default date format.
     63//////////////////////////////////////////////////////////////////////////// */
     64Text defaultDateFormat = "%Y-%m-%d";
     65
     66/* ////////////////////////////////////////////////////////////////////////////
     67Non static method defined at ImportExport::@Excel
     68Activates the worksheet with specified name
     69//////////////////////////////////////////////////////////////////////////// */
     70Real ActivateNamedWS(Text workSheetName, Real readRange, Real headerIndexedByName);
     71
     72/* ////////////////////////////////////////////////////////////////////////////
     73Non static method defined at ImportExport::@Excel
     74Writes a Matrix in the range of cells starting with the specified cell of current active work sheet.
     75Returns the number of modified cells.
     76//////////////////////////////////////////////////////////////////////////// */
     77Real WriteMatrix(Real row, Real col, Matrix values);
     78
     79/* ////////////////////////////////////////////////////////////////////////////
     80Non static method defined at ImportExport::@Excel
     81Returns a Matrix with the numeric values of a rectangle of cells in the current work sheet. Non numeric or empty cells will be interpreted as unknown values.
     82//////////////////////////////////////////////////////////////////////////// */
     83Matrix ReadMatrix(Real row_ini, Real col_ini, Real row_num, Real col_num);
     84
     85/* ////////////////////////////////////////////////////////////////////////////
     86Non static method defined at ImportExport::@Excel
     87Saves changes in workbook in the specified path
     88//////////////////////////////////////////////////////////////////////////// */
     89Real SaveAs(Text path);
     90
     91/* ////////////////////////////////////////////////////////////////////////////
     92Non static method defined at ImportExport::@Excel
     93Reads from current active work sheet the content of specified cell returning a Date
     94//////////////////////////////////////////////////////////////////////////// */
     95Date ReadDate(Real row, Real col);
     96
     97/* ////////////////////////////////////////////////////////////////////////////
     98Static method defined at ImportExport::@Excel
     99Opens an existent workbook.
     100//////////////////////////////////////////////////////////////////////////// */
     101@Excel Open(Text path);
     102
     103/* ////////////////////////////////////////////////////////////////////////////
     104Non static method defined at ImportExport::@Excel
     105Writes a range of cells starting with the specified cell of current active work sheet. Set cellValues must be a set of sets which elements are of one of these types: Text, Real, Date.
     106Returns the number of modified cells.
     107//////////////////////////////////////////////////////////////////////////// */
     108Real WriteRange(Real row0, Real col0, Set cellValues);
     109
     110/* ////////////////////////////////////////////////////////////////////////////
     111Non static method defined at ImportExport::@Excel
     112Call to methodSet GetRange(minRow=1, minCol=1, _.numRow, _.numCol, columnDefaults)
     113Method GetSheetMaxRange must be called before.
     114You must set minRow and minCol members before to calling GetSheetMaxRange if there are empty rows or columns before the data cells
     115Returns a Set of Sets with the values of a rectangle of cells in the current work sheet. Each cell will have any of allowed types : Text, Real, Date.
     116When argument columnDefaults is not the empty set, then if a cell hasn't the specified type for its column in argument columnDefaults, then the unknown value of the type will be returned.
     117//////////////////////////////////////////////////////////////////////////// */
     118Set GetFullRange(Set columnDefaults);
     119
     120/* ////////////////////////////////////////////////////////////////////////////
     121Static member defined at ImportExport::@Excel
     122Controls warnings verbosity.
     123//////////////////////////////////////////////////////////////////////////// */
     124Real showMassiveWarning = False;
     125
     126/* ////////////////////////////////////////////////////////////////////////////
     127Non static method defined at ImportExport::@Excel
     128Reads from current active work sheet the content of specified cell returning a Real
     129//////////////////////////////////////////////////////////////////////////// */
     130Real ReadReal(Real row, Real col);
     131
     132/* ////////////////////////////////////////////////////////////////////////////
     133Non static method defined at ImportExport::@Excel
     134Writes a range of cells starting with the specified cell of current active work sheet. Set series must be a set of series with the same dating.
     135Returns the number of modified cells.
     136//////////////////////////////////////////////////////////////////////////// */
     137Real WriteSeries(Real row, Real col, Set series, Text dateFormat);
     138
     139/* ////////////////////////////////////////////////////////////////////////////
     140Non static method defined at ImportExport::@Excel
     141Returns a Set of series with specified dating. The first columne in the range is considered as the dates supporting the data of the Series. Every column from the column 2 on is considered as the data of one Serie. If dating is W then it will readed from the cell at left top corner. If this cell is empty or it's not a valid TimeSet then the default dating C will be used.
     142//////////////////////////////////////////////////////////////////////////// */
     143Set ReadSeries(Real row_ini, Real col_ini, Real row_num, Real col_num, TimeSet dating, Text dateFormat);
     144
     145/* ////////////////////////////////////////////////////////////////////////////
     146Non static method defined at ImportExport::@Excel
     147Call to methodSet ReadMatrix(minRow=1, minCol=1, _.numRow, _.numCol)
     148Method GetSheetMaxRange must be called before.
     149You must set minRow and minCol members before to calling GetSheetMaxRange if there are empty rows or columns before the data cells
     150Returns a Matrix with the numeric values of a rectangle of cells in the current work sheet. Non numeric or empty cells will be interpreted as unknown values.
     151//////////////////////////////////////////////////////////////////////////// */
     152Matrix GetFullMatrix(Real void);
     153
     154/* ////////////////////////////////////////////////////////////////////////////
     155Non static member defined at ImportExport::@Excel
     156Last row that was readed in method GetSheetMaxRange.
     157//////////////////////////////////////////////////////////////////////////// */
     158Real _.maxRow = ?;
     159
     160/* ////////////////////////////////////////////////////////////////////////////
     161Non static member defined at ImportExport::@Excel
     162The path of the workbook archive used in Open or New methods
     163//////////////////////////////////////////////////////////////////////////// */
     164Text _.path;
     165
     166/* ////////////////////////////////////////////////////////////////////////////
     167Non static member defined at ImportExport::@Excel
     168Number of rows that were readed in method GetSheetMaxRange.
     169//////////////////////////////////////////////////////////////////////////// */
     170Real _.numRow = ?;
     171
     172/* ////////////////////////////////////////////////////////////////////////////
     173Non static method defined at ImportExport::@Excel
     174Reads from current active work sheet the content of specified cell returning a Text
     175//////////////////////////////////////////////////////////////////////////// */
     176Text ReadText(Real row, Real col);
     177
     178/* ////////////////////////////////////////////////////////////////////////////
     179Static member defined at ImportExport::@Excel
     180Maximum number of rows that a work sheet can store. Used in method GetSheetMaxRange.
     181//////////////////////////////////////////////////////////////////////////// */
     182Real maxAllowedRow = 256^2;
     183
     184/* ////////////////////////////////////////////////////////////////////////////
     185Non static method defined at ImportExport::@Excel
     186Closes the workbook if it is has been open. If you doesn't close it, the workbook will be closed at instance destruction time.
     187//////////////////////////////////////////////////////////////////////////// */
     188Real Close(Real void);
     189
     190/* ////////////////////////////////////////////////////////////////////////////
     191Non static method defined at ImportExport::@Excel
     192Scans the current work sheet in order to stablish a rectangle of interesting cells, starting from cell [minRow,minCol], wich default value is [1,1]. Reads along first column until an empty cell is found to stablish maxCol. Then, reads along first row until an empty cell is found to stablish maxRow.
     193If argument headerIndexedByName is true stores the cells of first row in member _.headers and indexes it.
     194Note that cells in first row cannot be repeated and must be of type Text.
     195//////////////////////////////////////////////////////////////////////////// */
     196Real GetSheetMaxRange(Real headerIndexedByName);
     197
     198/* ////////////////////////////////////////////////////////////////////////////
     199Non static member defined at ImportExport::@Excel
     200If true, the first row was interpreted as column headers and will be stored in _.header. Used in method GetSheetMaxRange.
     201//////////////////////////////////////////////////////////////////////////// */
     202Real _.headerIndexedByName = False;
     203
     204/* ////////////////////////////////////////////////////////////////////////////
     205Non static method defined at ImportExport::@Excel
     206Writes into the specified cell of current active work sheet the specified value with on of these types: Text, Date, Real
     207//////////////////////////////////////////////////////////////////////////// */
     208Anything WriteCell(Real row, Real col, Anything value);
     209
     210/* ////////////////////////////////////////////////////////////////////////////
     211Non static member defined at ImportExport::@Excel
     212Column headers. Used in method GetSheetMaxRange when argument headerIndexedByName is true.
     213//////////////////////////////////////////////////////////////////////////// */
     214Set _.header = Copy(Empty);
     215
     216/* ////////////////////////////////////////////////////////////////////////////
     217Non static method defined at ImportExport::@Excel
     218Returns de internal identifier of excel workbook handler.
     219//////////////////////////////////////////////////////////////////////////// */
     220Real get_id(Real void);
     221
     222/* ////////////////////////////////////////////////////////////////////////////
     223Non static method defined at ImportExport::@Excel
     224Call to methodSet ReadSeries(minRow=1, minCol=1, _.numRow, _.numCol, dating)
     225Method GetSheetMaxRange must be called before.
     226You must set minRow and minCol members before to calling GetSheetMaxRange if there are empty rows or columns before the data cells
     227Returns a Set of series with specified dating. The first columne in the range is considered as the dates supporting the data of the Series. Every column from the column 2 on is considered as the data of one Serie. If dating is W then it will readed from the cell at left top corner. If this cell is empty or it's not a valid TimeSet then the default dating C will be used.
     228//////////////////////////////////////////////////////////////////////////// */
     229Set GetFullSeries(TimeSet dating, Text dateFormat);
     230
     231/* ////////////////////////////////////////////////////////////////////////////
     232Non static method defined at ImportExport::@Excel
     233Call to methodSet ReadVMatrix(firstRow, col, _.maxRow-firstRow+1, 1)
     234Method GetSheetMaxRange must be called before.
     235You must set minRow and minCol members before to calling GetSheetMaxRange if there are empty rows or columns before the data cells
     236Returns a VMatrix with the numeric values of a rectangle of cells in the current work sheet. Non numeric or empty cells will be interpreted as unknown values.
     237//////////////////////////////////////////////////////////////////////////// */
     238VMatrix GetFullVColumn(Real col, Real firstRow);
     239
     240/* ////////////////////////////////////////////////////////////////////////////
     241Non static method defined at ImportExport::@Excel
     242Writes a VMatrix in the range of cells starting with the specified cell of current active work sheet.
     243Returns the number of modified cells.
     244//////////////////////////////////////////////////////////////////////////// */
     245Real WriteVMatrix(Real row, Real col, Matrix values);
     246
     247/* ////////////////////////////////////////////////////////////////////////////
     248Non static member defined at ImportExport::@Excel
     249First row to be readed in method GetSheetMaxRange. Must be set by user if it's not the fiersdt one before to calling GetSheetMaxRange
     250//////////////////////////////////////////////////////////////////////////// */
     251Real minRow = 1;
     252
     253/* ////////////////////////////////////////////////////////////////////////////
     254Non static member defined at ImportExport::@Excel
     255Last columns that was readed in method GetSheetMaxRange.
     256//////////////////////////////////////////////////////////////////////////// */
     257Real _.maxCol = ?;
     258
     259/* ////////////////////////////////////////////////////////////////////////////
     260Non static member defined at ImportExport::@Excel
     261
     262//////////////////////////////////////////////////////////////////////////// */
     263Real verbose = True;
     264
     265/* ////////////////////////////////////////////////////////////////////////////
     266Non static member defined at ImportExport::@Excel
     267Number of columns that were readed in method GetSheetMaxRange.
     268//////////////////////////////////////////////////////////////////////////// */
     269Real _.numCol = ?;
     270
     271/* ////////////////////////////////////////////////////////////////////////////
     272Non static method defined at ImportExport::@Excel
     273Saves changes in workbook
     274//////////////////////////////////////////////////////////////////////////// */
     275Real Save(Real void);
     276
     277/* ////////////////////////////////////////////////////////////////////////////
     278Non static method defined at ImportExport::@Excel
     279Call to methodSet ReadMatrix(firstRow, col, _.maxRow-firstRow+1, 1)
     280Method GetSheetMaxRange must be called before.
     281You must set minRow and minCol members before to calling GetSheetMaxRange if there are empty rows or columns before the data cells
     282Returns a Matrix with the numeric values of a rectangle of cells in the current work sheet. Non numeric or empty cells will be interpreted as unknown values.
     283//////////////////////////////////////////////////////////////////////////// */
     284Matrix GetFullColumn(Real col, Real firstRow);
     285
     286/* ////////////////////////////////////////////////////////////////////////////
     287Static member defined at ImportExport::@Excel
     288Maximum number of columns that a work sheet can store. Used in method GetSheetMaxRange.
     289//////////////////////////////////////////////////////////////////////////// */
     290Real maxAllowedCol = 256;
     291
     292/* ////////////////////////////////////////////////////////////////////////////
     293Non static method defined at ImportExport::@Excel
     294Activates the n-th worksheet.
     295If readRange is true then calls to GetSheetMaxRange with argument headerIndexedByName
     296//////////////////////////////////////////////////////////////////////////// */
     297Real ActivateWS(Real workSheetNumber, Real readRange, Real headerIndexedByName);
     298
     299/* ////////////////////////////////////////////////////////////////////////////
     300Non static method defined at ImportExport::@Excel
     301Returns true if the specified cell is empty
     302//////////////////////////////////////////////////////////////////////////// */
     303Real IsEmptyCell(Real row, Real col);
     304
     305/* ////////////////////////////////////////////////////////////////////////////
     306Non static method defined at ImportExport::@Excel
     307Returns a VMatrix with the numeric values of a rectangle of cells in the current work sheet. Non numeric or empty cells will be interpreted as unknown values.
     308//////////////////////////////////////////////////////////////////////////// */
     309VMatrix ReadVMatrix(Real row_ini, Real col_ini, Real row_num, Real col_num);
     310
     311/* ////////////////////////////////////////////////////////////////////////////
     312Non static method defined at ImportExport::@Excel
     313Call to methodSet ReadMatrix(firstRow, col, _.maxRow-firstRow+1, 1)
     314where col is the index of the column which first row has the specified name.Method GetSheetMaxRange must be called before.
     315You must set minRow and minCol members before to calling GetSheetMaxRange if there are empty rows or columns before the data cells
     316Returns a Matrix with the numeric values of a rectangle of cells in the current work sheet. Non numeric or empty cells will be interpreted as unknown values.
     317//////////////////////////////////////////////////////////////////////////// */
     318Matrix GetFullColumnByName(Text name, Real firstRow);
     319
     320/* ////////////////////////////////////////////////////////////////////////////
     321Static method defined at ImportExport::@Excel
     322Creates an empty workbook.
     323//////////////////////////////////////////////////////////////////////////// */
     324@Excel New(Text path)
     325};
     326}}}