-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathresponse_cpptoc.cc
More file actions
137 lines (110 loc) · 3.51 KB
/
Copy pathresponse_cpptoc.cc
File metadata and controls
137 lines (110 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// A portion of this file was generated by the CEF translator tool. When
// making changes by hand only do so within the body of existing function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/response_cpptoc.h"
#include "libcef_dll/transfer_util.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
int CEF_CALLBACK response_get_status(struct _cef_response_t* self)
{
DCHECK(self);
if(!self)
return 0;
return CefResponseCppToC::Get(self)->GetStatus();
}
void CEF_CALLBACK response_set_status(struct _cef_response_t* self, int status)
{
DCHECK(self);
if(!self)
return;
CefResponseCppToC::Get(self)->SetStatus(status);
}
cef_string_userfree_t CEF_CALLBACK response_get_status_text(
struct _cef_response_t* self)
{
DCHECK(self);
if(!self)
return NULL;
CefString text = CefResponseCppToC::Get(self)->GetStatusText();
return text.DetachToUserFree();
}
void CEF_CALLBACK response_set_status_text(struct _cef_response_t* self,
const cef_string_t* statusText)
{
DCHECK(self);
if(!self)
return;
CefResponseCppToC::Get(self)->SetStatusText(CefString(statusText));
}
cef_string_userfree_t CEF_CALLBACK response_get_mime_type(
struct _cef_response_t* self)
{
DCHECK(self);
if(!self)
return NULL;
CefString text = CefResponseCppToC::Get(self)->GetMimeType();
return text.DetachToUserFree();
}
void CEF_CALLBACK response_set_mime_type(struct _cef_response_t* self,
const cef_string_t* mimeType)
{
DCHECK(self);
if(!self)
return;
CefResponseCppToC::Get(self)->SetMimeType(CefString(mimeType));
}
cef_string_userfree_t CEF_CALLBACK response_get_header(
struct _cef_response_t* self, const cef_string_t* name)
{
DCHECK(self);
if(!self)
return NULL;
CefString text = CefResponseCppToC::Get(self)->GetHeader(CefString(name));
return text.DetachToUserFree();
}
void CEF_CALLBACK response_get_header_map(struct _cef_response_t* self,
cef_string_map_t headerMap)
{
DCHECK(self);
if(!self)
return;
CefResponse::HeaderMap map;
CefResponseCppToC::Get(self)->GetHeaderMap(map);
transfer_string_map_contents(map, headerMap);
}
void CEF_CALLBACK response_set_header_map(struct _cef_response_t* self,
cef_string_map_t headerMap)
{
DCHECK(self);
if(!self)
return;
CefResponse::HeaderMap map;
if(headerMap)
transfer_string_map_contents(headerMap, map);
CefResponseCppToC::Get(self)->SetHeaderMap(map);
}
// CONSTRUCTOR - Do not edit by hand.
CefResponseCppToC::CefResponseCppToC(CefResponse* cls)
: CefCppToC<CefResponseCppToC, CefResponse, cef_response_t>(cls)
{
struct_.struct_.get_status = response_get_status;
struct_.struct_.set_status = response_set_status;
struct_.struct_.get_status_text = response_get_status_text;
struct_.struct_.set_status_text = response_set_status_text;
struct_.struct_.get_mime_type = response_get_mime_type;
struct_.struct_.set_mime_type = response_set_mime_type;
struct_.struct_.get_header = response_get_header;
struct_.struct_.get_header_map = response_get_header_map;
struct_.struct_.set_header_map = response_set_header_map;
}
#ifndef NDEBUG
template<> long CefCppToC<CefResponseCppToC, CefResponse,
cef_response_t>::DebugObjCt = 0;
#endif