LibrePCB Developers Documentation
librarybaseelementcheckmessages.h
Go to the documentation of this file.
1/*
2 * LibrePCB - Professional EDA for everyone!
3 * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4 * https://librepcb.org/
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef LIBREPCB_CORE_LIBRARYBASEELEMENTCHECKMESSAGES_H
21#define LIBREPCB_CORE_LIBRARYBASEELEMENTCHECKMESSAGES_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../rulecheck/rulecheckmessage.h"
27#include "../types/elementname.h"
28
29#include <QtCore>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35
36/*******************************************************************************
37 * Class MsgMissingAuthor
38 ******************************************************************************/
39
43class MsgMissingAuthor final : public RuleCheckMessage {
44 Q_DECLARE_TR_FUNCTIONS(MsgMissingAuthor)
45
46public:
47 // Constructors / Destructor
48 MsgMissingAuthor() noexcept;
49 MsgMissingAuthor(const MsgMissingAuthor& other) noexcept
50 : RuleCheckMessage(other) {}
51 virtual ~MsgMissingAuthor() noexcept {}
52};
53
54/*******************************************************************************
55 * Class MsgNameNotTitleCase
56 ******************************************************************************/
57
62 Q_DECLARE_TR_FUNCTIONS(MsgNameNotTitleCase)
63
64public:
65 // Constructors / Destructor
67 explicit MsgNameNotTitleCase(const ElementName& name) noexcept;
69 : RuleCheckMessage(other), mName(other.mName) {}
70 virtual ~MsgNameNotTitleCase() noexcept {}
71
72 const ElementName& getName() const noexcept { return mName; }
73 ElementName getFixedName() const noexcept { return getFixedName(mName); }
74
75 static bool isTitleCase(const ElementName& name) noexcept;
76 static ElementName getFixedName(const ElementName& name) noexcept;
77
78private:
80};
81
82/*******************************************************************************
83 * End of File
84 ******************************************************************************/
85
86} // namespace librepcb
87
88#endif
The MsgMissingAuthor class.
Definition: librarybaseelementcheckmessages.h:43
MsgMissingAuthor(const MsgMissingAuthor &other) noexcept
Definition: librarybaseelementcheckmessages.h:49
virtual ~MsgMissingAuthor() noexcept
Definition: librarybaseelementcheckmessages.h:51
MsgMissingAuthor() noexcept
Definition: librarybaseelementcheckmessages.cpp:34
The MsgNameNotTitleCase class.
Definition: librarybaseelementcheckmessages.h:61
static bool isTitleCase(const ElementName &name) noexcept
Definition: librarybaseelementcheckmessages.cpp:57
const ElementName & getName() const noexcept
Definition: librarybaseelementcheckmessages.h:72
MsgNameNotTitleCase(const MsgNameNotTitleCase &other) noexcept
Definition: librarybaseelementcheckmessages.h:68
ElementName mName
Definition: librarybaseelementcheckmessages.h:79
virtual ~MsgNameNotTitleCase() noexcept
Definition: librarybaseelementcheckmessages.h:70
ElementName getFixedName() const noexcept
Definition: librarybaseelementcheckmessages.h:73
The RuleCheckMessage class.
Definition: rulecheckmessage.h:45
Definition: occmodel.cpp:77
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition: elementname.h:84