CMS 3D CMS Logo

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

◆ suffix_matches()

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

Definition at line 12 of file stringArchiveIO.cc.

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

References cms::cuda::assert(), corrVsCorr::filename, mps_fire::i, and createPayload::suffix.

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

mps_fire.i
i
Definition: mps_fire.py:428
cms::cuda::assert
assert(be >=bs)
createPayload.suffix
suffix
Definition: createPayload.py:281
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123