本文整理汇总了C++中Path::Absolute方法的典型用法代码示例。如果您正苦于以下问题:C++ Path::Absolute方法的具体用法?C++ Path::Absolute怎么用?C++ Path::Absolute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Path
的用法示例。
在下文中一共展示了Path::Absolute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Flush
YGG_API void FrameStreamWriter::Flush(Path path)
{
if (!path)
throw Exception("FrameStreamWriter: path was empty");
if (!path.IsFile())
throw Exception(Concatenate("FrameStreamWriter: \"", path.Absolute(), "\" is not a valid file path"));
std::ofstream outStream((ystr)path, std::ios::out | std::ios::binary);
if (!outStream)
throw Exception(Concatenate("FrameStreamWriter: \"", path.Absolute(), "\" could not be opened for writing."));
//metadata
if (metadata)
{
Write(outStream, (uint64_t)metadata.Size());
outStream.write((const char*)metadata.Data(), metadata.Size());
}
else
Write(outStream, 0ull);
//total frame count
Write(outStream, currentFrame);
//duration
Write(outStream, duration);
//key frames
Write(outStream, (uint64_t)keyFrames.size()); //key frame count
(outStream).write((const char*)keyFrames.data(), keyFrames.size() * sizeof(uint64_t));
//frame datasets
Write(outStream, (uint64_t)frameData.size()); //frame data stream count
for (auto& fd : frameData)
{
//key hash
Write(outStream, fd.first);
//element size
Write(outStream, fd.second->ElementSize);
//frames
Write(outStream, (uint64_t)fd.second->Frames.size());
for (size_t i = 0u; i < fd.second->Frames.size(); ++i)
{
//frame number
Write(outStream, fd.second->Frames[i]);
//data
(outStream).write((const char*)fd.second->Data[i], fd.second->ElementSize);
}
}
outStream.close();
}
示例2: FrameStreamReader
YGG_API FrameStreamReader::FrameStreamReader(Path path)
{
if (!path)
throw Exception("FrameStreamReader: path was empty");
if (!path.IsExtantFile())
throw Exception(Concatenate(YL("The path \""), path.Absolute(), "\" did not exist."));
file.reset(new MappedFile(path));
data = (uint8_t*)file->Data();
Initialize();
}