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

📄 index.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/index.cpp,v $ * $Revision: 1.1.1.1 $ * $Author: darioglz $ * $Date: 2004/08/27 16:31:53 $ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * File description: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */#include "index.h"using namespace std;using namespace xlslib_core;/*******************************CIndex class implementation*******************************/CIndex::CIndex(unsigned32_t firstrow,                unsigned32_t lastrow,               unsigned16_t biffversion){   SetRecordType((signed32_t)RECTYPE_INDEX);   AddValue32(INDEX_DFLT_RESERVED);   if(VERSION_BIFF57 == biffversion)   {      AddValue16(firstrow);      AddValue16(lastrow+1);      m_BiffVersion = VERSION_BIFF57;   }   else   {      AddValue32(firstrow);      AddValue32(lastrow+1);      m_BiffVersion = VERSION_BIFF8;      }   AddValue32(INDEX_DFLT_RESERVED);// NOTE: This record is created with an empty array. It should work if the rest// of the record is not completed later, since the record's size reflects the// lack of such array   SetRecordLength(GetDataSize()-4);}CIndex::~CIndex(){}/* *********************************************************************/void CIndex::AddDBCellOffset(unsigned32_t dboffset){   AddValue32(dboffset);   SetRecordLength(GetDataSize()-4); // Update record's length}/* *********************************************************************/void CIndex::SetRows(unsigned32_t firstrow,                     unsigned32_t lastrow){   if(VERSION_BIFF57 == m_BiffVersion)   {      SetValueAt((signed16_t)firstrow, INDEX_OFFSET_B7FIRSTROW);      SetValueAt((signed16_t)lastrow, INDEX_OFFSET_B7LASTROW);   }   else   {      SetValueAt((signed32_t)firstrow, INDEX_OFFSET_B7FIRSTROW);      SetValueAt((signed32_t)lastrow, INDEX_OFFSET_B7LASTROW);   }}/* *********************************************************************/unsigned32_t CIndex::GetFirstRow(void){   unsigned32_t retval;   if(VERSION_BIFF57 == m_BiffVersion)   {      signed16_t firstrow;      GetValue16From(&firstrow, INDEX_OFFSET_B7FIRSTROW);      retval = firstrow;   }   else   {      signed32_t firstrow;      GetValue32From(&firstrow, INDEX_OFFSET_B7FIRSTROW);      retval = firstrow;   }      return retval;}/* *********************************************************************/unsigned32_t CIndex::GetLastRow(void){   unsigned32_t retval;   if(VERSION_BIFF57 == m_BiffVersion)   {      signed16_t lastrow;      GetValue16From(&lastrow, INDEX_OFFSET_B7LASTROW);      retval = lastrow;   }   else   {      signed32_t lastrow;      GetValue32From(&lastrow, INDEX_OFFSET_B7LASTROW);      retval = lastrow;   }   return retval;}/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * $Log: index.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 + -