WvStreams
wvserialize.cc
1/*
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4 *
5 * Code to serialize and deserialize objects to/from WvBufs.
6 * See wvserialize.h.
7 */
8#include "wvserialize.h"
9
10template <>
11WvString _wv_deserialize<WvString>(WvBuf &buf)
12{
13 unsigned int len = buf.strchr('\0');
14 if (buf.used() < len)
15 return WvString();
16 else
17 return (const char *)buf.get(len);
18}
const T * get(size_t count)
Reads exactly the specified number of elements and returns a pointer to a storage location owned by t...
Definition: wvbufbase.h:114
size_t used() const
Returns the number of elements in the buffer currently available for reading.
Definition: wvbufbase.h:92
Specialization of WvBufBase for unsigned char type buffers intended for use with raw memory buffers.
Definition: wvbuf.h:24
size_t strchr(int ch)
Returns the number of characters that would have to be read to find the first instance of the charact...
WvString is an implementation of a simple and efficient printable-string class.
Definition: wvstring.h:330