本文整理汇总了C++中Document::Hidratate方法的典型用法代码示例。如果您正苦于以下问题:C++ Document::Hidratate方法的具体用法?C++ Document::Hidratate怎么用?C++ Document::Hidratate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Document
的用法示例。
在下文中一共展示了Document::Hidratate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getlistOfTakenDocuments
string DataDocumentManager::getlistOfTakenDocuments()
{
ByteString bs = this->fileVariableRecord->readNext();
string out = "Id | Autor | Titulo | Fecha\n";
while(!bs.isEmpty())
{
Document document;
document.Hidratate(bs);
out.append(document.getDocumentFormatedText());
bs = this->fileVariableRecord->readNext();
}
return out;
}
示例2: addDocument
bool DataDocumentManager::addDocument(ByteString byteString)
{
bool saved = false;
int realID = this->autoIncInteger + 1;
int documentID;
string sid = Utility::intToString(realID);
string did;
Document document;
document.Hidratate(byteString);
document.setFakeId(realID);
if(document.getTitle()[0] == 'T')
documentID = this->twtautoIncInteger + 1;
else if(document.getTitle()[0] == 'N')
documentID = this->rssautoIncInteger + 1;
did = Utility::intToString(documentID);
document.setIdentificador(Utility::concat(document.getTitle(), did));
int position = this->fileVariableRecord->addDocument(document.Serialize());
if(position > -1)
{
this->autoIncInteger++;
if(document.getTitle()[0] == 'N')
rssautoIncInteger++;
else if(document.getTitle()[0] == 'T')
twtautoIncInteger++;
ByteString idDocument;
idDocument.insertLast(&realID, sizeof(int));
Key* key = new Key(idDocument.toString());
ByteString offset;
offset.insertLast(&position, sizeof(int));
Record* recPrincipalInd = new Record(key,&offset);
this->principalIndex->add(recPrincipalInd);
addIDtoFileFlags(IndexWrapper::AUTOR,idDocument.readAsInt(0));
addIDtoFileFlags(IndexWrapper::TITULO,idDocument.readAsInt(0));
addIDtoFileFlags(IndexWrapper::PALABRAS,idDocument.readAsInt(0));
addIDtoFileFlags(IndexWrapper::IDENTIFICADOR,idDocument.readAsInt(0));
addIDtoFileFlags(IndexWrapper::FECHA,idDocument.readAsInt(0));
saved = true;
}
return saved;
}