Commit 5f329b47 authored by Dick Hollenbeck's avatar Dick Hollenbeck

make PROPERTIES::Value() not inline

parent 42ef7f62
......@@ -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
};
......
......@@ -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:
......
......@@ -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;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment