#define XERR
#include "zipcheck.ih"

void ZipCheck::exerciseDir(string const &dirname)   // name w/o final /
{
    if (dirname.find_first_not_of("0123456789") != string::npos)
    {
        err() << dirname << "/: exercise directories must be numeric\n";
        return;
    }

    size_t preLength = chdir(dirname);  // go to the exercise dir
                                        // prelength: path length before chdir
    d_dir = dirname + '/';
    d_path.clear();                     // used by, e.g., chdir

    if (d_orderTxt.read(d_dir, stoul(dirname))) // order.txt must be valid
        inspectExerciseDir();       // if so, inspect the dir's content
        
    cdParent(preLength);                // back to the parent dir
}
