diff options
Diffstat (limited to 'AudioManagerDaemon/src/CAmDltWrapper.cpp')
-rw-r--r-- | AudioManagerDaemon/src/CAmDltWrapper.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/AudioManagerDaemon/src/CAmDltWrapper.cpp b/AudioManagerDaemon/src/CAmDltWrapper.cpp index 968f911..fc7e064 100644 --- a/AudioManagerDaemon/src/CAmDltWrapper.cpp +++ b/AudioManagerDaemon/src/CAmDltWrapper.cpp @@ -105,9 +105,10 @@ void CAmDltWrapper::send() dlt_user_log_write_finish(&mDltContextData); #else if(mEnableNoDLTDebug) - std::cout << "[" << mDltContext.contextID << "] " << std::string(mDltContextData.buffer) << std::endl; + std::cout << "[" << mDltContext.contextID << "] " << mDltContextData.buffer.str().c_str() << std::endl; - mDltContextData.size = 0; + mDltContextData.buffer.str(""); + mDltContextData.buffer.clear(); #endif } @@ -170,8 +171,7 @@ void CAmDltWrapper::append(const char*& value) #ifdef WITH_DLT dlt_user_log_write_string(&mDltContextData, value); #else - memcpy((mDltContextData.buffer+mDltContextData.size),value,strlen(value)); - mDltContextData.size += strlen(value); + mDltContextData.buffer << value; #endif } @@ -180,8 +180,7 @@ void CAmDltWrapper::append(const std::string& value) #ifdef WITH_DLT dlt_user_log_write_string(&mDltContextData, value.c_str()); #else - memcpy((mDltContextData.buffer+mDltContextData.size),value.c_str(),value.size()); - mDltContextData.size += value.size(); + mDltContextData.buffer << value; #endif } @@ -197,11 +196,7 @@ void CAmDltWrapper::append(const bool value) #ifndef WITH_DLT template<class T> void CAmDltWrapper::appendNoDLT(T value) { - if((mDltContextData.size + sizeof(value)) < DLT_USER_BUF_MAX_SIZE) - { - memcpy((mDltContextData.buffer+mDltContextData.size),&(value),sizeof(value)); - mDltContextData.size += sizeof(value); - } + mDltContextData.buffer << value; } void CAmDltWrapper::enableNoDLTDebug(const bool enableNoDLTDebug) |