KiCad PCB EDA Suite
string_utf8_map.h
Go to the documentation of this file.
1#ifndef _PROPERTIES_H_
2#define _PROPERTIES_H_
3
4/*
5 * This program source code file is part of KICAD, a free EDA CAD application.
6 *
7 * Copyright (C) 2016 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
8 * Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License along
21 * with this program. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24#include <string>
25#include <map>
26#include <utf8.h>
27
28
33class STRING_UTF8_MAP : public std::map< std::string, UTF8 >
34{
35public:
36 bool Clear( const std::string& aProperty )
37 {
38 return erase( aProperty ) > 0;
39 }
40
41 bool Exists( const std::string& aProperty ) const
42 {
43 return count( aProperty ) > 0;
44 }
45
55 bool Value( const char* aName, UTF8* aFetchedValue = nullptr ) const;
56};
57
58#endif // _PROPERTIES_H_
59
60// LocalWords: aName aFetchedValue
A name/value tuple with unique names and optional values.
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.
bool Clear(const std::string &aProperty)
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
Definition: utf8.h:71