本文整理汇总了C++中FilePtr::get方法的典型用法代码示例。如果您正苦于以下问题:C++ FilePtr::get方法的具体用法?C++ FilePtr::get怎么用?C++ FilePtr::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FilePtr
的用法示例。
在下文中一共展示了FilePtr::get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateMemoryFile
HEFFECT D3DCore_Impl::Effect_Load(const WCHAR *filename, DWORD size)
{
if(m_bSilent) return 0;
DWORD _size;
FilePtr pf;
SampleSource* SSource = NULL;
void *data;
if(m_pADevice)
{
if(size) { data=(void *)filename; _size=size; }
else
{
data=File_Load(filename, &_size);
if(!data) return NULL;
}
pf = CreateMemoryFile(data, _size);
if(pf.get() != NULL) {
SSource = OpenSampleSource( pf.get() );
if(!SSource) {
System_Log(L"[AUDIERE - ERROR] %s - Can't create sound effect", filename);
}
SSource->ref();
}
if(!size) File_Free(data);
return (HEFFECT)SSource;
}
else return 0;
}
示例2: WriteAppx
void WriteAppx(
const FilePtr &zip,
const std::unordered_map<std::string, std::string> &fileNames,
const std::string *certPath, int compressionLevel, bool isBundle)
{
FileSink zipRawSink(zip.get());
OffsetSink zipOffsetSink;
auto zipSink = MakeMultiSink(zipRawSink, zipOffsetSink);
std::vector<ZIPFileEntry> zipFileEntries;
std::pair<std::string, std::string> appxBundleManifest;
APPXDigests digests;
// Write and hash the ZIP content.
{
SHA256Sink axpcSink;
auto sink = MakeMultiSink(zipSink, axpcSink);
for (const auto &fileNamePair : fileNames) {
const std::string &archiveName = fileNamePair.first;
const std::string &fileName = fileNamePair.second;
const std::string suffix = "AppxBundleManifest.xml";
if (isBundle &&
suffix.size() < archiveName.size() &&
std::equal(suffix.rbegin(), suffix.rend(), archiveName.rbegin())) {
appxBundleManifest = fileNamePair;
continue;
}
zipFileEntries.emplace_back(
WriteZIPFileEntry(sink, zipOffsetSink.Offset(), fileName,
archiveName, compressionLevel));
}
if (isBundle) {
ZIPFileEntry appxBundleManifestEntry = WriteAppxBundleManifestZIPFileEntry(
sink,
zipOffsetSink.Offset(),
appxBundleManifest.second,
appxBundleManifest.first, compressionLevel,
zipFileEntries);
zipFileEntries.emplace_back(std::move(appxBundleManifestEntry));
}
// this creates AppxBlockMap.xml file
ZIPFileEntry blockMap = WriteAppxBlockMapZIPFileEntry(
sink, zipOffsetSink.Offset(), zipFileEntries, isBundle);
digests.axbm = blockMap.sha256;
zipFileEntries.emplace_back(std::move(blockMap));
// this creates [Content_Types].xml
ZIPFileEntry contentTypes = WriteContentTypesZIPFileEntry(
sink, zipOffsetSink.Offset(), isBundle, zipFileEntries);
digests.axct = contentTypes.sha256;
zipFileEntries.emplace_back(std::move(contentTypes));
digests.axpc = axpcSink.SHA256();
}
// Hash (but do not write) the directory, pre-signature.
{
SHA256Sink axcdSink;
OffsetSink tmpOffsetSink = zipOffsetSink;
auto sink = MakeMultiSink(axcdSink, tmpOffsetSink);
for (const ZIPFileEntry &entry : zipFileEntries) {
entry.WriteDirectoryEntry(sink);
}
WriteZIPEndOfCentralDirectoryRecord(sink, tmpOffsetSink.Offset(),
zipFileEntries);
digests.axcd = axcdSink.SHA256();
}
// Sign and write the signature.
if (certPath) {
zipFileEntries.emplace_back(WriteSignature(
zipSink, *certPath, digests, zipOffsetSink.Offset()));
}
// Write the directory.
for (const ZIPFileEntry &entry : zipFileEntries) {
entry.WriteDirectoryEntry(zipSink);
}
WriteZIPEndOfCentralDirectoryRecord(zipSink, zipOffsetSink.Offset(),
zipFileEntries);
}
示例3: load
bool Material::load(const FilePtr& file)
{
return load(file.get());
}
示例4: fromFile
MaterialPtr Material::fromFile(const FilePtr& file)
{
return fromFile(file.get());
}
示例5: parseFile
TiXmlDocument XmlUtils::parseFile(const FilePtr& file)
{
return parseFile(file.get());
}
示例6: loadFileLines
std::vector<std::string> FileUtils::loadFileLines(const FilePtr& file, bool includeEolMarker)
{
return loadFileLines(file.get(), includeEolMarker);
}
示例7: loadFile
std::vector<char> FileUtils::loadFile(const FilePtr& file)
{
return loadFile(file.get());
}