Skip to content

Commit 15ebb02

Browse files
committed
Added some missing explicit overrides. Removed redundant semicolons
1 parent 265b3c8 commit 15ebb02

19 files changed

+97
-100
lines changed

src/Client.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,25 @@ class Client : public CefApp,
4646
// Get the number of running job processes
4747
unsigned int GetProcessCount() {
4848
return m_processCount;
49-
};
49+
}
5050

5151
void SetStopAfterLastJob(bool flag) {
5252
m_stopAfterLastJob = flag;
53-
};
53+
}
5454

5555
void SetDisableJavaScript(bool flag) {
5656
m_browserSettings.javascript = flag ? STATE_DISABLED : STATE_ENABLED;
57-
};
57+
}
5858

5959
void SetAllowedSchemes(const std::set<std::string>& schemes) {
6060
for (auto s: schemes) {
6161
m_requestHandler->AddAllowedScheme(s);
6262
}
63-
};
63+
}
6464

6565
void ClearAllowedSchemes() {
6666
m_requestHandler->ClearAllowedSchemes();
67-
};
67+
}
6868

6969
// CefApp methods:
7070
virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() override;
@@ -124,7 +124,7 @@ class Client : public CefApp,
124124
CefRefPtr<RequestHandler> m_requestHandler;
125125

126126
// Include the default reference counting implementation.
127-
IMPLEMENT_REFCOUNTING(Client);
127+
IMPLEMENT_REFCOUNTING(Client)
128128
};
129129

130130
} // namespace cefpdf

src/Job/ContentProvider.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,32 @@ class ContentProvider : public Visitor
1414
{
1515

1616
public:
17-
ContentProvider() {};
17+
ContentProvider() {}
1818

1919
CefRefPtr<CefStreamReader> GetStreamReader() const {
2020
return m_reader;
21-
};
21+
}
2222

23-
virtual void visit(CefRefPtr<Local> job) {
23+
virtual void visit(CefRefPtr<Local> job) override {
2424
m_reader = CefStreamReader::CreateForData(
2525
static_cast<void*>(const_cast<char*>(job->GetContent().c_str())),
2626
job->GetContent().size()
2727
);
28-
};
28+
}
2929

30-
virtual void visit(CefRefPtr<Remote> job) {
30+
virtual void visit(CefRefPtr<Remote> job) override {
3131
// no implementation
32-
};
32+
}
3333

34-
virtual void visit(CefRefPtr<StdInput> job) {
34+
virtual void visit(CefRefPtr<StdInput> job) override {
3535
m_reader = CefStreamReader::CreateForHandler(new StdInputStreamReader);
36-
};
36+
}
3737

3838
private:
3939
CefRefPtr<CefStreamReader> m_reader;
4040

4141
// Include the default reference counting implementation.
42-
IMPLEMENT_REFCOUNTING(ContentProvider);
42+
IMPLEMENT_REFCOUNTING(ContentProvider)
4343
};
4444

4545
} // namespace job

src/Job/Job.h

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,27 @@ namespace job {
1414

1515
class Job : public CefBaseRefCounted
1616
{
17+
1718
public:
1819
Job();
1920

2021
std::future<std::string> GetFuture() {
2122
return m_promise.get_future();
22-
};
23+
}
2324

2425
void Resolve(std::string value) {
2526
m_promise.set_value(value);
26-
};
27+
}
2728

2829
virtual void accept(CefRefPtr<Visitor> visitor) = 0;
2930

3031
const CefString& GetOutputPath() const {
3132
return m_outputPath;
32-
};
33+
}
3334

3435
void SetOutputPath(const CefString& outputPath) {
3536
m_outputPath = outputPath;
36-
};
37+
}
3738

3839
void SetPageSize(const CefString& pageSize);
3940

@@ -55,7 +56,7 @@ class Job : public CefBaseRefCounted
5556
std::promise<std::string> m_promise;
5657

5758
// Include the default reference counting implementation.
58-
IMPLEMENT_REFCOUNTING(Job);
59+
IMPLEMENT_REFCOUNTING(Job)
5960
};
6061

6162
} // namespace job

src/Job/Loader.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@ class Loader : public Visitor
1717

1818
public:
1919
Loader(CefRefPtr<CefFrame> frame) :
20-
m_frame(frame) {};
20+
m_frame(frame) {}
2121

22-
virtual void visit(CefRefPtr<Local> job) {
22+
virtual void visit(CefRefPtr<Local> job) override {
2323
m_frame->LoadURL(cefpdf::constants::scheme + "://local");
24-
};
24+
}
2525

26-
virtual void visit(CefRefPtr<Remote> job) {
26+
virtual void visit(CefRefPtr<Remote> job) override {
2727
m_frame->LoadURL(job->GetUrl());
28-
};
28+
}
2929

30-
virtual void visit(CefRefPtr<StdInput> job) {
30+
virtual void visit(CefRefPtr<StdInput> job) override {
3131
m_frame->LoadURL(cefpdf::constants::scheme + "://stdin");
32-
};
32+
}
3333

3434
private:
3535
CefRefPtr<CefFrame> m_frame;
3636

3737
// Include the default reference counting implementation.
38-
IMPLEMENT_REFCOUNTING(Loader);
38+
IMPLEMENT_REFCOUNTING(Loader)
3939
};
4040

4141
} // namespace job

src/Job/Local.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ class Local : public Job
1010
{
1111

1212
public:
13-
Local(const std::string& content) : Job(), m_content(content) {};
13+
Local(const std::string& content) : Job(), m_content(content) {}
1414

1515
virtual const std::string& GetContent() const {
1616
return m_content;
17-
};
17+
}
1818

1919
void SetContent(const std::string& content) {
2020
m_content = content;
21-
};
21+
}
2222

23-
virtual void accept(CefRefPtr<Visitor> visitor) {
23+
virtual void accept(CefRefPtr<Visitor> visitor) override {
2424
visitor->visit(this);
25-
};
25+
}
2626

2727
private:
2828
std::string m_content;
2929

3030
// Include the default reference counting implementation.
31-
IMPLEMENT_REFCOUNTING(Local);
31+
IMPLEMENT_REFCOUNTING(Local)
3232
};
3333

3434
} // namespace job

src/Job/Manager.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Manager : public CefBaseRefCounted
1818
public:
1919
typedef CefLoadHandler::ErrorCode ErrorCode;
2020

21-
Manager() {};
21+
Manager() {}
2222

2323
std::size_t Queue(CefRefPtr<Job> job);
2424

@@ -52,7 +52,7 @@ class Manager : public CefBaseRefCounted
5252
unsigned int m_counter = 0;
5353

5454
// Include the default reference counting implementation.
55-
IMPLEMENT_REFCOUNTING(Manager);
55+
IMPLEMENT_REFCOUNTING(Manager)
5656
};
5757

5858
} // namespace job

src/Job/Printer.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,39 @@ class Printer : public Visitor,
1717
public:
1818
Printer(CefRefPtr<Manager> manager, CefRefPtr<CefBrowser> browser) :
1919
m_manager(manager),
20-
m_browser(browser) {};
20+
m_browser(browser) {}
2121

2222
void Print(CefRefPtr<Job> job) {
2323
m_browser->GetHost()->PrintToPDF(
2424
job->GetOutputPath(),
2525
job->GetCefPdfPrintSettings(),
2626
this
2727
);
28-
};
28+
}
2929

30-
virtual void visit(CefRefPtr<Local> job) {
30+
virtual void visit(CefRefPtr<Local> job) override {
3131
Print(job.get());
32-
};
32+
}
3333

34-
virtual void visit(CefRefPtr<Remote> job) {
34+
virtual void visit(CefRefPtr<Remote> job) override {
3535
Print(job.get());
36-
};
36+
}
3737

38-
virtual void visit(CefRefPtr<StdInput> job) {
38+
virtual void visit(CefRefPtr<StdInput> job) override {
3939
Print(job.get());
4040
}
4141

4242
// CefPdfPrintCallback methods:
4343
void OnPdfPrintFinished(const CefString& path, bool ok) override {
4444
m_manager->Finish(m_browser, path, ok);
45-
};
45+
}
4646

4747
private:
4848
CefRefPtr<Manager> m_manager;
4949
CefRefPtr<CefBrowser> m_browser;
5050

5151
// Include the default reference counting implementation.
52-
IMPLEMENT_REFCOUNTING(Printer);
52+
IMPLEMENT_REFCOUNTING(Printer)
5353
};
5454

5555
} // namespace job

src/Job/Remote.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ class Remote : public Job
1111

1212
public:
1313
Remote(const CefString& url) :
14-
Job(), m_url(url) {};
14+
Job(), m_url(url) {}
1515

1616
const CefString& GetUrl() const {
1717
return m_url;
18-
};
18+
}
1919

20-
virtual void accept(CefRefPtr<Visitor> visitor) {
20+
virtual void accept(CefRefPtr<Visitor> visitor) override {
2121
visitor->visit(this);
22-
};
22+
}
2323

2424
private:
2525
CefString m_url;
2626

2727
// Include the default reference counting implementation.
28-
IMPLEMENT_REFCOUNTING(Remote);
28+
IMPLEMENT_REFCOUNTING(Remote)
2929
};
3030

3131
} // namespace job

src/Job/StdInput.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ class StdInput : public Job
1010
{
1111

1212
public:
13-
virtual void accept(CefRefPtr<Visitor> visitor) {
13+
virtual void accept(CefRefPtr<Visitor> visitor) override {
1414
visitor->visit(this);
15-
};
15+
}
1616

1717
private:
18-
1918
// Include the default reference counting implementation.
20-
IMPLEMENT_REFCOUNTING(StdInput);
19+
IMPLEMENT_REFCOUNTING(StdInput)
2120
};
2221

2322
} // namespace job

src/Job/StdInputStreamReader.h

+12-14
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,39 @@
77
#include <cstdio>
88
#include <string>
99
#include <iostream>
10-
#include <algorithm>
1110

1211
namespace cefpdf {
1312
namespace job {
1413

1514
class StdInputStreamReader : public CefReadHandler
1615
{
17-
public:
1816

19-
StdInputStreamReader() : m_initialized(false) {};
17+
public:
18+
StdInputStreamReader() : m_initialized(false) {}
2019

2120
void Initialize();
2221

23-
virtual int Eof() {
22+
virtual int Eof() override {
2423
return std::cin.eof() ? 1 : 0;
25-
};
24+
}
2625

27-
virtual bool MayBlock() {
26+
virtual bool MayBlock() override {
2827
return true;
29-
};
28+
}
3029

31-
virtual std::size_t Read(void* ptr, std::size_t size, std::size_t n);
30+
virtual std::size_t Read(void* ptr, std::size_t size, std::size_t n) override;
3231

33-
virtual int Seek(int64 offset, int whence);
32+
virtual int Seek(int64 offset, int whence) override;
3433

35-
virtual int64 Tell() {
34+
virtual int64 Tell() override {
3635
return std::cin.tellg();
37-
};
38-
39-
private:
36+
}
4037

38+
private:
4139
bool m_initialized;
4240

4341
// Include the default reference counting implementation.
44-
IMPLEMENT_REFCOUNTING(StdInputStreamReader);
42+
IMPLEMENT_REFCOUNTING(StdInputStreamReader)
4543
};
4644

4745
} // namespace job

src/Job/Visitor.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ class Visitor : public CefBaseRefCounted
1414
{
1515

1616
public:
17-
Visitor() {};
17+
Visitor() {}
1818

1919
virtual void visit(CefRefPtr<Local>) = 0;
2020
virtual void visit(CefRefPtr<Remote>) = 0;
2121
virtual void visit(CefRefPtr<StdInput>) = 0;
2222

2323
private:
2424
// Include the default reference counting implementation.
25-
IMPLEMENT_REFCOUNTING(Visitor);
25+
IMPLEMENT_REFCOUNTING(Visitor)
2626
};
2727

2828
} // namespace job

src/PrintHandler.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ namespace cefpdf {
77

88
class PrintHandler : public CefPrintHandler
99
{
10-
public:
1110

11+
public:
1212
PrintHandler();
1313

1414
// CefPrintHandler methods:
@@ -37,10 +37,9 @@ class PrintHandler : public CefPrintHandler
3737

3838
virtual void OnPrintStart(CefRefPtr<CefBrowser> browser) override;
3939

40-
private:
41-
40+
private:
4241
// Include the default reference counting implementation.
43-
IMPLEMENT_REFCOUNTING(PrintHandler);
42+
IMPLEMENT_REFCOUNTING(PrintHandler)
4443
};
4544

4645
} // namespace cefpdf

0 commit comments

Comments
 (0)