]> git.tdb.fi Git - libs/core.git/blob - source/utils.cpp
8ce5bf327edb21b76a1f5874cb3dcb28c3a314f5
[libs/core.git] / source / utils.cpp
1 /* $Id$
2
3 This file is part of libmspio
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7 #include "base.h"
8 #include "utils.h"
9
10 namespace Msp {
11 namespace IO {
12
13 unsigned read_all(Base &obj, char *buf, unsigned size)
14 {
15         unsigned pos=0;
16         while(pos<size)
17                 pos+=obj.read(buf+pos, size-pos);
18
19         return pos;
20 }
21
22 } // namespace IO
23 } // namespace Msp