Logo Search packages:      
Sourcecode: inkscape version File versions

bool buildtool::MakeBase::parseFileSet ( Element *  elem,
MakeBase propRef,
FileSet fileSet 
) [protected, inherited]

Parse a <fileset> entry, and determine which files should be included

Definition at line 4009 of file buildtool.cpp.

References buildtool::MakeBase::error(), buildtool::MakeBase::getAttribute(), buildtool::MakeBase::parsePatternSet(), buildtool::FileSet::setDirectory(), buildtool::FileSet::setExcludes(), and buildtool::FileSet::setIncludes().

{
    String name = elem->getName();
    if (name != "fileset")
        {
        error("expected <fileset>");
        return false;
        }


    std::vector<String> includes;
    std::vector<String> excludes;

    //A fileset has one implied patternset
    if (!parsePatternSet(elem, propRef, includes, excludes))
        {
        return false;
        }
    //Look for child tags, including more patternsets
    std::vector<Element *> children  = elem->getChildren();
    for (unsigned int i=0 ; i<children.size() ; i++)
        {
        Element *child = children[i];
        String tagName = child->getName();
        if (tagName == "patternset")
            {
            if (!parsePatternSet(child, propRef, includes, excludes))
                {
                return false;
                }
            }
        }

    String dir;
    //Now do the stuff
    //Get the base directory for reading file names
    if (!propRef.getAttribute(elem, "dir", dir))
        return false;

    fileSet.setDirectory(dir);
    fileSet.setIncludes(includes);
    fileSet.setExcludes(excludes);
    
    /*
    std::vector<String> fileList;
    if (dir.size() > 0)
        {
        String baseDir = propRef.resolve(dir);
        if (!listFiles(baseDir, "", includes, excludes, fileList))
            return false;
        }
    std::sort(fileList.begin(), fileList.end());
    result = fileList;
    */

    
    /*
    for (unsigned int i=0 ; i<result.size() ; i++)
        {
        trace("RES:%s", result[i].c_str());
        }
    */

    
    return true;
}


Generated by  Doxygen 1.6.0   Back to index