forked from cztomczak/cef2go
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcefResponse.c
80 lines (54 loc) · 2.34 KB
/
cefResponse.c
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
// Copyright (c) 2014 The cef2go authors. All rights reserved.
// License: BSD 3-clause.
// Website: https://github.com/fromkeith/cef2go
#include "_cgo_export.h"
#include "cefBase.h"
#include "include/capi/cef_response_capi.h"
int cef_response_t_is_read_only(struct _cef_response_t* self) {
return self->is_read_only(self);
}
int cef_response_t_get_status(struct _cef_response_t* self) {
return self->get_status(self);
}
void cef_response_t_set_status(struct _cef_response_t* self, int status) {
self->set_status(self, status);
}
cef_string_utf8_t * cef_response_t_get_status_text(struct _cef_response_t* self) {
cef_string_t * str = self->get_status_text(self);
cef_string_utf8_t * out = cefStringToUtf8(str);
cef_string_userfree_free(str);
return out;
}
void cef_response_t_set_status_text(struct _cef_response_t* self, char* statusText) {
cef_string_t * statusTextCef = cef_string_userfree_utf16_alloc();
cef_string_from_utf8(statusText, strlen(statusText), statusTextCef);
self->set_status_text(self, statusTextCef);
cef_string_userfree_utf16_free(statusTextCef);
}
cef_string_utf8_t * cef_response_t_get_mime_type(struct _cef_response_t* self) {
cef_string_t * str = self->get_mime_type(self);
cef_string_utf8_t * out = cefStringToUtf8(str);
cef_string_userfree_free(str);
return out;
}
void cef_response_t_set_mime_type(struct _cef_response_t* self, char* mimeType) {
cef_string_t * mimeTypeCef = cef_string_userfree_utf16_alloc();
cef_string_from_utf8(mimeType, strlen(mimeType), mimeTypeCef);
self->set_mime_type(self, mimeTypeCef);
cef_string_userfree_utf16_free(mimeTypeCef);
}
cef_string_utf8_t * cef_response_t_get_header(struct _cef_response_t* self, char* name) {
cef_string_t * nameCef = cef_string_userfree_utf16_alloc();
cef_string_from_utf8(name, strlen(name), nameCef);
cef_string_t * str = self->get_header(self, nameCef);
cef_string_utf8_t * out = cefStringToUtf8(str);
cef_string_userfree_free(str);
cef_string_userfree_utf16_free(nameCef);
return out;
}
void cef_response_t_get_header_map(struct _cef_response_t* self, cef_string_multimap_t headerMap) {
self->get_header_map(self, headerMap);
}
void cef_response_t_set_header_map(struct _cef_response_t* self, cef_string_multimap_t headerMap) {
self->set_header_map(self, headerMap);
}