mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 17:18:00 +02:00
reducing changes of segmentation for null string, syntax of receiver call backs
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@505 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -278,16 +278,17 @@ class fileIOStatic {
|
||||
\returns file name without file name prefix, detector index or extension
|
||||
*/
|
||||
static string getReceiverFileNameToConcatenate(string fname) { \
|
||||
int i; \
|
||||
string s; \
|
||||
s=fname; \
|
||||
//int i;
|
||||
string s=fname; \
|
||||
if(fname.empty()) return fname; \
|
||||
size_t slash=s.rfind("/"); \
|
||||
if (slash!= string::npos) \
|
||||
s=s.substr(slash,s.size()-slash); \
|
||||
size_t dot=s.find("."); \
|
||||
size_t uscore=s.find("_"); \
|
||||
s=s.substr(uscore,dot-uscore); \
|
||||
uscore=s.find("_",1); \
|
||||
if ((dot!= string::npos)&&(uscore!= string::npos)) \
|
||||
s=s.substr(uscore,dot-uscore); \
|
||||
// uscore=s.find("_",1);
|
||||
//if ((uscore!= string::npos) && (sscanf( s.substr(1,uscore-1).c_str(),"d%d",&i)))
|
||||
//s=s.substr(uscore,s.size()-uscore);
|
||||
return s; \
|
||||
|
Reference in New Issue
Block a user