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 
10 class FileBlob {
11 public:
13  compressed = false;
14  isize = 0;
15  };
17  FileBlob(const std::string &fname, bool zip);
19  FileBlob(std::istream &is, bool zip);
20 
21  ~FileBlob(){};
22 
24  void read(const std::string &);
26  void write(const std::string &) const;
27 
29  void read(std::istream &);
31  void write(std::ostream &) const;
32 
33  bool isCompressed() const { return compressed; };
34 
35  int size() const { return isize; };
37 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
38  std::unique_ptr<std::vector<unsigned char> > getUncompressedBlob() const;
39 #endif
40  void getUncompressedBlob(std::vector<unsigned char> &myblobcopy) const;
41 
42 private:
43  static unsigned int computeFileSize(const std::string &);
44  static unsigned int computeStreamSize(std::istream &);
45 
46  std::vector<unsigned char> blob;
47  bool compressed;
48  unsigned int isize;
49 
51 };
52 
53 #endif
FileBlob::isize
unsigned int isize
Definition: FileBlob.h:48
FileBlob::isCompressed
bool isCompressed() const
Definition: FileBlob.h:33
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:12
FileBlob::blob
std::vector< unsigned char > blob
Definition: FileBlob.h:46
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FileBlob::~FileBlob
~FileBlob()
Definition: FileBlob.h:21
FileBlob::read
void read(const std::string &)
read from real file
Definition: FileBlob.cc:104
Serializable.h
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:35
FileBlob::write
void write(const std::string &) const
write to real file
Definition: FileBlob.cc:113
FileBlob::compressed
bool compressed
Definition: FileBlob.h:47
FileBlob
Definition: FileBlob.h:10