Panda3D
|
00001 // Filename: ramfile.h 00002 // Created by: mike (09Jan97) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef RAMFILE_H 00016 #define RAMFILE_H 00017 00018 #include "pandabase.h" 00019 #include "typedef.h" 00020 #include "referenceCount.h" 00021 00022 //////////////////////////////////////////////////////////////////// 00023 // Class : Ramfile 00024 // Description : An in-memory buffer specifically designed for 00025 // downloading files to memory. 00026 //////////////////////////////////////////////////////////////////// 00027 class EXPCL_PANDAEXPRESS Ramfile { 00028 PUBLISHED: 00029 INLINE Ramfile(); 00030 00031 INLINE void seek(size_t pos); 00032 INLINE size_t tell() const; 00033 string read(size_t length); 00034 string readline(); 00035 00036 INLINE const string &get_data() const; 00037 INLINE size_t get_data_size() const; 00038 INLINE void clear(); 00039 00040 public: 00041 size_t _pos; 00042 string _data; 00043 }; 00044 00045 #include "ramfile.I" 00046 00047 #endif