make PROPERTIES::Value() not inline

This commit is contained in:
Dick Hollenbeck 2013-11-02 14:49:46 -05:00
parent 42ef7f6215
commit 5f329b472b
3 changed files with 21 additions and 11 deletions

View File

@ -167,7 +167,7 @@ void BOARD::Move( const wxPoint& aMoveVector ) // overload
// PCB_PAD_T,
// PCB_MODULE_TEXT_T,
PCB_MODULE_T,
PCB_ZONE_AREA_T, // if it is visible on screen, it should be selectable
PCB_ZONE_AREA_T,
EOT
};

View File

@ -42,6 +42,21 @@
#define FMT_NOTFOUND _( "Plugin type '%s' is not found." )
// is there a better place for this function?
bool PROPERTIES::Value( const char* aName, std::string* aFetchedValue ) const
{
PROPERTIES::const_iterator it = find( aName );
if( it != end() )
{
if( aFetchedValue )
*aFetchedValue = it->second;
return true;
}
return false;
}
// Some day plugins might be in separate DLL/DSOs, simply because of numbers of them
// and code size. Until then, use the simplest method:

View File

@ -48,17 +48,12 @@ public:
* Function Value
* fetches a property by aName and returns true if that property was found, else false.
* If not found, aFetchedValue is not touched.
* @param aName is the property or option to look for.
* @param aFetchedValue is where to put the value of the property if it
* exists and aFetchedValue is not NULL.
* @return bool - true if property is found, else false.
*/
bool Value( const char* aName, std::string* aFetchedValue ) const
{
PROPERTIES::const_iterator it = find( aName );
if( it != end() )
{
*aFetchedValue = it->second;
return true;
}
return false;
}
bool Value( const char* aName, std::string* aFetchedValue = NULL ) const;
};