本文整理汇总了C++中FileInfo::GetCompressedSize方法的典型用法代码示例。如果您正苦于以下问题:C++ FileInfo::GetCompressedSize方法的具体用法?C++ FileInfo::GetCompressedSize怎么用?C++ FileInfo::GetCompressedSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileInfo
的用法示例。
在下文中一共展示了FileInfo::GetCompressedSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddAttachment
void DatabaseWrapperBase::AddAttachment(int64_t id,
const FileInfo& attachment)
{
SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO AttachedFiles VALUES(?, ?, ?, ?, ?, ?, ?, ?)");
s.BindInt64(0, id);
s.BindInt(1, attachment.GetContentType());
s.BindString(2, attachment.GetUuid());
s.BindInt64(3, attachment.GetCompressedSize());
s.BindInt64(4, attachment.GetUncompressedSize());
s.BindInt(5, attachment.GetCompressionType());
s.BindString(6, attachment.GetUncompressedMD5());
s.BindString(7, attachment.GetCompressedMD5());
s.Run();
}
示例2: s
TEST(StorageAccessor, NoCompression)
{
FilesystemStorage s("UnitTestsStorage");
StorageAccessor accessor(s);
std::string data = "Hello world";
FileInfo info = accessor.Write(data, FileContentType_Dicom, CompressionType_None, true);
std::string r;
accessor.Read(r, info);
ASSERT_EQ(data, r);
ASSERT_EQ(CompressionType_None, info.GetCompressionType());
ASSERT_EQ(11u, info.GetUncompressedSize());
ASSERT_EQ(11u, info.GetCompressedSize());
ASSERT_EQ(FileContentType_Dicom, info.GetContentType());
ASSERT_EQ("3e25960a79dbc69b674cd4ec67a72c62", info.GetUncompressedMD5());
ASSERT_EQ(info.GetUncompressedMD5(), info.GetCompressedMD5());
}
示例3: CheckNoParent
//.........这里部分代码省略.........
index_->ListAvailableMetadata(md, a[4]);
ASSERT_EQ(1u, md.size());
ASSERT_EQ(MetadataType_Instance_RemoteAet, md.front());
index_->SetMetadata(a[4], MetadataType_ModifiedFrom, "TUTU");
index_->ListAvailableMetadata(md, a[4]);
ASSERT_EQ(2u, md.size());
std::map<MetadataType, std::string> md2;
index_->GetAllMetadata(md2, a[4]);
ASSERT_EQ(2u, md2.size());
ASSERT_EQ("TUTU", md2[MetadataType_ModifiedFrom]);
ASSERT_EQ("PINNACLE", md2[MetadataType_Instance_RemoteAet]);
index_->DeleteMetadata(a[4], MetadataType_ModifiedFrom);
index_->ListAvailableMetadata(md, a[4]);
ASSERT_EQ(1u, md.size());
ASSERT_EQ(MetadataType_Instance_RemoteAet, md.front());
index_->GetAllMetadata(md2, a[4]);
ASSERT_EQ(1u, md2.size());
ASSERT_EQ("PINNACLE", md2[MetadataType_Instance_RemoteAet]);
ASSERT_EQ(21u + 42u + 44u, index_->GetTotalCompressedSize());
ASSERT_EQ(42u + 42u + 44u, index_->GetTotalUncompressedSize());
index_->SetMainDicomTag(a[3], DicomTag(0x0010, 0x0010), "PatientName");
int64_t b;
ResourceType t;
ASSERT_TRUE(index_->LookupResource(b, t, "g"));
ASSERT_EQ(7, b);
ASSERT_EQ(ResourceType_Study, t);
ASSERT_TRUE(index_->LookupMetadata(s, a[4], MetadataType_Instance_RemoteAet));
ASSERT_FALSE(index_->LookupMetadata(s, a[4], MetadataType_Instance_IndexInSeries));
ASSERT_EQ("PINNACLE", s);
std::string u;
ASSERT_TRUE(index_->LookupMetadata(u, a[4], MetadataType_Instance_RemoteAet));
ASSERT_EQ("PINNACLE", u);
ASSERT_FALSE(index_->LookupMetadata(u, a[4], MetadataType_Instance_IndexInSeries));
ASSERT_TRUE(index_->LookupGlobalProperty(s, GlobalProperty_FlushSleep));
ASSERT_FALSE(index_->LookupGlobalProperty(s, static_cast<GlobalProperty>(42)));
ASSERT_EQ("World", s);
FileInfo att;
ASSERT_TRUE(index_->LookupAttachment(att, a[4], FileContentType_DicomAsJson));
ASSERT_EQ("my json file", att.GetUuid());
ASSERT_EQ(21u, att.GetCompressedSize());
ASSERT_EQ("md5", att.GetUncompressedMD5());
ASSERT_EQ("compressedMD5", att.GetCompressedMD5());
ASSERT_EQ(42u, att.GetUncompressedSize());
ASSERT_EQ(CompressionType_Zlib, att.GetCompressionType());
ASSERT_TRUE(index_->LookupAttachment(att, a[6], FileContentType_Dicom));
ASSERT_EQ("world", att.GetUuid());
ASSERT_EQ(44u, att.GetCompressedSize());
ASSERT_EQ("md5", att.GetUncompressedMD5());
ASSERT_EQ("md5", att.GetCompressedMD5());
ASSERT_EQ(44u, att.GetUncompressedSize());
ASSERT_EQ(CompressionType_None, att.GetCompressionType());
ASSERT_EQ(0u, listener_->deletedFiles_.size());
ASSERT_EQ(0u, listener_->deletedResources_.size());
CheckTableRecordCount(7, "Resources");
CheckTableRecordCount(3, "AttachedFiles");
CheckTableRecordCount(1, "Metadata");
CheckTableRecordCount(1, "MainDicomTags");
index_->DeleteResource(a[0]);
ASSERT_EQ(5u, listener_->deletedResources_.size());
ASSERT_EQ(2u, listener_->deletedFiles_.size());
ASSERT_FALSE(std::find(listener_->deletedFiles_.begin(),
listener_->deletedFiles_.end(),
"my json file") == listener_->deletedFiles_.end());
ASSERT_FALSE(std::find(listener_->deletedFiles_.begin(),
listener_->deletedFiles_.end(),
"my dicom file") == listener_->deletedFiles_.end());
CheckTableRecordCount(2, "Resources");
CheckTableRecordCount(0, "Metadata");
CheckTableRecordCount(1, "AttachedFiles");
CheckTableRecordCount(0, "MainDicomTags");
index_->DeleteResource(a[5]);
ASSERT_EQ(7u, listener_->deletedResources_.size());
CheckTableRecordCount(0, "Resources");
CheckTableRecordCount(0, "AttachedFiles");
CheckTableRecordCount(2, "GlobalProperties");
ASSERT_EQ(3u, listener_->deletedFiles_.size());
ASSERT_FALSE(std::find(listener_->deletedFiles_.begin(),
listener_->deletedFiles_.end(),
"world") == listener_->deletedFiles_.end());
}