cwGutimReg.h/cpp : Added test().

This commit is contained in:
kevin 2024-02-21 07:46:51 -05:00
parent 11350402d4
commit e8e6915990
2 changed files with 29 additions and 2 deletions

View File

@ -183,7 +183,7 @@ cw::rc_t cw::gutim::reg::create( handle_t& hRef, const char* fname )
errLabel:
if(rc != kOkRC )
rc = _destroy(p);
_destroy(p);
destroy(csvH);
@ -248,3 +248,30 @@ void cw::gutim::reg::report( handle_t h )
}
}
cw::rc_t cw::gutim::reg::test( const object_t* cfg )
{
const char* dir = nullptr;
rc_t rc = kOkRC;
handle_t h;
if((rc = cfg->getv("dir",dir)) != kOkRC )
{
rc = cwLogError(rc,"The arg. parse GUTIM registry test.");
goto errLabel;
}
if((rc = create(h,dir)) != kOkRC )
{
rc = cwLogError(rc,"The GUTIM registry create failed.");
goto errLabel;
}
report(h);
errLabel:
destroy(h);
return rc;
}

View File

@ -30,7 +30,7 @@ namespace cw
file_t file_record( handle_t h, unsigned file_idx );
void report( handle_t h );
rc_t test( const object_t* cfg );
}
}