DataStream  1.8.8
DataStream : framework to save/load/serialize/deserialize data
DataStream< char *, DataStreamMode::WRITE, char > Struct Reference

How to write char in a message. More...

#include <data_stream_message.h>

Static Public Member Functions

static bool data_stream (char *&ds, char &data)
 Save the char in the message. More...
 
static bool data_stream (char *&ds, char *data, size_t nbElement)
 Save the char in the message. More...
 

Detailed Description

How to write char in a message.

Definition at line 35 of file data_stream_message.h.

Member Function Documentation

◆ data_stream() [1/2]

bool DataStream< char *, DataStreamMode::WRITE, char >::data_stream ( char *&  ds,
char &  data 
)
static

Save the char in the message.

Parameters
[out]ds: message to be written
data: data to be saved in the message
Returns
true on success, false otherwise

Definition at line 91 of file data_stream_message.cpp.

91  {
92  const char* srcByte = (const char*)&data;
93  memcpy(ds, srcByte, sizeof(char));
94  ds += sizeof(char);
95  return true;
96 }

◆ data_stream() [2/2]

bool DataStream< char *, DataStreamMode::WRITE, char >::data_stream ( char *&  ds,
char *  data,
size_t  nbElement 
)
static

Save the char in the message.

Parameters
[out]ds: message to be written
data: data to be saved in the message
nbElement: number of element of the data
Returns
true on success, false otherwise

Definition at line 104 of file data_stream_message.cpp.

104  {
105  const char* srcByte = (const char*)data;
106  memcpy(ds, srcByte, sizeof(char)*nbElement);
107  ds += sizeof(char)*nbElement;
108  return true;
109 }

The documentation for this struct was generated from the following files: