Skip to content

Commit

Permalink
Remove unused code from CDCDataStream
Browse files Browse the repository at this point in the history
  • Loading branch information
Daft-Freak committed Jan 29, 2021
1 parent cdc246b commit 38c8d4f
Showing 1 changed file with 0 additions and 68 deletions.
68 changes: 0 additions & 68 deletions 32blit-stm32/Inc/CDCDataStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,6 @@
#include <streambuf>
#include <istream>

class CDCMemBuffer : public std::basic_streambuf<char>
{
public:
CDCMemBuffer(const uint8_t *pData, size_t uLen)
{
setg((char*)pData, (char*)pData, (char*)pData + uLen);
}

void SetData(const uint8_t *pData, size_t uLen)
{
setg((char*)pData, (char*)pData, (char*)pData + uLen);
}
};

class CDCMemoryStream : public std::istream
{
public:
CDCMemoryStream(const uint8_t *pData = NULL , size_t uLen = 0) : std::istream(&m_buffer), m_buffer(pData, uLen)
{
rdbuf(&m_buffer);
}

void SetData(const uint8_t *pData, size_t uLen)
{
clear();
m_buffer.SetData(pData, uLen);
rdbuf(&m_buffer);
}
private:
CDCMemBuffer m_buffer;
};


class CDCDataStream
{
public:
Expand All @@ -68,41 +35,6 @@ class CDCDataStream
return m_uLen;
}


bool GetMemoryStream(CDCMemoryStream &ms)
{
bool bResult = false;

uint8_t *pData;
uint32_t uLen;
if(uLen)
{
ms.SetData(pData, uLen);
bResult = true;
}

return bResult;
}


bool GetStreamData(uint8_t **ppData, uint32_t *puLen)
{
bool bResult = true;

if(m_uLen)
{
*ppData = m_pData;
*puLen = m_uLen;
m_uLen = 0;
}
else
{
bResult = false;
}

return bResult;
}

bool GetDataOfLength(void *pData, uint8_t uLen)
{
bool bResult = false;
Expand Down

0 comments on commit 38c8d4f

Please sign in to comment.