Skip to content

Commit 7b4b124

Browse files
committed
Apply rule of 5 for *ParserInterface classes
1 parent d3e5408 commit 7b4b124

File tree

15 files changed

+70
-0
lines changed

15 files changed

+70
-0
lines changed

src/code.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ class CCodeParser : public CodeParserInterface
2929
{
3030
public:
3131
CCodeParser();
32+
CCodeParser(const CCodeParser &) = delete;
33+
CCodeParser &operator=(CCodeParser &) = delete;
34+
CCodeParser(CCodeParser &&) = delete;
35+
CCodeParser &operator=(CCodeParser &&) = delete;
3236
virtual ~CCodeParser();
3337
void parseCode(OutputCodeList &codeOutIntf,
3438
const QCString &scopeName,

src/debug.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ class DebugLex
8787
{
8888
public:
8989
DebugLex(Debug::DebugMask mask,const char *lexName,const char *fileName);
90+
DebugLex(const DebugLex &) = delete;
91+
DebugLex &operator=(DebugLex &) = delete;
92+
DebugLex(DebugLex &&) = delete;
93+
DebugLex &operator=(DebugLex &&) = delete;
9094
~DebugLex();
9195
static void print(Debug::DebugMask mask,const char *state,const char *lexName,const char *fileName);
9296
private:

src/fortrancode.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class FortranCodeParser : public CodeParserInterface
3030
{
3131
public:
3232
FortranCodeParser(FortranFormat format=FortranFormat_Unknown);
33+
FortranCodeParser(const FortranCodeParser &) = delete;
34+
FortranCodeParser &operator=(FortranCodeParser &) = delete;
35+
FortranCodeParser(FortranCodeParser &&) = delete;
36+
FortranCodeParser &operator=(FortranCodeParser &&) = delete;
3337
virtual ~FortranCodeParser();
3438
void parseCode(OutputCodeList &codeOutIntf,
3539
const QCString &scopeName,

src/fortranscanner.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ class FortranOutlineParser : public OutlineParserInterface
2828
{
2929
public:
3030
FortranOutlineParser(FortranFormat format=FortranFormat_Unknown);
31+
FortranOutlineParser(const FortranOutlineParser &) = delete;
32+
FortranOutlineParser &operator=(FortranOutlineParser &) = delete;
33+
FortranOutlineParser(FortranOutlineParser &&) = delete;
34+
FortranOutlineParser &operator=(FortranOutlineParser &&) = delete;
3135
~FortranOutlineParser();
3236
void parseInput(const QCString &fileName,
3337
const char *fileBuf,

src/lexcode.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class LexCodeParser : public CodeParserInterface
3030
{
3131
public:
3232
LexCodeParser();
33+
LexCodeParser(const LexCodeParser &) = delete;
34+
LexCodeParser &operator=(LexCodeParser &) = delete;
35+
LexCodeParser(LexCodeParser &&) = delete;
36+
LexCodeParser &operator=(LexCodeParser &&) = delete;
3337
virtual ~LexCodeParser();
3438
void parseCode(OutputCodeList &codeOutIntf,
3539
const QCString &scopeName,

src/lexscanner.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ class LexOutlineParser : public OutlineParserInterface
2828
{
2929
public:
3030
LexOutlineParser();
31+
LexOutlineParser(const LexOutlineParser &) = delete;
32+
LexOutlineParser &operator=(LexOutlineParser &) = delete;
33+
LexOutlineParser(LexOutlineParser &&) = delete;
34+
LexOutlineParser &operator=(LexOutlineParser &&) = delete;
3135
~LexOutlineParser();
3236
void parseInput(const QCString &fileName,
3337
const char *fileBuf,

src/markdown.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ class Markdown
3232
{
3333
public:
3434
Markdown(const QCString &fileName,int lineNr,int indentLevel=0);
35+
Markdown(const Markdown &) = delete;
36+
Markdown &operator=(Markdown &) = delete;
37+
Markdown(Markdown &&) = delete;
38+
Markdown &operator=(Markdown &&) = delete;
3539
~Markdown();
3640
QCString process(const QCString &input, int &startNewlines, bool fromParseInput = false);
3741
QCString extractPageTitle(QCString &docs, QCString &id, int &prepend, bool &isIdGenerated);
@@ -46,6 +50,10 @@ class MarkdownOutlineParser : public OutlineParserInterface
4650
{
4751
public:
4852
MarkdownOutlineParser();
53+
MarkdownOutlineParser(const MarkdownOutlineParser &) = delete;
54+
MarkdownOutlineParser &operator=(MarkdownOutlineParser &) = delete;
55+
MarkdownOutlineParser(MarkdownOutlineParser &&) = delete;
56+
MarkdownOutlineParser &operator=(MarkdownOutlineParser &&) = delete;
4957
virtual ~MarkdownOutlineParser();
5058
void parseInput(const QCString &fileName,
5159
const char *fileBuf,

src/parserintf.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ class ClangTUParser;
4040
class OutlineParserInterface
4141
{
4242
public:
43+
OutlineParserInterface() = default;
44+
OutlineParserInterface(const OutlineParserInterface &) = delete;
45+
OutlineParserInterface &operator=(const OutlineParserInterface &) = delete;
46+
OutlineParserInterface(OutlineParserInterface &&) = delete;
47+
OutlineParserInterface &operator=(OutlineParserInterface &&) = delete;
4348
virtual ~OutlineParserInterface() = default;
4449

4550
/** Parses a single input file with the goal to build an Entry tree.
@@ -81,6 +86,11 @@ class OutlineParserInterface
8186
class CodeParserInterface
8287
{
8388
public:
89+
CodeParserInterface() = default;
90+
CodeParserInterface(const CodeParserInterface &) = delete;
91+
CodeParserInterface &operator=(const CodeParserInterface &) = delete;
92+
CodeParserInterface(CodeParserInterface &&) = delete;
93+
CodeParserInterface &operator=(CodeParserInterface &&) = delete;
8494
virtual ~CodeParserInterface() = default;
8595

8696
/** Parses a source file or fragment with the goal to produce

src/pycode.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ class PythonCodeParser : public CodeParserInterface
3434
{
3535
public:
3636
PythonCodeParser();
37+
PythonCodeParser(const PythonCodeParser &) = delete;
38+
PythonCodeParser &operator=(PythonCodeParser &) = delete;
39+
PythonCodeParser(PythonCodeParser &&) = delete;
40+
PythonCodeParser &operator=(PythonCodeParser &&) = delete;
3741
virtual ~PythonCodeParser();
3842
void parseCode(OutputCodeList &codeOutIntf,
3943
const QCString &scopeName,

src/pyscanner.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ class PythonOutlineParser : public OutlineParserInterface
3535
{
3636
public:
3737
PythonOutlineParser();
38+
PythonOutlineParser(const PythonOutlineParser &) = delete;
39+
PythonOutlineParser &operator=(PythonOutlineParser &) = delete;
40+
PythonOutlineParser(PythonOutlineParser &&) = delete;
41+
PythonOutlineParser &operator=(PythonOutlineParser &&) = delete;
3842
virtual ~PythonOutlineParser();
3943
void parseInput(const QCString &fileName,
4044
const char *fileBuf,

0 commit comments

Comments
 (0)