本文整理汇总了C++中FileHandle::open方法的典型用法代码示例。如果您正苦于以下问题:C++ FileHandle::open方法的具体用法?C++ FileHandle::open怎么用?C++ FileHandle::open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileHandle
的用法示例。
在下文中一共展示了FileHandle::open方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dumpInput
//===----------------------------------------------------------------------===//
// Testcases
//===----------------------------------------------------------------------===//
TEST_F(ReadStageTest, quake) {
mcld::sys::fs::Path top_level = TOPDIR;
// set up output
m_pLinker->config()->output().setType(mcld::Output::DynObj);
m_pLinker->setOutput(top_level + "unittests/plasma.so");
// set up input
m_pLinker->addObject(top_level + "test/libs/ARM/Android/android-14/crtbegin_so.o");
m_pLinker->addObject(top_level + "test/Android/Plasma/ARM/plasma.o");
m_pLinker->addNameSpec("m");
m_pLinker->addNameSpec("log");
m_pLinker->addNameSpec("jnigraphics");
m_pLinker->addNameSpec("c");
m_pLinker->addObject(top_level + "test/libs/ARM/Android/android-14/crtend_so.o");
// dump status
m_pLinker->getDriver()->normalize();
FileHandle file;
file.open(top_level + "unittests/read_stage.xml",
FileHandle::ReadWrite | FileHandle::Create | FileHandle::Truncate, 0644);
InputTree::iterator input, inEnd = m_pLinker->config()->inputs().end();
for (input = m_pLinker->config()->inputs().begin(); input != inEnd; ++input) {
dumpInput(**input, file, 1);
}
dumpOutput(m_pLinker->config()->output(), file, 1);
// dump status
ASSERT_TRUE(m_pLinker->getDriver()->mergeSections());
}
示例2: emit
bool Linker::emit(const std::string& pPath)
{
FileHandle file;
FileHandle::Permission perm = FileHandle::Permission(0x755);
if (!file.open(pPath,
FileHandle::ReadWrite | FileHandle::Truncate | FileHandle::Create,
perm)) {
error(diag::err_cannot_open_output_file) << "Linker::emit()" << pPath;
return false;
}
MemoryArea* output = new MemoryArea(file);
bool result = emit(*output);
delete output;
file.close();
return result;
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_frameworks_compile_mclinker,代码行数:19,代码来源:Linker.cpp
示例3: FileHandle
MemoryArea*
MemoryAreaFactory::produce(const sys::fs::Path& pPath,
FileHandle::OpenMode pMode)
{
HandleToArea::Result map_result = m_HandleToArea.findFirst(pPath);
if (NULL == map_result.area) {
// can not found
FileHandle* handler = new FileHandle();
if (!handler->open(pPath, pMode)) {
error(diag::err_cannot_open_file) << pPath
<< sys::strerror(handler->error());
}
MemoryArea* result = allocate();
new (result) MemoryArea(*handler);
m_HandleToArea.push_back(handler, result);
return result;
}
return map_result.area;
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_frameworks_compile_mclinker,代码行数:22,代码来源:MemoryAreaFactory.cpp