当前位置: 首页>>代码示例>>C++>>正文


C++ Owned::directoryFiles方法代码示例

本文整理汇总了C++中Owned::directoryFiles方法的典型用法代码示例。如果您正苦于以下问题:C++ Owned::directoryFiles方法的具体用法?C++ Owned::directoryFiles怎么用?C++ Owned::directoryFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Owned的用法示例。


在下文中一共展示了Owned::directoryFiles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: loadFromDirectory

void SafePluginMap::loadFromDirectory(const char * pluginDirectory)
{
    const char * mask = "*" SharedObjectExtension;
    
    Owned<IFile> pluginDir = createIFile(pluginDirectory);
    Owned<IDirectoryIterator> pluginFiles = pluginDir->directoryFiles(mask,false,false);
    ForEach(*pluginFiles)
    {
        const char *thisPlugin = pluginFiles->query().queryFilename();
        StringBuffer tail;
        splitFilename(thisPlugin, NULL, NULL, &tail, &tail);
        addPlugin(thisPlugin, tail.str());
    }
}
开发者ID:hhy5277,项目名称:HPCC-Platform,代码行数:14,代码来源:thorplugin.cpp

示例2: addFilename

bool addFilename(StringAttrArray &names,const char *name,bool sub)
{
    if (isWild(name)) {
        StringBuffer dir;
        const char *tail = splitDirTail(name,dir);
        if (isWild(dir.str())) {
            printf("Directory %s - cannot be wild!\n",dir.str());
            return false;
        }
        Owned<IFile> dirf = createIFile(dir.str());
        Owned<IDirectoryIterator> iter = dirf->directoryFiles(tail,sub,false);
        StringBuffer subname;
        ForEach(*iter) {
            subname.clear().append(iter->query().queryFilename());
            names.append(*new StringAttrItem(subname.str()));
        }
    }
    else 
开发者ID:bolaria,项目名称:HPCC-Platform,代码行数:18,代码来源:combine.cpp

示例3: appendBuildSetFromPlugins

void CConfigHelper::appendBuildSetFromPlugins()
{
    const char *pMask = "*";

    StringBuffer strPath(this->m_strConfigXMLDir);
    strPath.append(STANDARD_CONFIG_CONFIGXML_DIR).append(STANDARD_CONFIG_PLUGIN_DIR_NAME);

    if (this->m_cbDeployment.get() != NULL)
    {
        this->m_cbDeployment->printStatus(STATUS_NORMAL, NULL, NULL, NULL,
                                  "Appending plugins to buildset %s", this->m_strBuildSetFilePath.str());
    }

    Owned<IFile> pluginRootDir = createIFile(strPath.str());

    if (checkFileExists(strPath.str()) == false)
    {
        if (m_cbDeployment.get() != NULL)
        {
            m_cbDeployment->printStatus(STATUS_WARN, NULL, NULL, NULL,
                                      "Could not find plugin directory at %s", strPath.str());
        }
        return;
    }

    Owned<IDirectoryIterator> pluginFiles = pluginRootDir->directoryFiles(pMask, false, true);

    ForEach(*pluginFiles)
    {
        if (pluginFiles->query().isDirectory() == foundYes)
        {
            StringBuffer strPluginBuildSetPath;

            strPluginBuildSetPath.append(pluginFiles->query().queryFilename()).append("/").append(STANDARD_CONFIG_BUILDSETFILE);

            if (checkFileExists(strPluginBuildSetPath.str()) == true)
            {
                StringBuffer strXPath;

                strXPath.appendf("./%s/%s/%s", XML_TAG_PROGRAMS, XML_TAG_BUILD, XML_TAG_BUILDSET);

                Owned<IPropertyTree> pPluginBuildSet = createPTreeFromXMLFile(strPluginBuildSetPath.str());

                if (m_cbDeployment.get() != NULL)
                {
                    m_cbDeployment->printStatus(STATUS_NORMAL, NULL, NULL, NULL,
                                                "Loading plugin BuildSet from  %s", strPluginBuildSetPath.str());
                }

                Owned<IPropertyTreeIterator> pBuildSetIterator = pPluginBuildSet->getElements(strXPath);

                ForEach(*pBuildSetIterator)
                {
                    int nIdx = 1;
                    try
                    {
                        m_pDefBldSet->addPropTree(strXPath.str(), LINK(&(pBuildSetIterator->query())));
                        nIdx++;
                    }
                    catch (IPTreeException *e)
                    {
                        if (m_cbDeployment.get() != NULL)
                        {
                            m_cbDeployment->printStatus(STATUS_ERROR, NULL, NULL, NULL,
                                                        "Error adding buildset with xpath %s[%d] from location %s", strXPath.str(), nIdx, strPluginBuildSetPath.str());
                        }

                        delete e;
                    }
                }
            }
            else
            {
                if (m_cbDeployment != NULL)
开发者ID:BenMJones,项目名称:HPCC-Platform,代码行数:74,代码来源:confighelper.cpp


注:本文中的Owned::directoryFiles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。