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

📄 row.cpp

📁 xls文件格式分析基础库
💻 CPP
字号:
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 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/row.cpp,v $ * $Revision: 1.1.1.1 $ * $Author: darioglz $ * $Date: 2004/08/27 16:31:53 $ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * File description: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */#include "row.h"using namespace std;using namespace xlslib_core;/*******************************CRow class implementation*******************************/CRow::CRow(unsigned16_t rownum,             unsigned16_t firstcol,           unsigned16_t lastcol,            unsigned16_t rowheight){   SetRecordType(RECTYPE_ROW);   AddValue16(rownum);   AddValue16(firstcol);   AddValue16((lastcol+1));   AddValue16(rowheight);   // A field used by MS for "optimizing" (?) the loading of a file.   // Doc says it shall be set to 0 if I'm creating a BIFF...   AddValue16(0);   // A reserved value:   AddValue16(0);   // TODO: The following flag-word can be used for outline cells. Later.   // As a defaule the GhostDirty flag is is set, so the row has a default   // format (set by the index of byte 18).   if(rowheight == ROW_DFLT_HEIGHT)   {      AddValue16((unsigned16_t)(ROW_DFLT_GRBIT));   }   else   {      AddValue16((unsigned16_t)(ROW_DFLT_GRBIT|ROW_GRBIT_UNSYNC));      }   AddValue16((unsigned16_t)ROW_DFLT_IXFE);   SetRecordLength(GetDataSize()-4);}// NOTE: row_t has not a height fieldCRow::CRow(row_t& rowdef){   SetRecordType(RECTYPE_ROW);   AddValue16(rowdef.rownum);   AddValue16(rowdef.firstcol);   AddValue16((rowdef.lastcol+1));   AddValue16(ROW_DFLT_HEIGHT);   // A field used by MS for "optimizing" (?) the loading of a file.   // Doc says it shall be set to 0 if I'm creating a BIFF...   AddValue16((unsigned16_t)0);   // A reserved value:   AddValue16((unsigned16_t)0);   // TODO: The following flag-word can be used for outline cells. Later.   // As a defaule the GhostDirty flag is is set, so the row has a default   // format (set by the index of byte 18).   AddValue16((unsigned16_t)(ROW_DFLT_GRBIT|ROW_GRBIT_UNSYNC));   AddValue16((unsigned16_t)ROW_DFLT_IXFE);   SetRecordLength(GetDataSize()-4);}CRow::~CRow(){}/**************************************************************/void CRow::SetFirstCol(unsigned16_t firstcol){   SetValueAt((signed16_t)firstcol, ROW_OFFSET_FIRSTCOL);}/**************************************************************/void CRow::SetLastCol(unsigned16_t lastcol){   SetValueAt((signed16_t)lastcol, ROW_OFFSET_LASTCOL);}  /**************************************************************/unsigned16_t CRow::GetFirstCol(void){   signed16_t firstcol;   GetValue16From(&firstcol,ROW_OFFSET_FIRSTCOL);   return (unsigned16_t)firstcol;}/**************************************************************/unsigned16_t CRow::GetLastCol(void){   signed16_t lastcol;   GetValue16From(&lastcol,ROW_OFFSET_LASTCOL);   return (unsigned16_t)lastcol;}/*******************************CDBCell class implementation*******************************/CDBCell::CDBCell(unsigned32_t startblock){   // The new initializated DBCell record points to nowhere and has no    // extra rows (the array of stream offsets is empty);   SetRecordType(RECTYPE_DBCELL);   AddValue32((unsigned32_t) startblock);           SetRecordLength(GetDataSize()-4);}CDBCell::~CDBCell(){}void CDBCell::AddRowOffset(unsigned16_t rowoffset){       AddValue16((unsigned16_t) rowoffset);   SetRecordLength(GetDataSize()-4);}/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * $Log: row.cpp,v $ * Revision 1.1.1.1  2004/08/27 16:31:53  darioglz * Initial Import. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

⌨️ 快捷键说明

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