35 #ifndef ROSBAG_CHUNKED_FILE_H 36 #define ROSBAG_CHUNKED_FILE_H 42 #include <boost/shared_ptr.hpp> 59 void openWrite (std::string
const& filename);
60 void openRead (std::string
const& filename);
61 void openReadWrite(std::string
const& filename);
65 std::string getFileName()
const;
66 uint64_t getOffset()
const;
67 uint32_t getCompressedBytesIn()
const;
75 void write(std::string
const& s);
76 void write(
void* ptr,
size_t size);
77 void read(
void* ptr,
size_t size);
78 std::string getline();
79 bool truncate(uint64_t length);
80 void seek(uint64_t offset,
int origin = std::ios_base::beg);
81 void decompress(
CompressionType compression, uint8_t* dest,
unsigned int dest_len, uint8_t* source,
unsigned int source_len);
88 void open(std::string
const& filename, std::string
const& mode);
ChunkedFile reads and writes files which contain interleaved chunks of compressed and uncompressed da...
void swap(Bag &a, Bag &b)
void swap(ChunkedFile &other)
uint64_t offset_
current position in the file
int nUnused_
number of bytes of extra data read by compressed stream
boost::shared_ptr< StreamFactory > stream_factory_
boost::shared_ptr< Stream > write_stream_
uint64_t compressed_in_
number of bytes written to current compressed stream
std::string filename_
path to file
boost::shared_ptr< Stream > read_stream_
char * unused_
extra data read by compressed stream