summaryrefslogtreecommitdiff
path: root/implementation/message
diff options
context:
space:
mode:
Diffstat (limited to 'implementation/message')
-rw-r--r--implementation/message/include/deserializer.hpp3
-rw-r--r--implementation/message/include/message_base_impl.hpp4
-rw-r--r--implementation/message/include/message_header_impl.hpp2
-rw-r--r--implementation/message/include/payload_impl.hpp2
-rw-r--r--implementation/message/src/deserializer.cpp11
5 files changed, 17 insertions, 5 deletions
diff --git a/implementation/message/include/deserializer.hpp b/implementation/message/include/deserializer.hpp
index 7449f9b..4c01c79 100644
--- a/implementation/message/include/deserializer.hpp
+++ b/implementation/message/include/deserializer.hpp
@@ -29,7 +29,7 @@ public:
VSOMEIP_EXPORT std::size_t get_available() const;
VSOMEIP_EXPORT std::size_t get_remaining() const;
- VSOMEIP_EXPORT void set_remaining(std::size_t _length);
+ VSOMEIP_EXPORT void set_remaining(std::size_t _remaining);
// to be used by applications to deserialize a message
VSOMEIP_EXPORT message * deserialize_message();
@@ -41,6 +41,7 @@ public:
VSOMEIP_EXPORT bool deserialize(uint32_t& _value,
bool _omit_last_byte = false);
VSOMEIP_EXPORT bool deserialize(uint8_t *_data, std::size_t _length);
+ VSOMEIP_EXPORT bool deserialize(std::string& _target, std::size_t _length);
VSOMEIP_EXPORT bool deserialize(std::vector<uint8_t>& _value);
VSOMEIP_EXPORT bool look_ahead(std::size_t _index, uint8_t &_value) const;
diff --git a/implementation/message/include/message_base_impl.hpp b/implementation/message/include/message_base_impl.hpp
index ad42261..efd5ffe 100644
--- a/implementation/message/include/message_base_impl.hpp
+++ b/implementation/message/include/message_base_impl.hpp
@@ -42,10 +42,10 @@ public:
VSOMEIP_EXPORT void set_session(session_t _session);
VSOMEIP_EXPORT protocol_version_t get_protocol_version() const;
- VSOMEIP_EXPORT void set_protocol_version(protocol_version_t _version);
+ VSOMEIP_EXPORT void set_protocol_version(protocol_version_t _protocol_version);
VSOMEIP_EXPORT interface_version_t get_interface_version() const;
- VSOMEIP_EXPORT void set_interface_version(interface_version_t _version);
+ VSOMEIP_EXPORT void set_interface_version(interface_version_t _interface_version);
VSOMEIP_EXPORT message_type_e get_message_type() const;
VSOMEIP_EXPORT void set_message_type(message_type_e _type);
diff --git a/implementation/message/include/message_header_impl.hpp b/implementation/message/include/message_header_impl.hpp
index 5768bbe..8cd4b00 100644
--- a/implementation/message/include/message_header_impl.hpp
+++ b/implementation/message/include/message_header_impl.hpp
@@ -18,7 +18,7 @@ class message_base;
class message_header_impl: virtual public serializable {
public:
VSOMEIP_EXPORT message_header_impl();
- VSOMEIP_EXPORT message_header_impl(const message_header_impl& header);
+ VSOMEIP_EXPORT message_header_impl(const message_header_impl& _header);
VSOMEIP_EXPORT bool serialize(serializer *_to) const;
VSOMEIP_EXPORT bool deserialize(deserializer *_from);
diff --git a/implementation/message/include/payload_impl.hpp b/implementation/message/include/payload_impl.hpp
index f9b05a2..2eb67e9 100644
--- a/implementation/message/include/payload_impl.hpp
+++ b/implementation/message/include/payload_impl.hpp
@@ -18,7 +18,7 @@ class payload_impl: public payload {
public:
VSOMEIP_EXPORT payload_impl();
VSOMEIP_EXPORT payload_impl(const byte_t *_data, uint32_t _size);
- VSOMEIP_EXPORT payload_impl(const std::vector< byte_t > &_value);
+ VSOMEIP_EXPORT payload_impl(const std::vector< byte_t > &_data);
VSOMEIP_EXPORT payload_impl(const payload_impl& _payload);
VSOMEIP_EXPORT virtual ~payload_impl();
diff --git a/implementation/message/src/deserializer.cpp b/implementation/message/src/deserializer.cpp
index 8a3c891..b416199 100644
--- a/implementation/message/src/deserializer.cpp
+++ b/implementation/message/src/deserializer.cpp
@@ -111,6 +111,17 @@ bool deserializer::deserialize(uint8_t *_data, std::size_t _length) {
return true;
}
+bool deserializer::deserialize(std::string& _target, std::size_t _length) {
+ if (_length > remaining_ || _length > _target.capacity()) {
+ return false;
+ }
+ _target.assign(position_, position_ + _length);
+ position_ += _length;
+ remaining_ -= _length;
+
+ return true;
+}
+
bool deserializer::deserialize(std::vector< uint8_t >& _value) {
if (_value.capacity() > remaining_)
return false;