cwDynRefTbl.h/cpp : Added new create() from file constructor.
This commit is contained in:
parent
7c645d6af9
commit
a7b80e841a
@ -119,6 +119,27 @@ cw::rc_t cw::dyn_ref_tbl::create( handle_t& hRef, const object_t* cfg )
|
||||
return rc;
|
||||
}
|
||||
|
||||
cw::rc_t cw::dyn_ref_tbl::create( handle_t& hRef, const char* cfg_fname )
|
||||
{
|
||||
rc_t rc;
|
||||
object_t* cfg = nullptr;
|
||||
|
||||
if((rc = objectFromFile( cfg_fname, cfg )) != kOkRC )
|
||||
{
|
||||
cwLogError(rc,"Dynamics reference table parse cfg. parse failed on '%s'.",cwStringNullGuard(cfg_fname));
|
||||
goto errLabel;
|
||||
}
|
||||
|
||||
rc = create(hRef,cfg);
|
||||
|
||||
errLabel:
|
||||
cfg->free();
|
||||
|
||||
return rc;
|
||||
|
||||
}
|
||||
|
||||
|
||||
cw::rc_t cw::dyn_ref_tbl::destroy( handle_t& hRef )
|
||||
{
|
||||
rc_t rc = kOkRC;
|
||||
|
@ -17,6 +17,8 @@ namespace cw
|
||||
|
||||
// Parse object like: [ { mark:<> level:<>, vel:<> } ]
|
||||
rc_t create( handle_t& hRef, const object_t* cfg );
|
||||
rc_t create( handle_t& hRef, const char* cfg_fname );
|
||||
|
||||
rc_t destroy( handle_t& hRef );
|
||||
|
||||
const char* level_to_marker( handle_t h, unsigned level );
|
||||
|
Loading…
Reference in New Issue
Block a user