LLVM API Documentation
00001 //===---- llvm/Support/DataStream.h - Lazy bitcode streaming ----*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This header defines DataStreamer, which fetches bytes of data from 00011 // a stream source. It provides support for streaming (lazy reading) of 00012 // data, e.g. bitcode 00013 // 00014 //===----------------------------------------------------------------------===// 00015 00016 00017 #ifndef LLVM_SUPPORT_DATASTREAM_H 00018 #define LLVM_SUPPORT_DATASTREAM_H 00019 00020 #include <string> 00021 00022 namespace llvm { 00023 00024 class DataStreamer { 00025 public: 00026 /// Fetch bytes [start-end) from the stream, and write them to the 00027 /// buffer pointed to by buf. Returns the number of bytes actually written. 00028 virtual size_t GetBytes(unsigned char *buf, size_t len) = 0; 00029 00030 virtual ~DataStreamer(); 00031 }; 00032 00033 DataStreamer *getDataFileStreamer(const std::string &Filename, 00034 std::string *Err); 00035 00036 } 00037 00038 #endif // LLVM_SUPPORT_DATASTREAM_H_