get_FileName Method

WRAPPER_API const BmgChar *get_FileName() const

 

Description

The get_FileName method returns the path and name of the base data source file that is currently loaded into the DataSource.  If get_IsLoaded returns false, then this method will return an empty string.

 

Example

void DataSource_getFileName(GEOCALCPBW_NAMESPACE::DataSource & data)

{

data.set_Editable(TRUE);

_towchar issuer("BMG");

_towchar code("ARCSECONDS");

try

{

data.RemoveAngularUnit(issuer.c_str(), code.c_str());

}

catch(GEOCALCPBW_NAMESPACE::GeoCalcException & ex)

{

if(ex.get_ErrorCode() == GEOCALCPBW_NAMESPACE::GeoCalcException::Code::IdentifierNotFound)

{

AfxMessageBox("RemoveAngularUnit failed: invalid identifiers");

}

}

if(! data.CommitToFile())

{

AfxMessageBox(CString("unable to save data source to ") + CString(_tochar(data.get_FileName()).c_str()));

}

}