⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sheetrec.h

📁 xls文件格式分析基础库
💻 H
字号:
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (C) Yeico S. A. de C. V. * xlsLib -- A multiplatform, C++ library for dynamic generation of Excel (TM)  * files. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *   * $Source: /cvsroot/xlslib/xlslib/src/xlslib/sheetrec.h,v $ * $Revision: 1.1.1.1 $ * $Author: darioglz $ * $Date: 2004/08/27 16:31:44 $ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * File description: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */#ifndef SHEETREC_H#define SHEETREC_H#include <config.h>#include "common.h"#include "unit.h"#include "biffsection.h"#include "recdef.h"#include "index.h"#include "extformat.h"#include "label.h"#include "blank.h"#include "number.h"#include "row.h"#include "merged.h"#include "colinfo.h"#include "globalrec.h"#include "range.h"namespace xlslib_core{  /************************************worksheet class declaration************************************/  typedef enum    {      SHEET_INIT,      SHEET_BOF,      SHEET_INDEX,      SHEET_ROWBLOCKS,      SHEET_MERGED,      SHEET_COLINFO,      SHEET_WINDOW2,      SHEET_EOF,      SHEET_FINISH    } SheetRecordDumpState_t;#define BOF_SIZE ((unsigned8_t)12)#define EOF_SIZE ((unsigned8_t)4)#define WINDOW2_SIZE ((unsigned8_t)14)  typedef struct  {    unsigned32_t rowandcell_size;    unsigned32_t dbcell_size;    unsigned32_t rows_sofar;  }rowblocksize_t;  typedef std::list<xlslib_core::rowblocksize_t* XLSLIB_DFLT_ALLOCATOR> RBSize_List_t;  typedef RBSize_List_t::iterator RBSize_List_Itor_t;  typedef enum    {      RB_INIT,      RB_FIRST_ROW,      RB_ROWS,      RB_FIRSTCELL,      RB_CELLS,      RB_DBCELL,      RB_FINISH    }DumpRowBlocksState_t;  typedef std::list<unsigned16_t XLSLIB_DFLT_ALLOCATOR> CellOffsets_List_t;  typedef CellOffsets_List_t::iterator CellOffsets_List_Itor_t;  //class range;  class worksheet    : public CBiffSection    {    private:      CGlobalRecords* m_pGlobalRecords;      SheetRecordDumpState_t m_DumpState;      CUnit* m_pCurrentData;      std::string m_Name;      bool m_SizeCalculated;      unsigned32_t m_Size;      Range_List_t m_MergedRanges;      Colinfo_List_t m_Colinfos;      Colinfo_List_Itor_t m_Current_Colinfo;      RowHeight_List_t m_RowHeights;      RowHeight_List_Itor_t m_Current_RowHeight;      // Label related additions      /*   void AddLabel(unsigned16_t row, unsigned16_t col,            std::string& strlabel, unsigned16_t& xformat);      */    private:      Cell_List_t m_Cells;      Cell_List_Itor_t m_CurrentCell; // Init this one in the INIT state      Cell_List_Itor_t m_CurrentSizeCell; // Init this one in the INIT state      bool m_CellsSorted;      RangeObj_List_t m_Ranges;      RBSize_List_t m_RBSizes;      RBSize_List_Itor_t m_Current_RBSize;      bool m_SizesCalculated;      DumpRowBlocksState_t m_DumpRBState;      unsigned8_t m_RowCounter;      unsigned32_t m_CellCounter;      unsigned32_t m_DBCellOffset;      CellOffsets_List_t m_CellOffsets;      unsigned32_t m_CurrentRowBlock;      Cell_List_Itor_t m_Starting_RBCell;      void GetFirstLastRows(unsigned32_t* first_row, unsigned32_t* last_row);      unsigned32_t GetNumRowBlocks();      bool GetRowBlockSizes(unsigned32_t* rowandcell_size,                             unsigned32_t* dbcell_size,                            unsigned32_t* num_rows = NULL);      CUnit* RowBlocksDump();      void AddCell(cell_t* pcell);      void SortCells();      //    public:      worksheet(CGlobalRecords* pglobalrec);      ~worksheet();      // The offset defines the amount      // of data form the beginning of the BIFF records to the first      CUnit* DumpData(unsigned32_t offset);       unsigned32_t GetSize();      cell_t* FindCell(unsigned16_t row, unsigned16_t col);      // Cell operations      void merge(unsigned16_t first_row, unsigned16_t first_col,                  unsigned16_t last_row, unsigned16_t last_col);      void colwidth(unsigned16_t col, unsigned16_t width);      void rowheight(unsigned16_t row, unsigned16_t height);      // Ranges      range* rangegroup(unsigned16_t row1, unsigned16_t col1,                        unsigned16_t row2, unsigned16_t col2);      // Cells      cell_t* label(unsigned16_t row, unsigned16_t col,                     std::string strlabel, xf_t* pxformat = NULL);         cell_t* blank(unsigned16_t row, unsigned16_t col,                     xf_t* pxformat = NULL);      cell_t* number(unsigned16_t row, unsigned16_t col,                      double numval,  format_number_t fmtval,                     xf_t* pxformat = NULL);    };  typedef std::vector<xlslib_core::worksheet*> Sheets_Vector_t;  typedef Sheets_Vector_t::iterator Sheets_Vector_Itor_t;}#endif // SHEETREC_H/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * $Log: sheetrec.h,v $ * Revision 1.1.1.1  2004/08/27 16:31:44  darioglz * Initial Import. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -