MCPcopy Create free account
hub / github.com/Kitware/ParaView / ParseString

Method ParseString

Remoting/ClientServerStream/vtkClientServerStream.cxx:1754–1777  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1752
1753//----------------------------------------------------------------------------
1754unsigned char* vtkClientServerStream::ParseString(
1755 int order, unsigned char* data, unsigned char* end)
1756{
1757 // Read the string length.
1758 vtkTypeUInt32 length;
1759 if (data > end - sizeof(length))
1760 {
1761 /* ERROR */
1762 return nullptr;
1763 }
1764 this->PerformByteSwap(order, data, 1, sizeof(length));
1765 memcpy(&length, data, sizeof(length));
1766 data += sizeof(length);
1767
1768 // Skip the string data. It does not need swapping.
1769 if (data > end - length)
1770 {
1771 /* ERROR */
1772 return nullptr;
1773 }
1774
1775 // Return the position after the string.
1776 return data + length;
1777}
1778
1779//----------------------------------------------------------------------------
1780unsigned char* vtkClientServerStream::ParseStream(

Callers 1

ParseDataMethod · 0.95

Calls 1

PerformByteSwapMethod · 0.95

Tested by

no test coverage detected