91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 36KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-06
  • 語言: 其他
  • 標簽:

資源簡介

開源basic_excel存在讀excel文件時load異常,原因是對其中work表中WORKBOOK_GLOBALS的case CODE::SST組裝存在bug,SST中存放全局的stting信息,當其長度超過8224時就需要拆分記錄,新的記錄標識位為[CODE::CONTINUE],因此,讀時需要組裝; 這折分有幾種規則,1、前一個字符串還沒有完時,后續的新recode開頭只有1個字節的unicode標識;2、前一個字符串完整時,那后續新recode正常開頭了; 具體的修改見代碼;

資源截圖

代碼片段和文件信息


#include?“basic_excel.hpp“
#include?“assert.h“

namespace?YCompoundFiles
{
/**********************************?Start?of?Class?Block?*************************************/
//?PURPOSE:?Manage?a?file?by?treating?it?as?blocks?of?data?of?a?certain?size.
Block::Block()?:?
blockSize_(512)?fileSize_(0)?indexEnd_(0)
filename_(0)?{}

bool?Block::Create(const?wchar_t*?filename)
//?PURPOSE:?Create?a?new?block?file?and?open?it.
//?PURPOSE:?If?file?is?present?truncate?it?and?then?open?it.
//?PROMISE:?Return?true?if?file?is?successfully?created?and?opened?false?if?otherwise.
{
//?Create?new?file
size_t?filenameLength?=?wcslen(filename);
char*?name?=?new?char[filenameLength+1];
wcstombs(name?filename?filenameLength);
name[filenameLength]?=?0;

file_.open(name?ios_base::out?|?ios_base::trunc);
file_.close();
file_.clear();

//?Open?the?file
bool?ret?=?this->Open(filename);
delete[]?name;
return?ret;
}

bool?Block::Open(const?wchar_t*?filename?ios_base::openmode?mode)
//?PURPOSE:?Open?an?existing?block?file.
//?PROMISE:?Return?true?if?file?is?successfully?opened?false?if?otherwise.
{
//?Open?existing?file?for?reading?or?writing?or?both
size_t?filenameLength?=?wcslen(filename);
filename_.resize(filenameLength+1?0);
wcstombs(&*(filename_.begin())?filename?filenameLength);

file_.open(&*(filename_.begin())?mode?|?ios_base::binary);
if?(!file_.is_open())?return?false;

mode_?=?mode;

//?Calculate?filesize
if?(mode?&?ios_base::in)
{
file_.seekg(0?ios_base::end);
fileSize_?=?file_.tellg();
}
else?if?(mode?&?ios_base::out)
{
file_.seekp(0?ios_base::end);
fileSize_?=?file_.tellp();
}
else
{
this->Close();
return?false;
}

//?Calculate?last?index?+?1
indexEnd_?=?fileSize_/blockSize_?+?(fileSize_?%?blockSize_???1?:?0);
return?true;
}

bool?Block::Close()
//?PURPOSE:?Close?the?opened?block?file.
//?PROMISE:?Return?true?if?file?is?successfully?closed?false?if?otherwise.
{
file_.close();
file_.clear();
filename_.clear();?
fileSize_?=?0;?
indexEnd_?=?0;?
blockSize_?=?512;
return?!file_.is_open();
}

bool?Block::IsOpen()
//?PURPOSE:?Check?if?the?block?file?is?still?opened.
//?PROMISE:?Return?true?if?file?is?still?opened?false?if?otherwise.
{
return?file_.is_open();
}

bool?Block::Read(size_t?index?char*?block)
//?PURPOSE:?Read?a?block?of?data?from?the?opened?file?at?the?index?position.
//?EXPLAIN:?index?is?from?[0..].
//?PROMISE:?Return?true?if?data?are?successfully?read?false?if?otherwise.
{
if?(!(mode_?&?ios_base::in))?return?false;
if?(index? {
file_.seekg(index?*?blockSize_);
file_.read(block?blockSize_);
return?!file_.fail();
}
else?return?false;
}

bool?Block::Write(size_t?index?const?char*?block)
//?PURPOSE:?Write?a?block?of?data?to?the?opened?file?at?the?index?position.
//?EXPLAIN:?index?is?from?[0..].
//?PROMISE:?Return?true?if?data?are?successfully?written?false

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????185821??2012-06-10?22:43??basic_excel\basic_excel.cpp

?????文件??????46476??2012-06-10?22:27??basic_excel\basic_excel.hpp

?????目錄??????????0??2012-06-10?22:43??basic_excel

-----------?---------??----------?-----??----

???????????????232297????????????????????3


評論

共有 條評論

相關資源