diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Data.cpp | 12 | ||||
| -rw-r--r-- | src/plist.c | 10 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/Data.cpp b/src/Data.cpp index c4709f7..a96fc50 100644 --- a/src/Data.cpp +++ b/src/Data.cpp | |||
| @@ -34,7 +34,7 @@ Data::Data(plist_t node, Node* parent) : Node(node, parent) | |||
| 34 | 34 | ||
| 35 | Data::Data(const PList::Data& d) : Node(PLIST_DATA) | 35 | Data::Data(const PList::Data& d) : Node(PLIST_DATA) |
| 36 | { | 36 | { |
| 37 | std::vector<uint8_t> b = d.GetValue(); | 37 | std::vector<char> b = d.GetValue(); |
| 38 | plist_set_data_val(_node, &b[0], b.size()); | 38 | plist_set_data_val(_node, &b[0], b.size()); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| @@ -45,7 +45,7 @@ Data& Data::operator=(const PList::Data& b) | |||
| 45 | return *this; | 45 | return *this; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | Data::Data(const std::vector<uint8_t>& buff) : Node(PLIST_DATA) | 48 | Data::Data(const std::vector<char>& buff) : Node(PLIST_DATA) |
| 49 | { | 49 | { |
| 50 | plist_set_data_val(_node, &buff[0], buff.size()); | 50 | plist_set_data_val(_node, &buff[0], buff.size()); |
| 51 | } | 51 | } |
| @@ -59,17 +59,17 @@ Node* Data::Clone() const | |||
| 59 | return new Data(*this); | 59 | return new Data(*this); |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | void Data::SetValue(const std::vector<uint8_t>& buff) | 62 | void Data::SetValue(const std::vector<char>& buff) |
| 63 | { | 63 | { |
| 64 | plist_set_data_val(_node, &buff[0], buff.size()); | 64 | plist_set_data_val(_node, &buff[0], buff.size()); |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | std::vector<uint8_t> Data::GetValue() const | 67 | std::vector<char> Data::GetValue() const |
| 68 | { | 68 | { |
| 69 | uint8_t* buff = NULL; | 69 | char* buff = NULL; |
| 70 | uint64_t length = 0; | 70 | uint64_t length = 0; |
| 71 | plist_get_data_val(_node, &buff, &length); | 71 | plist_get_data_val(_node, &buff, &length); |
| 72 | std::vector<uint8_t> ret(buff, buff + length); | 72 | std::vector<char> ret(buff, buff + length); |
| 73 | delete buff; | 73 | delete buff; |
| 74 | return ret; | 74 | return ret; |
| 75 | } | 75 | } |
diff --git a/src/plist.c b/src/plist.c index d1b0b5a..a425466 100644 --- a/src/plist.c +++ b/src/plist.c | |||
| @@ -544,7 +544,7 @@ plist_t plist_new_real(double val) | |||
| 544 | return plist_new_node(data); | 544 | return plist_new_node(data); |
| 545 | } | 545 | } |
| 546 | 546 | ||
| 547 | plist_t plist_new_data(const uint8_t *val, uint64_t length) | 547 | plist_t plist_new_data(const char *val, uint64_t length) |
| 548 | { | 548 | { |
| 549 | plist_data_t data = plist_new_plist_data(); | 549 | plist_data_t data = plist_new_plist_data(); |
| 550 | data->type = PLIST_DATA; | 550 | data->type = PLIST_DATA; |
| @@ -1385,7 +1385,7 @@ void plist_get_real_val(plist_t node, double *val) | |||
| 1385 | assert(length == sizeof(double)); | 1385 | assert(length == sizeof(double)); |
| 1386 | } | 1386 | } |
| 1387 | 1387 | ||
| 1388 | void plist_get_data_val(plist_t node, uint8_t **val, uint64_t * length) | 1388 | void plist_get_data_val(plist_t node, char **val, uint64_t * length) |
| 1389 | { | 1389 | { |
| 1390 | if (!node || !val || !length) | 1390 | if (!node || !val || !length) |
| 1391 | return; | 1391 | return; |
| @@ -1395,7 +1395,7 @@ void plist_get_data_val(plist_t node, uint8_t **val, uint64_t * length) | |||
| 1395 | plist_get_type_and_value(node, &type, (void *) val, length); | 1395 | plist_get_type_and_value(node, &type, (void *) val, length); |
| 1396 | } | 1396 | } |
| 1397 | 1397 | ||
| 1398 | const uint8_t* plist_get_data_ptr(plist_t node, uint64_t* length) | 1398 | const char* plist_get_data_ptr(plist_t node, uint64_t* length) |
| 1399 | { | 1399 | { |
| 1400 | if (!node || !length) | 1400 | if (!node || !length) |
| 1401 | return NULL; | 1401 | return NULL; |
| @@ -1404,7 +1404,7 @@ const uint8_t* plist_get_data_ptr(plist_t node, uint64_t* length) | |||
| 1404 | return NULL; | 1404 | return NULL; |
| 1405 | plist_data_t data = plist_get_data(node); | 1405 | plist_data_t data = plist_get_data(node); |
| 1406 | *length = data->length; | 1406 | *length = data->length; |
| 1407 | return data->buff; | 1407 | return (const char*)data->buff; |
| 1408 | } | 1408 | } |
| 1409 | 1409 | ||
| 1410 | void plist_get_date_val(plist_t node, int32_t * sec, int32_t * usec) | 1410 | void plist_get_date_val(plist_t node, int32_t * sec, int32_t * usec) |
| @@ -1575,7 +1575,7 @@ void plist_set_real_val(plist_t node, double val) | |||
| 1575 | plist_set_element_val(node, PLIST_REAL, &val, sizeof(double)); | 1575 | plist_set_element_val(node, PLIST_REAL, &val, sizeof(double)); |
| 1576 | } | 1576 | } |
| 1577 | 1577 | ||
| 1578 | void plist_set_data_val(plist_t node, const uint8_t *val, uint64_t length) | 1578 | void plist_set_data_val(plist_t node, const char *val, uint64_t length) |
| 1579 | { | 1579 | { |
| 1580 | plist_set_element_val(node, PLIST_DATA, val, length); | 1580 | plist_set_element_val(node, PLIST_DATA, val, length); |
| 1581 | } | 1581 | } |
