cfl_utils.cpp
Go to the documentation of this file.
1 /** @file cfl_utils.cpp C-level utility functions */
2 
3 /* FAU Discrete Event Systems Library (libfaudes)
4 
5  Copyright (C) 2006 Bernd Opitz
6  Copyright (C) 2008-2010 Thomas Moor
7  Exclusive copyright is granted to Klaus Schmidt
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Lesser General Public
11  License as published by the Free Software Foundation; either
12  version 2.1 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 
23 */
24 
25 
26 #include "cfl_utils.h"
27 
28 
29 // Debug includes
30 #include "cfl_attributes.h"
31 #include "cfl_registry.h"
32 #include "cfl_types.h"
33 #include "cfl_elementary.h"
34 
35 
36 // c++ file io
37 #include <fstream>
38 
39 
40 namespace faudes {
41 
42 // ToStringInteger(number)
43 std::string ToStringInteger(Int number) {
44  if(number>= std::numeric_limits<Int>::max()) return "inf";
45  if(number<= std::numeric_limits<Int>::min()+1) return "-inf";
46  std::string res;
47  std::stringstream sstr;
48  sstr << number;
49  sstr >> res;
50  return res;
51 }
52 
53 // ToStringInteger16(number)
54 std::string ToStringInteger16(Int number) {
55  std::string res;
56  std::stringstream sstr;
57  sstr << "0x" << std::setbase(16) << number;
58  sstr >> res;
59  return res;
60 }
61 
62 // ToStringFloat(number)
63 // todo: check range, prevent sci notation
64 std::string ToStringFloat(Float number) {
65  if(number>= std::numeric_limits<Float>::max()) return "inf";
66  if(number<= -1*std::numeric_limits<Float>::max()) return "-inf";
67  std::stringstream sstr;
68  if(number == static_cast<Float>( static_cast<Int>(number) )) {
69  sstr << static_cast<Int>(number);
70  } else {
71  sstr << std::fixed;
72  sstr << number;
73  }
74  std::string res;
75  sstr >> res;
76  return res;
77 }
78 
79 // ExpandString(rString, len)
80 std::string ExpandString(const std::string& rString, unsigned int len) {
81  std::string res;
82  res = rString;
83  std::string::size_type xtra = (std::string::size_type) len - rString.length();
84  if ((xtra > 0) && (xtra < 10000)) {
85  res.append(xtra, ' ');
86  }
87  return res;
88 }
89 
90 // CollapseString(rString, len)
91 std::string CollapsString(const std::string& rString, unsigned int len) {
92  if(len <=1) return rString;
93  if(rString.length() <= len) return rString;
94  int chead = len/2;
95  int ctail = len-chead;
96  return rString.substr(0,chead) + "..." + rString.substr(rString.length()-ctail,ctail);
97 }
98 
99 // ToIdx(rString)
100 Idx ToIdx(const std::string& rString) {
101  char * end;
102  unsigned long ul = strtoul (rString.c_str(), &end, 0);
103  unsigned long idxmax = std::numeric_limits<Idx>::max();
104  if(ul > idxmax) {
105  throw Exception("atoidx", "Idx overflow", 600);
106  }
107  return (Idx) ul;
108 }
109 
110 // String Substitution
111 std::string StringSubstitute(const std::string& rString,const std::string& rFrom,const std::string& rTo) {
112  // prep result
113  std::string res;
114  std::size_t pos=0;
115  // loop over occurences of "from"
116  while(pos<rString.length()) {
117  std::size_t next=rString.find(rFrom,pos);
118  if(next==std::string::npos) break;
119  res.append(rString.substr(pos, next-pos));
120  res.append(rTo);
121  pos=next+rFrom.length();
122  }
123  // get end
124  if(pos<rString.length())
125  res.append(rString.substr(pos));
126  // done
127  return res;
128 }
129 
130 // VersionString()
131 std::string VersionString() {
132  return std::string(FAUDES_VERSION);
133 }
134 
135 // FluginsString()
136 std::string PluginsString() {
137  return std::string(FAUDES_PLUGINS);
138 }
139 
140 // ContributorsString()
141 std::string ContributorsString() {
142  return
143  "Ramon Barakat, Ruediger Berndt, Christian Breindl, Christine Baier, Tobias Barthel, Christoph Doerr, Marc Duevel, Norman Franchi, Stefan Goetz, Rainer Hartmann, Jochen Hellenschmidt, Stefan Jacobi, Matthias Leinfelder, Tomas Masopust, Michael Meyer, Andreas Mohr, Thomas Moor, Mihai Musunoi, Bernd Opitz, Katja Pelaic, Irmgard Petzoldt, Sebastian Perk, Thomas Rempel, Daniel Ritter, Berno Schlein, Ece Schmidt, Klaus Schmidt, Anne-Kathrin Schmuck, Sven Schneider, Matthias Singer, Yiheng Tang, Ulas Turan, Christian Wamser, Zhengying Wang, Thomas Wittmann, Shi Xiaoxun, Yang Yi, Jorgos Zaddach, Hao Zhou, Christian Zwick, et al";
144 }
145 
146 // ContributorsString()
147 std::string BuildString() {
148  std::string res;
149 #ifdef FAUDES_BUILDENV
150  res = res + std::string(FAUDES_BUILDENV);
151 #else
152  res = res + std::string("generic");
153 #endif
154 #ifdef FAUDES_BUILDTIME
155  res = res + std::string(" ") + std::string(FAUDES_BUILDTIME);
156 #else
157  res = res + std::string(" ") + std::string(FAUDES_CONFIG_TIMESTAMP);
158 #endif
159  return res;
160 }
161 
162 
163 // ProcessDot(infile,outfile,format)
164 void ProcessDot(const std::string& rDotFile,
165  const std::string& rOutFile, const std::string& rOutFormat, const std::string& rDotExec)
166 {
167  std::string format=rOutFormat;
168  // guess format from filename
169  if(format=="") {
170  if(rOutFile.rfind('.')+1 < rOutFile.size()) {
171  format=rOutFile.substr(rOutFile.rfind('.')+1);
172  }
173  }
174  // test format
175  if (format == "canon");
176  else if (format == "dot");
177  else if (format == "xdot");
178  else if (format == "cmap");
179  else if (format == "dia");
180  else if (format == "fig");
181  else if (format == "gd");
182  else if (format == "gd2");
183  else if (format == "gif");
184  else if (format == "hpgl");
185  else if (format == "imap");
186  else if (format == "cmapx");
187  else if (format == "ismap");
188  else if (format == "jpg");
189  else if (format == "jpeg");
190  else if (format == "mif");
191  else if (format == "mp");
192  else if (format == "pcl");
193  else if (format == "pic");
194  else if (format == "plain");
195  else if (format == "plain-ext");
196  else if (format == "png");
197  else if (format == "ps");
198  else if (format == "ps2");
199  else if (format == "svg");
200  else if (format == "svgz");
201  else if (format == "vrml");
202  else if (format == "vtx");
203  else if (format == "wbmp");
204  else if (format == "eps");
205  else if (format == "pdf");
206  else {
207  std::stringstream errstr;
208  errstr << "Dot output format \"" << format << "\" unknown";
209  throw Exception("faudes::ProcessDot", errstr.str(), 3);
210  }
211  std::string dotcommand = rDotExec + " -T"+format+" \""+rDotFile+"\" -o \""+rOutFile+"\"";
212  if(system(dotcommand.c_str()) != 0) {
213  throw Exception("faudes::ProcessDot",
214  "Error in running " + dotcommand, 3);
215  }
216 }
217 
218 
219 // CreateTempFile(void)
220 // todo: sys dependant, report, investigate threads
221 std::string CreateTempFile(void) {
222  char filename[]= "faudes_temp_XXXXXX";
223  std::string res;
224 #ifdef FAUDES_POSIX
225  // use mkstemp on recent Posix systems
226  int filedes = -1;
227  filedes= mkstemp(filename);
228  if(filedes==-1) {
229  FD_DF("faudes::CreateTempFile(): error");
230  return res;
231  }
232  close(filedes);
233  res=std::string(filename);
234 #endif
235 #ifdef FAUDES_WINDOWS
236  // mimique mkstemp on Windows/MinGW
237  /*
238  int filedes = -1;
239  #define _S_IREAD 256
240  #define _S_IWRITE 128
241  mktemp(filename);
242  filedes=open(filename,O_RDWR|O_BINARY|O_CREAT|O_EXCL|_O_SHORT_LIVED, _S_IREAD|_S_IWRITE);
243  if(filedes==-1) {
244  FD_DF("faudes::CreateTempFile(): error");
245  return "";
246  }
247  close(filedes);
248  res=std::string(filename);
249  */
250  // win32 API
251  char* tmpname = _mktemp(filename);
252  FILE* file;
253  if(tmpname==NULL) {
254  FD_DF("faudes::CreateTempFile(): error");
255  return res;
256  }
257  fopen_s(&file,tmpname,"w");
258  if(file==NULL) {
259  FD_DF("faudes::CreateTempFile(): error");
260  return "";
261  }
262  fclose(file);
263  res=std::string(tmpname);
264 #endif
265  FD_DF("faudes::CreateTempFile(): " << res);
266  return(res);
267 }
268 
269 
270 
271 // ExtractPath
272 std::string ExtractDirectory(const std::string& rFullPath) {
273  std::string res="";
274  std::size_t seppos = rFullPath.find_last_of(faudes_pathseps());
275  if(seppos==std::string::npos) return res;
276  res=rFullPath.substr(0,seppos+1);
277  return res;
278 }
279 
280 // ExtractFilename
281 std::string ExtractFilename(const std::string& rFullPath) {
282  std::string res=rFullPath;
283  std::size_t seppos = rFullPath.find_last_of(faudes_pathseps());
284  if(seppos==std::string::npos) return res;
285  res=rFullPath.substr(seppos+1);
286  return res;
287 }
288 
289 // ExtractBasename
290 std::string ExtractBasename(const std::string& rFullPath) {
291  std::string res=rFullPath;
292  std::size_t seppos = res.find_last_of(faudes_pathseps());
293  if(seppos!=std::string::npos) {
294  res=res.substr(seppos+1);
295  }
296  std::size_t dotpos = res.find_last_of(".");
297  if(dotpos!=std::string::npos) {
298  res=res.substr(0,dotpos);
299  }
300  return res;
301 }
302 
303 // ExtractSuffix
304 std::string ExtractSuffix(const std::string& rFullPath) {
305  std::string res=rFullPath;
306  std::size_t seppos = res.find_last_of(faudes_pathseps());
307  if(seppos!=std::string::npos) {
308  res=res.substr(seppos+1);
309  }
310  std::size_t dotpos = res.find_last_of(".");
311  if(dotpos!=std::string::npos)
312  if(dotpos +1 < res.size()) {
313  return res.substr(dotpos+1,res.size()-dotpos-1);
314  }
315  return std::string();
316 }
317 
318 // PrependPath
319 std::string PrependPath(const std::string& rLeft, const std::string& rRight) {
320  // bail out in trivial args
321  if(rLeft=="")
322  return std::string(rRight);
323  if(rRight=="")
324  return std::string(rLeft);
325  // system default
326  char sepchar=faudes_pathsep().at(0);
327  // user overwrite by left argument
328  std::size_t seppos;
329  seppos=rLeft.find_last_of(faudes_pathseps());
330  if(seppos!=std::string::npos)
331  sepchar=rLeft.at(seppos);
332  // go doit
333  std::string res=rLeft;
334  if(res.at(res.length()-1)!=sepchar)
335  res.append(1,sepchar);
336  if(rRight.at(0)!=sepchar){
337  res.append(rRight);
338  return res;
339  }
340  if(rRight.length()<=1) {
341  return res;
342  }
343  res.append(rRight,1,std::string::npos);
344  return res;
345 }
346 
347 // Test directory
348 bool DirectoryExists(const std::string& rDirectory) {
349 #ifdef FAUDES_POSIX
350  DIR *thedir;
351  thedir=opendir(rDirectory.c_str());
352  if(thedir) closedir(thedir);
353  return thedir!= 0;
354 #endif
355 #ifdef FAUDES_WINDOWS
356  DWORD fattr = GetFileAttributesA(rDirectory.c_str());
357  return
358  (fattr!=INVALID_FILE_ATTRIBUTES) && (fattr & FILE_ATTRIBUTE_DIRECTORY);
359 #endif
360  return false;
361 }
362 
363 // scan directory
364 std::set< std::string > ReadDirectory(const std::string& rDirectory) {
365  std::set< std::string > res;
366 #ifdef FAUDES_POSIX
367  DIR *thedir;
368  struct dirent *theent;
369  thedir=opendir(rDirectory.c_str());
370  if(!thedir) return res;
371  while((theent=readdir(thedir))) {
372  std::string fname(theent->d_name);
373  if(fname==".") continue;
374  if(fname=="..") continue;
375  res.insert(fname);
376  }
377  closedir(thedir);
378 #endif
379 #ifdef FAUDES_WINDOWS
380  HANDLE hf;
381  WIN32_FIND_DATA data;
382  hf = FindFirstFile((rDirectory+"\\*.*").c_str(), &data);
383  if (hf != INVALID_HANDLE_VALUE) {
384  do {
385  std::string fname(data.cFileName);
386  if(fname==".") continue;
387  if(fname=="..") continue;
388  res.insert(fname);
389  } while (FindNextFile(hf, &data));
390  FindClose(hf);
391  }
392 #endif
393  return res;
394 }
395 
396 
397 
398 
399 
400 // Test file
401 bool FileExists(const std::string& rFilename) {
402  std::fstream fp;
403  fp.open(rFilename.c_str(), std::ios::in | std::ios::binary);
404  return fp.good();
405 }
406 
407 // Delete file
408 bool FileDelete(const std::string& rFilename) {
409  return remove(rFilename.c_str()) == 0;
410 }
411 
412 // Copy file
413 bool FileCopy(const std::string& rFromFile, const std::string& rToFile) {
414  std::ifstream froms(rFromFile.c_str(), std::ios::binary);
415  std::ofstream tos(rToFile.c_str(), std::ios::binary);
416  tos << froms.rdbuf();
417  tos.flush();
418  return !(froms.fail() || tos.fail());
419 }
420 
421 // ConsoleOut class
422 // Note: console-out is not re-entrant; for multithreaded applications
423 // you must derive a class that has built-in mutexes;
424 ConsoleOut::ConsoleOut(void) : pStream(NULL), mMute(false) , mVerb(0) {
425  pInstance=this;
426 }
428  if(pStream) { pStream->flush(); delete pStream; }
429  if(this==smpInstance) smpInstance=NULL;
430 }
432  if(!smpInstance) smpInstance= new ConsoleOut();
433  return smpInstance->pInstance;
434 }
436  std::string fname = smpInstance->pInstance->Filename();
438  smpInstance->pInstance=out;
440  smpInstance->pInstance->ToFile(fname);
441 }
442 void ConsoleOut::ToFile(const std::string& filename) {
443  if(pStream) { pStream->flush(); delete pStream; }
444  pStream=NULL;
445  mFilename=filename;
446  if(mFilename=="") return;
447  pStream = new std::ofstream();
448  pStream->open(mFilename.c_str(),std::ios::app);
449 }
450  void ConsoleOut::Write(const std::string& message,long int cntnow, long int cntdone, int verb) {
451  if(mMute) return;
452  if(mVerb<verb) return;
453  DoWrite(message,cntnow,cntdone,verb);
454 }
455  void ConsoleOut::DoWrite(const std::string& message,long int cntnow, long int cntdone, int verb) {
456  (void) cntnow; (void) cntdone; (void) verb;
457  std::ostream* sout=pStream;
458  if(!sout) sout=&std::cout; // tmoor: used to be std::cerr, using std::cout to facilitate emscripten/js
459  *sout << message;
460  sout->flush();
461 }
462 
463 // global instance
465 
466 
467 
468 // debugging: objectcount
469 std::map<std::string,long int>* ObjectCount::mspMax=NULL;
470 std::map<std::string,long int>* ObjectCount::mspCount=NULL;
471 bool ObjectCount::msDone=false;
473  mspCount= new std::map<std::string,long int>();
474  mspMax= new std::map<std::string,long int>();
475  msDone=true;
476 }
477 void ObjectCount::Init(void) {
478  if(!msDone) ObjectCount();
479 }
480 void ObjectCount::Inc(const std::string& rTypeName) {
481  if(!msDone) ObjectCount();
482  long int cnt = ((*mspCount)[rTypeName]+=1);
483  if((*mspMax)[rTypeName]<cnt) (*mspMax)[rTypeName]=cnt;
484 }
485 void ObjectCount::Dec(const std::string& rTypeName) {
486  if(!msDone) ObjectCount();
487  (*mspCount)[rTypeName]-=1;
488 }
489 
490 
491 // debugging: report on exit function
492 void ExitFunction(void){
493 #ifdef FAUDES_DEBUG_CODE
494  FAUDES_WRITE_CONSOLE("faudes::ExitFunction():");
495  // be sure its up and running
497  // get rid of all registry prototypes
498  //TypeRegistry::G()->ClearAll();
499  //FunctionRegistry::G()->Clear();
500  // prepare report
501  std::map<std::string,long int>::iterator cit;
502  cit=ObjectCount::mspCount->begin();
503  for(;cit!=ObjectCount::mspCount->end();cit++) {
504  FAUDES_WRITE_CONSOLE( cit->first << ": #" << ToStringInteger(cit->second) <<
505  " (max #" << (*ObjectCount::mspMax)[cit->first] << ")");
506  }
507 #endif
508 }
509 
510 
511 #ifdef FAUDES_DEBUG_CODE
512 // report on exit install
513 class ExitFunctionInstall {
514 private:
515  static bool mDone;
516  static ExitFunctionInstall mInstance;
517  ExitFunctionInstall(void) {
518  if(mDone) return;
519  FAUDES_WRITE_CONSOLE("ExitFunctionInstall()");
520  std::atexit(ExitFunction);
521  mDone=true;
522  }
523 };
524 // exit function: global data
525 bool ExitFunctionInstall::mDone=false;
526 ExitFunctionInstall ExitFunctionInstall::mInstance;
527 #endif
528 
529 // test protocol: token writer and file
531 std::string gTestProtocolFr;
532 
533 // test protocol: setup
534 std::string TestProtocol(const std::string& rSource) {
535  if(gTestProtocolTw) return gTestProtocolFr;
536  // set up filename
537  std::string filename=rSource;
538  // fix empty source
539  if(filename=="") filename="faudes_dump";
540  // remove directory
541  filename=ExtractFilename(filename);
542  // remove extension
543  std::string::size_type pos=0;
544  for(;pos<filename.length();pos++)
545  if(filename.at(pos)=='.') filename.at(pos)='_';
546  // append extension
547  filename.append(".prot");
548  // record nominal case
549  gTestProtocolFr=filename;
550  // prepend prefix
551  filename.insert(0,"tmp_");
552  // initialise token writer
553  gTestProtocolTw= new TokenWriter(filename);
554  // report filename
555  return gTestProtocolFr;
556 }
557 
558 // test protocol: dump
559 void TestProtocol(const std::string& rMessage, const Type& rData, bool full) {
560  if(!gTestProtocolTw) return;
561  gTestProtocolTw->WriteComment("%%% test mark: " + rMessage);
562  if(full) rData.Write(*gTestProtocolTw);
563  else rData.SWrite(*gTestProtocolTw);
567  *gTestProtocolTw << "\n";
568 }
569 void TestProtocol(const std::string& rMessage, bool data) {
570  Boolean fbool(data);
571  TestProtocol(rMessage,fbool,true);
572 }
573 void TestProtocol(const std::string& rMessage, long int data) {
574  Integer fint(data);
575  TestProtocol(rMessage,fint,true);
576 }
577 void TestProtocol(const std::string& rMessage, const std::string& rData) {
578  String fstr(rData);
579  TestProtocol(rMessage,fstr,true);
580 }
581 
582 // test protocol: compare
583 bool TestProtocol(void) {
584  // bail out on no protocol
585  if(!gTestProtocolTw) return true;
586  // close protocol file
587  std::string prot=gTestProtocolTw->FileName();
588  delete gTestProtocolTw;
589  gTestProtocolTw=NULL;
590  // open protocol
591  std::fstream fp;
592  fp.open(prot.c_str(), std::ios::in | std::ios::binary);
593  if(!fp.good()) {
594  FAUDES_WRITE_CONSOLE("TestProtocol(): could not open protocol \"" << prot << "\"");
595  return false;
596  }
597  // open reference
598  std::string ref=gTestProtocolFr;
599  std::fstream fr;
600  fr.open(ref.c_str(), std::ios::in | std::ios::binary);
601  if(!fr.good()) {
602  ref="data"+faudes_pathsep()+ref;
603  fr.clear(); // mingw's runtime will not clear on open
604  fr.open(ref.c_str(), std::ios::in | std::ios::binary);
605  }
606  if(!fr.good()) {
607  FAUDES_WRITE_CONSOLE("TestProtocol(): could not open/find reference \"" << gTestProtocolFr << "\"");
608  return true;
609  }
610  // perform comparision
611  int dline=-1;
612  int cline=1;
613  try{
614  while(true) {
615  // read next char
616  char cp = fp.get();
617  char cr= fr.get();
618  // eof
619  if(fp.eof() && fr.eof()) { break; }
620  if(!fp.good() || !fr.good()) { dline=cline; break;}
621  // cheap normalize cr/lf: ignore \r (assume no double \r
622  if( cp=='\r' && cr =='\r') continue;
623  if( cp=='\r' && fp.eof()){ dline=cline; break;}
624  if( cp=='\r') cp = fp.get();
625  if( cr=='\r' && fr.eof()){ dline=cline; break;}
626  if( cr=='\r') cr = fr.get();
627  // count lines
628  if( cr=='\n') cline++;
629  // sense mitmatch
630  if( cp!= cr ){dline=cline; break;}
631  }
632  } catch(std::ios::failure&) {
633  throw Exception("TestProtocol()", "io error at line " + ToStringInteger(cline), 1);
634  }
635  // done
636  if(dline>=0) {
637  FAUDES_WRITE_CONSOLE("TestProtocol(): using reference " << ref << "");
638  FAUDES_WRITE_CONSOLE("TestProtocol(): found difference at line " << dline << "");
639  }
640  return dline== -1;
641 }
642 
643 
644 
645 // declare loop callback
646 static bool (*gBreakFnct)(void)=0;
647 
648 // set loop callback
649 void LoopCallback( bool pBreak(void)) {
650  gBreakFnct=pBreak;
651 }
652 
653 // do loop callback
654 // note: this function is meant to be "quiet" during normal
655 // operation in order not to mess up console logging
656 void LoopCallback(void){
657  if(!gBreakFnct) return;
658  if(! (*gBreakFnct)() ) return;
659  throw Exception("LoopCallback", "break on application request", 110);
660 }
661 
662 } // namespace faudes
#define FAUDES_WRITE_CONSOLE(message)
#define FD_DF(message)
const std::string & faudes_pathseps(void)
const std::string & faudes_pathsep(void)
static ConsoleOut * G(void)
Definition: cfl_utils.cpp:431
ConsoleOut * pInstance
Definition: cfl_utils.h:360
std::ofstream * pStream
Definition: cfl_utils.h:353
virtual void DoWrite(const std::string &message, long int cntnow=0, long int cntdone=0, int verb=0)
Definition: cfl_utils.cpp:455
virtual void Write(const std::string &message, long int cntnow=0, long int cntdone=0, int verb=0)
Definition: cfl_utils.cpp:450
static ConsoleOut * smpInstance
Definition: cfl_utils.h:362
virtual ~ConsoleOut(void)
Definition: cfl_utils.cpp:427
const std::string & Filename(void)
Definition: cfl_utils.h:335
std::string mFilename
Definition: cfl_utils.h:355
void Redirect(ConsoleOut *out)
Definition: cfl_utils.cpp:435
void ToFile(const std::string &filename)
Definition: cfl_utils.cpp:442
static bool msDone
Definition: cfl_utils.h:384
static void Init(void)
Definition: cfl_utils.cpp:477
static void Inc(const std::string &rTypeName)
Definition: cfl_utils.cpp:480
static void Dec(const std::string &rTypeName)
Definition: cfl_utils.cpp:485
static std::map< std::string, long int > * mspCount
Definition: cfl_utils.h:382
static std::map< std::string, long int > * mspMax
Definition: cfl_utils.h:381
std::string FileName(void) const
void WriteComment(const std::string &rComment)
void Write(const Type *pContext=0) const
Definition: cfl_types.cpp:140
void SWrite(TokenWriter &rTw) const
Definition: cfl_types.cpp:257
uint32_t Idx
std::string VersionString()
Definition: cfl_utils.cpp:131
std::string ExtractDirectory(const std::string &rFullPath)
Definition: cfl_utils.cpp:272
void LoopCallback(bool pBreak(void))
Definition: cfl_utils.cpp:649
std::string PrependPath(const std::string &rLeft, const std::string &rRight)
Definition: cfl_utils.cpp:319
Idx ToIdx(const std::string &rString)
Definition: cfl_utils.cpp:100
TokenWriter * gTestProtocolTw
Definition: cfl_utils.cpp:530
void ProcessDot(const std::string &rDotFile, const std::string &rOutFile, const std::string &rOutFormat, const std::string &rDotExec)
Definition: cfl_utils.cpp:164
std::string CreateTempFile(void)
Definition: cfl_utils.cpp:221
bool FileCopy(const std::string &rFromFile, const std::string &rToFile)
Definition: cfl_utils.cpp:413
std::string PluginsString()
Definition: cfl_utils.cpp:136
std::string ExpandString(const std::string &rString, unsigned int len)
Definition: cfl_utils.cpp:80
static bool(* gBreakFnct)(void)=0
Definition: cfl_utils.cpp:646
std::string BuildString()
Definition: cfl_utils.cpp:147
bool FileDelete(const std::string &rFilename)
Definition: cfl_utils.cpp:408
std::string ToStringFloat(Float number)
Definition: cfl_utils.cpp:64
std::string ExtractFilename(const std::string &rFullPath)
Definition: cfl_utils.cpp:281
std::string ToStringInteger16(Int number)
Definition: cfl_utils.cpp:54
double Float
std::string ContributorsString()
Definition: cfl_utils.cpp:141
std::string ToStringInteger(Int number)
Definition: cfl_utils.cpp:43
std::set< std::string > ReadDirectory(const std::string &rDirectory)
Definition: cfl_utils.cpp:364
std::string StringSubstitute(const std::string &rString, const std::string &rFrom, const std::string &rTo)
Definition: cfl_utils.cpp:111
std::string gTestProtocolFr
Definition: cfl_utils.cpp:531
std::string ExtractBasename(const std::string &rFullPath)
Definition: cfl_utils.cpp:290
bool DirectoryExists(const std::string &rDirectory)
Definition: cfl_utils.cpp:348
std::string TestProtocol(const std::string &rSource)
Definition: cfl_utils.cpp:534
void ExitFunction(void)
Definition: cfl_utils.cpp:492
bool FileExists(const std::string &rFilename)
Definition: cfl_utils.cpp:401
std::string ExtractSuffix(const std::string &rFullPath)
Definition: cfl_utils.cpp:304
std::string CollapsString(const std::string &rString, unsigned int len)
Definition: cfl_utils.cpp:91
long int Int

libFAUDES 2.33b --- 2025.05.07 --- c++ api documentaion by doxygen