ATLAS Offline Software
Loading...
Searching...
No Matches
LArFCAL_Base_ID.cxx File Reference
#include "CaloIdentifier/LArFCAL_Base_ID.h"
#include "IdDict/IdDictDictionary.h"
#include "IdDict/IdDictField.h"
#include "IdDict/IdDictMgr.h"
#include "IdDict/IdDictRegion.h"
#include "PathResolver/PathResolver.h"
#include "CxxUtils/StrFormat.h"
#include <iostream>
#include <fstream>
Include dependency graph for LArFCAL_Base_ID.cxx:

Go to the source code of this file.

Macros

#define MAX_BUFFER_LEN   1024

Functions

std::string strformat (const char *fmt,...)
 return a std::string according to a format fmt and varargs

Macro Definition Documentation

◆ MAX_BUFFER_LEN

#define MAX_BUFFER_LEN   1024

Definition at line 18 of file LArFCAL_Base_ID.cxx.

Function Documentation

◆ strformat()

std::string CxxUtils::strformat ( const char * fmt,
... )

return a std::string according to a format fmt and varargs

Definition at line 49 of file StrFormat.cxx.

50{
51 char *buf = NULL;
52 int nbytes = -1;
53
54 va_list ap;
55 va_start(ap, fmt); /* Initialize the va_list */
56
57 nbytes = vasprintf(&buf, fmt, ap);
58 va_end(ap); /* Cleanup the va_list */
59
60 if (nbytes < 0) {
61 /*buf is undefined when allocation failed
62 * see: http://linux.die.net/man/3/asprintf
63 */
64 // free(buf);
65 throw std::runtime_error("problem while calling vasprintf");
66 }
67
68 CharLiberator guard(buf);
69
70 // help compiler to apply RVO
71 return std::string(buf);
72}
const char *const fmt