CMS 3D CMS Logo

FileBlob.h
Go to the documentation of this file.
1 #ifndef CondFormats_FileBlob_h
2 #define CondFormats_FileBlob_h
3 
5 
6 #include <vector>
7 #include <string>
8 #include <iostream>
9 #include <memory>
10 
11 class FileBlob {
12 public:
14  compressed = false;
15  isize = 0;
16  };
18  FileBlob(const std::string &fname, bool zip);
20  FileBlob(std::istream &is, bool zip);
21 
22  ~FileBlob(){};
23 
25  void read(const std::string &);
27  void write(const std::string &) const;
28 
30  void read(std::istream &);
32  void write(std::ostream &) const;
33 
34  bool isCompressed() const { return compressed; };
35 
36  int size() const { return isize; };
38 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
39  std::unique_ptr<std::vector<unsigned char> > getUncompressedBlob() const;
40 #endif
41  void getUncompressedBlob(std::vector<unsigned char> &myblobcopy) const;
42 
43 private:
44  static unsigned int computeFileSize(const std::string &);
45  static unsigned int computeStreamSize(std::istream &);
46 
47  std::vector<unsigned char> blob;
48  bool compressed;
49  unsigned int isize;
50 
52 };
53 
54 #endif
FileBlob::isize
unsigned int isize
Definition: FileBlob.h:49
FileBlob::isCompressed
bool isCompressed() const
Definition: FileBlob.h:34
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
FileBlob::computeFileSize
static unsigned int computeFileSize(const std::string &)
Definition: FileBlob.cc:119
FileBlob::getUncompressedBlob
std::unique_ptr< std::vector< unsigned char > > getUncompressedBlob() const
i didn't want to do two copies ... hope this works.
Definition: FileBlob.cc:75
FileBlob::FileBlob
FileBlob()
Definition: FileBlob.h:13
FileBlob::blob
std::vector< unsigned char > blob
Definition: FileBlob.h:47
FileBlob::~FileBlob
~FileBlob()
Definition: FileBlob.h:22
FileBlob::read
void read(const std::string &)
read from real file
Definition: FileBlob.cc:104
Serializable.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ComparisonHelper::zip
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
Definition: L1TStage2CaloLayer1.h:41
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
FileBlob::computeStreamSize
static unsigned int computeStreamSize(std::istream &)
Definition: FileBlob.cc:130
FileBlob::size
int size() const
Definition: FileBlob.h:36
FileBlob::write
void write(const std::string &) const
write to real file
Definition: FileBlob.cc:113
FileBlob::compressed
bool compressed
Definition: FileBlob.h:48
FileBlob
Definition: FileBlob.h:11