IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8281


Ignore:
Timestamp:
Aug 10, 2006, 3:30:36 PM (20 years ago)
Author:
jhoblitt
Message:

fully implement -rawimfile

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/regtool.c

    r8280 r8281  
    537537static bool rawimfileMode(pxConfig *config)
    538538{
     539    PS_ASSERT_PTR_NON_NULL(config, false);
     540
     541    psArray *rawImfiles = rawImfileSelectRowObjects(config->dbh, config->where, 0);
     542    if (!rawImfiles) {
     543        psError(PS_ERR_UNKNOWN, false, "no rawImfile rows found");
     544        return false;
     545    }
     546    bool simple = false;
     547    {
     548        bool status = false;
     549        simple = psMetadataLookupBool(&status, config->args, "-simple");
     550        if (!status) {
     551            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");
     552            return false;
     553        }
     554    }
     555
     556    if (psArrayLength(rawImfiles)) {
     557        // negative simple so the default is true
     558        if (!rawImfilePrintObjects(stdout, rawImfiles, !simple)) {
     559            psError(PS_ERR_UNKNOWN, false, "failed to print array");
     560            psFree(rawImfiles);
     561            return false;
     562        }
     563    }
     564
     565    psFree(rawImfiles);
     566
    539567    return true;
    540568}
  • trunk/ippTools/src/regtoolConfig.c

    r8280 r8281  
    129129    psMetadataAddStr(rawimfileArgs, PS_LIST_TAIL, "-class_id",  0,
    130130        "search by class ID", NULL);
    131 
     131    psMetadataAddBool(rawimfileArgs, PS_LIST_TAIL, "-simple",  0,
     132        "use the simple output format", false);
    132133
    133134#define PXTOOL_MODE(option, modeval, argset) \
Note: See TracChangeset for help on using the changeset viewer.