本文整理汇总了C++中IOobject::caseName方法的典型用法代码示例。如果您正苦于以下问题:C++ IOobject::caseName方法的具体用法?C++ IOobject::caseName怎么用?C++ IOobject::caseName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOobject
的用法示例。
在下文中一共展示了IOobject::caseName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Foam::fileName Foam::fileOperations::masterFileOperation::filePath
(
const bool checkGlobal,
const IOobject& io,
pathType& searchType,
word& newInstancePath
)
{
newInstancePath = word::null;
if (io.instance().isAbsolute())
{
fileName objectPath = io.instance()/io.name();
if (Foam::isFile(objectPath))
{
searchType = fileOperation::ABSOLUTE;
return objectPath;
}
else
{
searchType = fileOperation::NOTFOUND;
return fileName::null;
}
}
else
{
fileName path = io.path();
fileName objectPath = path/io.name();
if (Foam::isFile(objectPath))
{
searchType = fileOperation::OBJECT;
return objectPath;
}
else
{
if
(
checkGlobal
&& io.time().processorCase()
&& (
io.instance() == io.time().system()
|| io.instance() == io.time().constant()
)
)
{
fileName parentObjectPath =
io.rootPath()/io.time().globalCaseName()
/io.instance()/io.db().dbDir()/io.local()/io.name();
if (Foam::isFile(parentObjectPath))
{
searchType = fileOperation::PARENTOBJECT;
return parentObjectPath;
}
}
//- The big problem with findInstance is that it itself needs file
// access through the fileHandler. Since this routine is only called on the
// master we'll get a deadlock.
// if (!Foam::isDir(path))
// {
// newInstancePath = io.time().findInstancePath
// (
// instant(io.instance())
// );
//
// if (newInstancePath.size())
// {
// fileName fName
// (
// io.rootPath()/io.caseName()
// /newInstancePath/io.db().dbDir()/io.local()/io.name()
// );
//
// if (Foam::isFile(fName))
// {
// searchType = fileOperation::FINDINSTANCE;
// return fName;
// }
// }
// }
// Try constant & local
{
newInstancePath = io.time().constant();
fileName fName
(
io.rootPath()
/io.caseName()
/newInstancePath
/io.db().dbDir()
/io.local()
/io.name()
);
//DebugVar(fName);
if (Foam::isFile(fName))
{
searchType = fileOperation::FINDINSTANCE;
//.........这里部分代码省略.........
示例2: processorsPath
Foam::fileName Foam::fileOperations::masterFileOperation::objectPath
(
const IOobject& io,
const pathType& searchType,
const word& instancePath
)
{
// Replacement for IOobject::objectPath()
switch (searchType)
{
case fileOperation::ABSOLUTE:
{
return io.instance()/io.name();
}
break;
case fileOperation::OBJECT:
{
return io.path()/io.name();
}
break;
case fileOperation::PROCESSORSOBJECT:
{
return processorsPath(io, io.instance())/io.name();
}
break;
case fileOperation::PARENTOBJECT:
{
return
io.rootPath()/io.time().globalCaseName()
/io.instance()/io.db().dbDir()/io.local()/io.name();
}
break;
case fileOperation::FINDINSTANCE:
{
return
io.rootPath()/io.caseName()
/instancePath/io.db().dbDir()/io.local()/io.name();
}
break;
case fileOperation::PROCESSORSFINDINSTANCE:
{
return processorsPath(io, instancePath)/io.name();
}
break;
case fileOperation::NOTFOUND:
{
return fileName::null;
}
break;
default:
{
NotImplemented;
return fileName::null;
}
}
}