KiCad PCB EDA Suite
STRING_UTF8_MAP Class Reference

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

#include <string_utf8_map.h>

Inheritance diagram for STRING_UTF8_MAP:

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 string_utf8_map.h.

Member Function Documentation

◆ Clear()

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

Definition at line 36 of file string_utf8_map.h.

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

◆ Exists()

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

Definition at line 41 of file string_utf8_map.h.

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

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

◆ Value()

bool STRING_UTF8_MAP::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 string_utf8_map.cpp.

25{
26 STRING_UTF8_MAP::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}

References find.

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: