KiCad PCB EDA Suite
PROPERTIES Class Reference

A name/value tuple with unique names and optional values. More...

#include <properties.h>

Inheritance diagram for PROPERTIES:

Public Member Functions

bool Clear (const std::string &aProperty)
 
bool Exists (const std::string &aProperty) const
 
bool Value (const char *aName, UTF8 *aFetchedValue=nullptr) const
 Fetch a property by aName and returns true if that property was found, else false. More...
 

Detailed Description

A name/value tuple with unique names and optional values.

The names may be iterated alphabetically.

Definition at line 33 of file properties.h.

Member Function Documentation

◆ Clear()

bool PROPERTIES::Clear ( const std::string &  aProperty)
inline

Definition at line 36 of file properties.h.

37  {
38  return erase( aProperty ) > 0;
39  }

◆ Exists()

bool PROPERTIES::Exists ( const std::string &  aProperty) const
inline

Definition at line 41 of file properties.h.

42  {
43  return count( aProperty ) > 0;
44  }

Referenced by SCH_SEXPR_PLUGIN::isBuffering(), and SCH_LEGACY_PLUGIN::isBuffering().

◆ Value()

bool PROPERTIES::Value ( const char *  aName,
UTF8 aFetchedValue = nullptr 
) const

Fetch a property by aName and returns true if that property was found, else false.

If not found, aFetchedValue is not touched.

Parameters
aNameis the property or option to look for.
aFetchedValueis where to put the value of the property if it exists and aFetchedValue is not NULL.
Returns
true if property is found, else false.

Definition at line 24 of file properties.cpp.

25 {
26  PROPERTIES::const_iterator it = find( aName );
27 
28  if( it != end() )
29  {
30  if( aFetchedValue )
31  *aFetchedValue = it->second;
32 
33  return true;
34  }
35 
36  return false;
37 }

Referenced by EAGLE_PLUGIN::centerBoard(), CADSTAR_PCB_ARCHIVE_PLUGIN::Load(), and DIALOG_FP_PLUGIN_OPTIONS::onListBoxItemSelected().


The documentation for this class was generated from the following files: