本文整理汇总了C++中nglPath::OpenWrite方法的典型用法代码示例。如果您正苦于以下问题:C++ nglPath::OpenWrite方法的具体用法?C++ nglPath::OpenWrite怎么用?C++ nglPath::OpenWrite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nglPath
的用法示例。
在下文中一共展示了nglPath::OpenWrite方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveLanguage
bool nuiTranslator::SaveLanguage(const nglPath& rOutputLanguageFile) const
{
nglOStream* pStream = rOutputLanguageFile.OpenWrite(true);
bool res = SaveLanguage(pStream);
delete pStream;
return res;
}
示例2: GenerateFile
bool ProjectGenerator::GenerateFile(const nglPath& src, const nglPath& dst)
{
uint32 srcsize = (uint32)src.GetSize();
nglIStream* pFile = src.OpenRead();
if (!pFile)
{
nglString msg;
msg.Format(_T("reading input file '%ls'"), src.GetChars());
return MsgError(msg);
}
char* str = new char[srcsize + 1];
pFile->Read(str, srcsize, 1);
str[srcsize] = 0;
delete pFile;
nglString contents(str);
contents.Replace(_T("TemplateApp"), mProjectName);
contents.Replace(_T("../../../nui3"), mNuiRelativeSource.GetPathName());
nglOStream* poFile = dst.OpenWrite(false);
if (!poFile)
{
nglString msg;
msg.Format(_T("writing output file '%ls'"), dst.GetChars());
return MsgError(msg);
}
char* ptr = contents.Export();
poFile->Write(ptr, contents.GetLength(), 1);
delete poFile;
if (ptr)
free(ptr);
NGL_OUT(_T("nui project generator : generated '%ls'\n"), dst.GetChars());
return true;
}
示例3: mpStream
nuiZipWriter::nuiZipWriter(const nglPath& rPath, CreateFlag flag)
: mpStream(rPath.OpenWrite(flag == OverWrite)), mOwnStream(true), mpZip(NULL)
{
Open(flag);
}