Commit 15ebb02 1 parent 265b3c8 commit 15ebb02 Copy full SHA for 15ebb02
File tree 19 files changed +97
-100
lines changed
19 files changed +97
-100
lines changed Original file line number Diff line number Diff line change @@ -46,25 +46,25 @@ class Client : public CefApp,
46
46
// Get the number of running job processes
47
47
unsigned int GetProcessCount () {
48
48
return m_processCount;
49
- };
49
+ }
50
50
51
51
void SetStopAfterLastJob (bool flag) {
52
52
m_stopAfterLastJob = flag;
53
- };
53
+ }
54
54
55
55
void SetDisableJavaScript (bool flag) {
56
56
m_browserSettings.javascript = flag ? STATE_DISABLED : STATE_ENABLED;
57
- };
57
+ }
58
58
59
59
void SetAllowedSchemes (const std::set<std::string>& schemes) {
60
60
for (auto s: schemes) {
61
61
m_requestHandler->AddAllowedScheme (s);
62
62
}
63
- };
63
+ }
64
64
65
65
void ClearAllowedSchemes () {
66
66
m_requestHandler->ClearAllowedSchemes ();
67
- };
67
+ }
68
68
69
69
// CefApp methods:
70
70
virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler () override ;
@@ -124,7 +124,7 @@ class Client : public CefApp,
124
124
CefRefPtr<RequestHandler> m_requestHandler;
125
125
126
126
// Include the default reference counting implementation.
127
- IMPLEMENT_REFCOUNTING (Client);
127
+ IMPLEMENT_REFCOUNTING (Client)
128
128
};
129
129
130
130
} // namespace cefpdf
Original file line number Diff line number Diff line change @@ -14,32 +14,32 @@ class ContentProvider : public Visitor
14
14
{
15
15
16
16
public:
17
- ContentProvider () {};
17
+ ContentProvider () {}
18
18
19
19
CefRefPtr<CefStreamReader> GetStreamReader () const {
20
20
return m_reader;
21
- };
21
+ }
22
22
23
- virtual void visit (CefRefPtr<Local> job) {
23
+ virtual void visit (CefRefPtr<Local> job) override {
24
24
m_reader = CefStreamReader::CreateForData (
25
25
static_cast <void *>(const_cast <char *>(job->GetContent ().c_str ())),
26
26
job->GetContent ().size ()
27
27
);
28
- };
28
+ }
29
29
30
- virtual void visit (CefRefPtr<Remote> job) {
30
+ virtual void visit (CefRefPtr<Remote> job) override {
31
31
// no implementation
32
- };
32
+ }
33
33
34
- virtual void visit (CefRefPtr<StdInput> job) {
34
+ virtual void visit (CefRefPtr<StdInput> job) override {
35
35
m_reader = CefStreamReader::CreateForHandler (new StdInputStreamReader);
36
- };
36
+ }
37
37
38
38
private:
39
39
CefRefPtr<CefStreamReader> m_reader;
40
40
41
41
// Include the default reference counting implementation.
42
- IMPLEMENT_REFCOUNTING (ContentProvider);
42
+ IMPLEMENT_REFCOUNTING (ContentProvider)
43
43
};
44
44
45
45
} // namespace job
Original file line number Diff line number Diff line change @@ -14,26 +14,27 @@ namespace job {
14
14
15
15
class Job : public CefBaseRefCounted
16
16
{
17
+
17
18
public:
18
19
Job ();
19
20
20
21
std::future<std::string> GetFuture () {
21
22
return m_promise.get_future ();
22
- };
23
+ }
23
24
24
25
void Resolve (std::string value) {
25
26
m_promise.set_value (value);
26
- };
27
+ }
27
28
28
29
virtual void accept (CefRefPtr<Visitor> visitor) = 0;
29
30
30
31
const CefString& GetOutputPath () const {
31
32
return m_outputPath;
32
- };
33
+ }
33
34
34
35
void SetOutputPath (const CefString& outputPath) {
35
36
m_outputPath = outputPath;
36
- };
37
+ }
37
38
38
39
void SetPageSize (const CefString& pageSize);
39
40
@@ -55,7 +56,7 @@ class Job : public CefBaseRefCounted
55
56
std::promise<std::string> m_promise;
56
57
57
58
// Include the default reference counting implementation.
58
- IMPLEMENT_REFCOUNTING (Job);
59
+ IMPLEMENT_REFCOUNTING (Job)
59
60
};
60
61
61
62
} // namespace job
Original file line number Diff line number Diff line change @@ -17,25 +17,25 @@ class Loader : public Visitor
17
17
18
18
public:
19
19
Loader (CefRefPtr<CefFrame> frame) :
20
- m_frame (frame) {};
20
+ m_frame (frame) {}
21
21
22
- virtual void visit (CefRefPtr<Local> job) {
22
+ virtual void visit (CefRefPtr<Local> job) override {
23
23
m_frame->LoadURL (cefpdf::constants::scheme + " ://local" );
24
- };
24
+ }
25
25
26
- virtual void visit (CefRefPtr<Remote> job) {
26
+ virtual void visit (CefRefPtr<Remote> job) override {
27
27
m_frame->LoadURL (job->GetUrl ());
28
- };
28
+ }
29
29
30
- virtual void visit (CefRefPtr<StdInput> job) {
30
+ virtual void visit (CefRefPtr<StdInput> job) override {
31
31
m_frame->LoadURL (cefpdf::constants::scheme + " ://stdin" );
32
- };
32
+ }
33
33
34
34
private:
35
35
CefRefPtr<CefFrame> m_frame;
36
36
37
37
// Include the default reference counting implementation.
38
- IMPLEMENT_REFCOUNTING (Loader);
38
+ IMPLEMENT_REFCOUNTING (Loader)
39
39
};
40
40
41
41
} // namespace job
Original file line number Diff line number Diff line change @@ -10,25 +10,25 @@ class Local : public Job
10
10
{
11
11
12
12
public:
13
- Local (const std::string& content) : Job(), m_content(content) {};
13
+ Local (const std::string& content) : Job(), m_content(content) {}
14
14
15
15
virtual const std::string& GetContent () const {
16
16
return m_content;
17
- };
17
+ }
18
18
19
19
void SetContent (const std::string& content) {
20
20
m_content = content;
21
- };
21
+ }
22
22
23
- virtual void accept (CefRefPtr<Visitor> visitor) {
23
+ virtual void accept (CefRefPtr<Visitor> visitor) override {
24
24
visitor->visit (this );
25
- };
25
+ }
26
26
27
27
private:
28
28
std::string m_content;
29
29
30
30
// Include the default reference counting implementation.
31
- IMPLEMENT_REFCOUNTING (Local);
31
+ IMPLEMENT_REFCOUNTING (Local)
32
32
};
33
33
34
34
} // namespace job
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class Manager : public CefBaseRefCounted
18
18
public:
19
19
typedef CefLoadHandler::ErrorCode ErrorCode;
20
20
21
- Manager () {};
21
+ Manager () {}
22
22
23
23
std::size_t Queue (CefRefPtr<Job> job);
24
24
@@ -52,7 +52,7 @@ class Manager : public CefBaseRefCounted
52
52
unsigned int m_counter = 0 ;
53
53
54
54
// Include the default reference counting implementation.
55
- IMPLEMENT_REFCOUNTING (Manager);
55
+ IMPLEMENT_REFCOUNTING (Manager)
56
56
};
57
57
58
58
} // namespace job
Original file line number Diff line number Diff line change @@ -17,39 +17,39 @@ class Printer : public Visitor,
17
17
public:
18
18
Printer (CefRefPtr<Manager> manager, CefRefPtr<CefBrowser> browser) :
19
19
m_manager (manager),
20
- m_browser (browser) {};
20
+ m_browser (browser) {}
21
21
22
22
void Print (CefRefPtr<Job> job) {
23
23
m_browser->GetHost ()->PrintToPDF (
24
24
job->GetOutputPath (),
25
25
job->GetCefPdfPrintSettings (),
26
26
this
27
27
);
28
- };
28
+ }
29
29
30
- virtual void visit (CefRefPtr<Local> job) {
30
+ virtual void visit (CefRefPtr<Local> job) override {
31
31
Print (job.get ());
32
- };
32
+ }
33
33
34
- virtual void visit (CefRefPtr<Remote> job) {
34
+ virtual void visit (CefRefPtr<Remote> job) override {
35
35
Print (job.get ());
36
- };
36
+ }
37
37
38
- virtual void visit (CefRefPtr<StdInput> job) {
38
+ virtual void visit (CefRefPtr<StdInput> job) override {
39
39
Print (job.get ());
40
40
}
41
41
42
42
// CefPdfPrintCallback methods:
43
43
void OnPdfPrintFinished (const CefString& path, bool ok) override {
44
44
m_manager->Finish (m_browser, path, ok);
45
- };
45
+ }
46
46
47
47
private:
48
48
CefRefPtr<Manager> m_manager;
49
49
CefRefPtr<CefBrowser> m_browser;
50
50
51
51
// Include the default reference counting implementation.
52
- IMPLEMENT_REFCOUNTING (Printer);
52
+ IMPLEMENT_REFCOUNTING (Printer)
53
53
};
54
54
55
55
} // namespace job
Original file line number Diff line number Diff line change @@ -11,21 +11,21 @@ class Remote : public Job
11
11
12
12
public:
13
13
Remote (const CefString& url) :
14
- Job (), m_url(url) {};
14
+ Job (), m_url(url) {}
15
15
16
16
const CefString& GetUrl () const {
17
17
return m_url;
18
- };
18
+ }
19
19
20
- virtual void accept (CefRefPtr<Visitor> visitor) {
20
+ virtual void accept (CefRefPtr<Visitor> visitor) override {
21
21
visitor->visit (this );
22
- };
22
+ }
23
23
24
24
private:
25
25
CefString m_url;
26
26
27
27
// Include the default reference counting implementation.
28
- IMPLEMENT_REFCOUNTING (Remote);
28
+ IMPLEMENT_REFCOUNTING (Remote)
29
29
};
30
30
31
31
} // namespace job
Original file line number Diff line number Diff line change @@ -10,14 +10,13 @@ class StdInput : public Job
10
10
{
11
11
12
12
public:
13
- virtual void accept (CefRefPtr<Visitor> visitor) {
13
+ virtual void accept (CefRefPtr<Visitor> visitor) override {
14
14
visitor->visit (this );
15
- };
15
+ }
16
16
17
17
private:
18
-
19
18
// Include the default reference counting implementation.
20
- IMPLEMENT_REFCOUNTING (StdInput);
19
+ IMPLEMENT_REFCOUNTING (StdInput)
21
20
};
22
21
23
22
} // namespace job
Original file line number Diff line number Diff line change 7
7
#include < cstdio>
8
8
#include < string>
9
9
#include < iostream>
10
- #include < algorithm>
11
10
12
11
namespace cefpdf {
13
12
namespace job {
14
13
15
14
class StdInputStreamReader : public CefReadHandler
16
15
{
17
- public:
18
16
19
- StdInputStreamReader () : m_initialized(false ) {};
17
+ public:
18
+ StdInputStreamReader () : m_initialized(false ) {}
20
19
21
20
void Initialize ();
22
21
23
- virtual int Eof () {
22
+ virtual int Eof () override {
24
23
return std::cin.eof () ? 1 : 0 ;
25
- };
24
+ }
26
25
27
- virtual bool MayBlock () {
26
+ virtual bool MayBlock () override {
28
27
return true ;
29
- };
28
+ }
30
29
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 ;
32
31
33
- virtual int Seek (int64 offset, int whence);
32
+ virtual int Seek (int64 offset, int whence) override ;
34
33
35
- virtual int64 Tell () {
34
+ virtual int64 Tell () override {
36
35
return std::cin.tellg ();
37
- };
38
-
39
- private:
36
+ }
40
37
38
+ private:
41
39
bool m_initialized;
42
40
43
41
// Include the default reference counting implementation.
44
- IMPLEMENT_REFCOUNTING (StdInputStreamReader);
42
+ IMPLEMENT_REFCOUNTING (StdInputStreamReader)
45
43
};
46
44
47
45
} // namespace job
Original file line number Diff line number Diff line change @@ -14,15 +14,15 @@ class Visitor : public CefBaseRefCounted
14
14
{
15
15
16
16
public:
17
- Visitor () {};
17
+ Visitor () {}
18
18
19
19
virtual void visit (CefRefPtr<Local>) = 0;
20
20
virtual void visit (CefRefPtr<Remote>) = 0;
21
21
virtual void visit (CefRefPtr<StdInput>) = 0;
22
22
23
23
private:
24
24
// Include the default reference counting implementation.
25
- IMPLEMENT_REFCOUNTING (Visitor);
25
+ IMPLEMENT_REFCOUNTING (Visitor)
26
26
};
27
27
28
28
} // namespace job
Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ namespace cefpdf {
7
7
8
8
class PrintHandler : public CefPrintHandler
9
9
{
10
- public:
11
10
11
+ public:
12
12
PrintHandler ();
13
13
14
14
// CefPrintHandler methods:
@@ -37,10 +37,9 @@ class PrintHandler : public CefPrintHandler
37
37
38
38
virtual void OnPrintStart (CefRefPtr<CefBrowser> browser) override ;
39
39
40
- private:
41
-
40
+ private:
42
41
// Include the default reference counting implementation.
43
- IMPLEMENT_REFCOUNTING (PrintHandler);
42
+ IMPLEMENT_REFCOUNTING (PrintHandler)
44
43
};
45
44
46
45
} // namespace cefpdf
You can’t perform that action at this time.
0 commit comments