File indexing completed on 2023-03-17 10:46:37
0001 #ifndef CondFormats_MultiFileBlob_h
0002 #define CondFormats_MultiFileBlob_h
0003
0004 #include "CondFormats/Serialization/interface/Serializable.h"
0005
0006 #include <vector>
0007 #include <string>
0008 #include <map>
0009 #include <iosfwd>
0010
0011 class MultiFileBlob {
0012 public:
0013 typedef std::pair<unsigned char const*, unsigned char const*> Range;
0014
0015
0016 MultiFileBlob();
0017
0018
0019 ~MultiFileBlob();
0020
0021
0022 void finalized(bool compress);
0023
0024
0025
0026
0027
0028
0029
0030 void read(const std::string& name, std::istream& is);
0031
0032 void write(const std::string& name, std::ostream& os) const;
0033
0034
0035 Range rawBlob(const std::string& name) const;
0036
0037 bool isCompressed() const { return compressed; }
0038
0039 unsigned long long fullSize() const { return isize; }
0040
0041 unsigned long long size(const std::string& name) const;
0042
0043 private:
0044
0045 void expand();
0046
0047
0048
0049
0050 std::vector<unsigned char> blob;
0051 typedef std::map<std::string, unsigned long long> Positions;
0052 Positions positions;
0053 bool compressed;
0054 unsigned long long isize;
0055 bool expanded COND_TRANSIENT;
0056
0057 COND_SERIALIZABLE;
0058 };
0059
0060 #endif