CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FileBlob.h
Go to the documentation of this file.
1 #ifndef CondFormats_FileBlob_h
2 #define CondFormats_FileBlob_h
3 
4 #include <vector>
5 #include <string>
6 #include <iostream>
7 
8 class FileBlob{
9 
10  public:
11  FileBlob() {};
13  FileBlob(const std::string & fname, bool zip);
15  FileBlob(std::istream & is, bool zip);
16 
17  ~FileBlob(){};
18 
20  void read(const std::string&);
22  void write(const std::string&) const;
23 
25  void read(std::istream &);
27  void write(std::ostream &) const;
28 
29  bool isCompressed() const {return compressed;};
30 
31  int size() const {return isize;};
33  std::vector<unsigned char>* getUncompressedBlob() const;
34  void getUncompressedBlob( std::vector<unsigned char>& myblobcopy ) const;
35 
36  private:
37  static unsigned int computeFileSize(const std::string &);
38  static unsigned int computeStreamSize(std::istream &);
39 
40  std::vector<unsigned char> blob;
41  bool compressed;
42  unsigned int isize;
43 };
44 
45 #endif
bool isCompressed() const
Definition: FileBlob.h:29
std::vector< unsigned char > blob
Definition: FileBlob.h:40
static unsigned int computeFileSize(const std::string &)
Definition: FileBlob.cc:123
bool compressed
Definition: FileBlob.h:41
static unsigned int computeStreamSize(std::istream &)
Definition: FileBlob.cc:132
FileBlob()
Definition: FileBlob.h:11
int size() const
Definition: FileBlob.h:31
void write(const std::string &) const
write to real file
Definition: FileBlob.cc:117
~FileBlob()
Definition: FileBlob.h:17
std::vector< unsigned char > * getUncompressedBlob() const
i didn&#39;t want to do two copies ... hope this works.
Definition: FileBlob.cc:74
string fname
main script
unsigned int isize
Definition: FileBlob.h:42
void read(const std::string &)
read from real file
Definition: FileBlob.cc:110