CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Namespaces | Functions
gs Namespace Reference

Namespaces

 Private
 

Functions

std::string fileDirname (const char *filename)
 
std::string fileTail (const char *filename)
 
std::string joinDir1WithName2 (const char *fname1, const char *fname2)
 
std::string localFileURI (const char *filename)
 
bool writeBinaryCatalog (std::ostream &os, const unsigned compressionCode, const unsigned mergeLevel, const std::vector< std::string > &annotations, const AbsCatalog &catalog, const unsigned formatId)
 

Function Documentation

std::string gs::fileDirname ( const char *  filename)

Definition at line 31 of file uriUtils.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by joinDir1WithName2().

32  {
33  assert(filename);
34  const char *progname = std::strrchr(filename, '/');
35  if (progname)
36  return std::string(filename, progname - filename);
37  else
38  return std::string(".");
39  }
tuple filename
Definition: lut2db_cfg.py:20
std::string gs::fileTail ( const char *  filename)

Definition at line 20 of file uriUtils.cc.

References lut2db_cfg::filename, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by joinDir1WithName2().

21  {
22  assert(filename);
23  const char *progname = std::strrchr(filename, '/');
24  if (progname)
25  ++progname;
26  else
27  progname = filename;
28  return std::string(progname);
29  }
tuple filename
Definition: lut2db_cfg.py:20
std::string gs::joinDir1WithName2 ( const char *  fname1,
const char *  fname2 
)

Definition at line 41 of file uriUtils.cc.

References fileDirname(), fileTail(), and AlCaHLTBitMon_QueryRunRegistry::string.

42  {
43  std::string res(fileDirname(fname1));
44  res += '/';
45  res += fileTail(fname2);
46  return res;
47  }
std::string fileDirname(const char *filename)
Definition: uriUtils.cc:31
std::string fileTail(const char *filename)
Definition: uriUtils.cc:20
std::string gs::localFileURI ( const char *  filename)

Definition at line 8 of file uriUtils.cc.

References lut2db_cfg::filename, and AlCaHLTBitMon_QueryRunRegistry::string.

9  {
10  assert(filename);
11  if (strlen(filename) == 0) throw gs::IOInvalidArgument(
12  "In gs::localFileURI: empty file name");
13  std::string uri("file://");
14  if (filename[0] != '/')
15  uri += "./";
16  uri += filename;
17  return uri;
18  }
tuple filename
Definition: lut2db_cfg.py:20
bool gs::writeBinaryCatalog ( std::ostream &  os,
const unsigned  compressionCode,
const unsigned  mergeLevel,
const std::vector< std::string > &  annotations,
const AbsCatalog &  catalog,
const unsigned  formatId 
)

Definition at line 4 of file CatalogIO.cc.

8  {
9  os.seekp(0, std::ios_base::beg);
10 
11  const unsigned endianness = 0x01020304;
12  const unsigned char sizelong = sizeof(long);
13 
14  write_pod(os, formatId);
15  write_pod(os, endianness);
16  write_pod(os, sizelong);
17  write_pod(os, compressionCode);
18  write_pod(os, mergeLevel);
19  write_pod_vector(os, annotations);
20 
21  return !os.fail() &&
22  catalog.classId().write(os) && catalog.write(os);
23  }