Skip to content

Commit 696b8ba

Browse files
Make ctors explicit
1 parent 0579ccd commit 696b8ba

File tree

8 files changed

+20
-19
lines changed

8 files changed

+20
-19
lines changed

src/Faction.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ class Faction
3434
private: // Methods
3535
QMap<GameObject, GameObjectTypes> ParseJsonObject(const QJsonObject& obj);
3636
public:
37-
Faction();
38-
Faction(const QString& _shortName, const QString& _displayName, const QString& _displayNameDescription);
39-
Faction(const QJsonObject& factionAsObject);
37+
explicit Faction();
38+
explicit Faction(const QString& _shortName, const QString& _displayName, const QString& _displayNameDescription);
39+
explicit Faction(const QJsonObject& factionAsObject);
4040

4141
/// @brief Returns short faction name from field `ShortName` of TechTree.json.
4242
const QString GetShortName() const;

src/FactionsManager.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class FactionManager final
1818
void Parse();
1919
public:
2020
/// @brief Default constructor.
21-
FactionManager();
21+
explicit FactionManager();
2222
/// @brief Return count of parsed factions.
2323
int Count();
2424
/// @brief Return faction by its index in container.

src/Logger.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Logger final
2020
std::ofstream LogFile;
2121

2222
public: // Methods
23-
Logger();
23+
explicit Logger();
2424
~Logger();
2525

2626
/// @brief Write [DATE-TIME] and return stream to write other data. Needs to be ended with `endl`

src/Parsers/CSFParser.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ class CSFParser final
5858
std::wstring WharArrayToWstring(const size_t& arrayLength, const wchar_t* pArray) const;
5959

6060
public:
61-
CSFParser();
62-
CSFParser(const std::wstring& strFilePath);
63-
CSFParser(const std::string& strFilePath);
64-
CSFParser(const char* strFilePath);
65-
CSFParser(const QString& strFilePath);
61+
explicit CSFParser();
62+
explicit CSFParser(const std::wstring& strFilePath);
63+
explicit CSFParser(const std::string& strFilePath);
64+
explicit CSFParser(const char* strFilePath);
65+
explicit CSFParser(const QString& strFilePath);
6666

6767
/// @brief Parse .csf file with direct path.
6868
void Parse(const std::wstring& strFilePath);

src/Parsers/GINIParser.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ class GINIParser final
2424
std::vector<GINISection> Sections;
2525

2626
public: // Methods
27-
GINIParser() = delete;
28-
GINIParser(const char* strFileSample);
29-
GINIParser(const std::string& strFileSample);
30-
GINIParser(const QString& strFileSample);
27+
explicit GINIParser() = delete;
28+
explicit GINIParser(const char* strFileSample);
29+
explicit GINIParser(const std::string& strFileSample);
30+
explicit GINIParser(const QString& strFileSample);
3131

3232
/// @brief Save .ini file.
3333
void Save();

src/Parsers/JSONFile.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ class JSONFile final
99
QJsonObject JsonMainObject;
1010

1111
public: // Methods
12-
JSONFile();
13-
JSONFile(const QString& filePath);
14-
JSONFile(const std::string& filePath);
15-
JSONFile(const char* filePath);
12+
expiplicit JSONFile();
13+
expiplicit JSONFile(const QString& filePath);
14+
expiplicit JSONFile(const std::string& filePath);
15+
expiplicit JSONFile(const char* filePath);
1616

1717
/// @brief Returns main object of parsed JSON file
1818
const QJsonObject& GetMainObject() const;

src/Settings.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Settings final
1515
private: // Methods
1616
bool FromQtCheckState(const Qt::CheckState& state);
1717
public:
18-
Settings();
18+
explicit Settings();
1919
~Settings();
2020

2121
/// @brief Set all `Settings` class variables to default values.

src/Windows/Locale.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ namespace Windows
77
class Locale final
88
{
99
public:
10+
Registry() = delete;
1011
/// @brief Returns full locale name by the given partial name (e.g. "en" -> "en-US")
1112
static QString GetFullLocaleName(const QString& partial);
1213
/// @brief Returns English language name (e.g. "en-US" -> "English")

0 commit comments

Comments
 (0)