Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:32:02

0001 #ifndef GENERS_STRINGARCHIVEIO_HH_
0002 #define GENERS_STRINGARCHIVEIO_HH_
0003 
0004 #include "Alignment/Geners/interface/StringArchive.hh"
0005 
0006 namespace gs {
0007   // The following function returns "true" on success,
0008   // "false" on failure.
0009   bool writeStringArchive(const StringArchive &ar, const char *filename);
0010 
0011   // The following function either succeeds or throws
0012   // an exception. The archive is created on the heap
0013   // and eventually has to be deleted by the user.
0014   StringArchive *readStringArchive(const char *filename);
0015 
0016   // Similar operations with compression
0017   bool writeCompressedStringArchive(const StringArchive &ar,
0018                                     const char *filename,
0019                                     unsigned compressionMode = 1U,
0020                                     int compressionLevel = -1,
0021                                     unsigned minSizeToCompress = 1024U,
0022                                     unsigned bufSize = 1048576U);
0023 
0024   StringArchive *readCompressedStringArchive(const char *filename);
0025 
0026   // The following function will write a compressed string archive
0027   // using default compression parameters if the file name has the
0028   // given suffix, otherwise it will write an uncompressed archive.
0029   // If the suffix is not provided (i.e., default value of 0 is used),
0030   // ".gssaz" will be assumed.
0031   bool writeCompressedStringArchiveExt(const StringArchive &ar, const char *filename, const char *suffix = nullptr);
0032 
0033   // The following function will attempt to read a compressed string
0034   // archive if the file name has the given suffix, otherwise it will
0035   // attempt to read an uncompressed archive. If the suffix is not
0036   // provided (i.e., default value of 0 is used), ".gssaz" will be assumed.
0037   StringArchive *readCompressedStringArchiveExt(const char *filename, const char *suffix = nullptr);
0038 
0039   // This function will extract one string archive from another
0040   StringArchive *loadStringArchiveFromArchive(AbsArchive &arch, unsigned long long id);
0041 }  // namespace gs
0042 
0043 #endif  // GENERS_STRINGARCHIVEIO_HH_