CMS 3D CMS Logo

Namespaces | Functions
stringArchiveIO.cc File Reference
#include <cassert>
#include <cstring>
#include <fstream>
#include <sstream>
#include "Alignment/Geners/interface/IOException.hh"
#include "Alignment/Geners/interface/stringArchiveIO.hh"
#include "Alignment/Geners/interface/CompressedIO.hh"
#include "Alignment/Geners/interface/Reference.hh"

Go to the source code of this file.

Namespaces

 gs
 

Functions

StringArchive * gs::loadStringArchiveFromArchive (AbsArchive &arch, const unsigned long long id)
 
StringArchive * gs::readCompressedStringArchive (const char *filename)
 
StringArchive * gs::readCompressedStringArchiveExt (const char *filename, const char *suffix)
 
StringArchive * gs::readStringArchive (const char *filename)
 
static bool suffix_matches (const char *filename, const char *suffix)
 
bool gs::writeCompressedStringArchive (const StringArchive &ar, const char *filename, const unsigned inCompressionMode, const int compressionLevel, const unsigned minSizeToCompress, const unsigned bufSize)
 
bool gs::writeCompressedStringArchiveExt (const StringArchive &ar, const char *filename, const char *suffix)
 
bool gs::writeStringArchive (const StringArchive &ar, const char *filename)
 

Function Documentation

static bool suffix_matches ( const char *  filename,
const char *  suffix 
)
static

Definition at line 13 of file stringArchiveIO.cc.

References mps_fire::i.

Referenced by gs::readCompressedStringArchiveExt(), and gs::writeCompressedStringArchiveExt().

14 {
15  static const char default_suffix[] = ".gssaz";
16  assert(filename);
17  if (suffix == nullptr)
18  suffix = default_suffix;
19  const std::size_t lenSuffix = strlen(suffix);
20  const std::size_t len = strlen(filename);
21  bool suffixMatches = len >= lenSuffix;
22  for (std::size_t i=0; i<lenSuffix && suffixMatches; ++i)
23  suffixMatches = suffix[i] == filename[len-lenSuffix+i];
24  return suffixMatches;
25 }