Panda3D
stringStream.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file stringStream.cxx
10  * @author drose
11  * @date 2007-07-03
12  */
13 
14 #include "stringStream.h"
15 
16 /**
17  * Replaces the contents of the data stream. This implicitly reseeks to 0.
18  */
19 void StringStream::
20 set_data(const unsigned char *data, size_t size) {
21  _buf.clear();
22  vector_uchar pv;
23  pv.insert(pv.end(), data, data + size);
24  _buf.swap_data(pv);
25 }
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void clear()
Empties the buffer.
set_data
Replaces the contents of the data stream.
Definition: stringStream.h:42
void swap_data(vector_uchar &data)
Swaps the indicated buffer for the contents of the internal buffer.