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
40namespace faudes {
41
42// ToStringInteger(number)
43std::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)
54std::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
64std::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)
80std::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)
91std::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)
100Idx 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// ToLOwerCase(rString(
111std::string ToLowerCase(const std::string& rString) {
112 std::string res=rString;
113 std::transform(res.begin(), res.end(), res.begin(),
114 [](unsigned char c){ return std::tolower(c); });
115 return res;
116}
117
118
119
120// String Substitution
121std::string StringSubstitute(const std::string& rString,const std::string& rFrom,const std::string& rTo) {
122 // prep result
123 std::string res;
124 std::size_t pos=0;
125 // loop over occurences of "from"
126 while(pos<rString.length()) {
127 std::size_t next=rString.find(rFrom,pos);
128 if(next==std::string::npos) break;
129 res.append(rString.substr(pos, next-pos));
130 res.append(rTo);
131 pos=next+rFrom.length();
132 }
133 // get end
134 if(pos<rString.length())
135 res.append(rString.substr(pos));
136 // done
137 return res;
138}
139
140// VersionString()
141std::string VersionString() {
142 return std::string(FAUDES_VERSION);
143}
144
145// FluginsString()
146std::string PluginsString() {
147 return std::string(FAUDES_PLUGINS);
148}
149
150// ContributorsString()
151std::string ContributorsString() {
152 return
153 "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, Changming Yang, Yang Yi, Jorgos Zaddach, Hao Zhou, Christian Zwick, et al";
154}
155
156#define XLITSTR(x) LITSTR(x)
157#define LITSTR(x) #x
158
159std::string BuildString() {
160 std::string res;
161#ifdef FAUDES_BUILDENV
162 res = res + std::string(FAUDES_BUILDENV);
163#else
164 res = res + std::string("generic");
165#endif
166#ifdef FAUDES_BUILDTIME
167 res = res + std::string(" ") + std::string(FAUDES_BUILDTIME);
168#else
169 res = res + std::string(" ") + std::string(FAUDES_CONFIG_TIMESTAMP);
170#endif
171 return res;
172}
173
174
175// ProcessDot(infile,outfile,format)
176void ProcessDot(const std::string& rDotFile,
177 const std::string& rOutFile, const std::string& rOutFormat, const std::string& rDotExec)
178{
179 std::string format=rOutFormat;
180 // guess format from filename
181 if(format=="") {
182 if(rOutFile.rfind('.')+1 < rOutFile.size()) {
183 format=rOutFile.substr(rOutFile.rfind('.')+1);
184 }
185 }
186 // test format
187 if (format == "canon");
188 else if (format == "dot");
189 else if (format == "xdot");
190 else if (format == "cmap");
191 else if (format == "dia");
192 else if (format == "fig");
193 else if (format == "gd");
194 else if (format == "gd2");
195 else if (format == "gif");
196 else if (format == "hpgl");
197 else if (format == "imap");
198 else if (format == "cmapx");
199 else if (format == "ismap");
200 else if (format == "jpg");
201 else if (format == "jpeg");
202 else if (format == "mif");
203 else if (format == "mp");
204 else if (format == "pcl");
205 else if (format == "pic");
206 else if (format == "plain");
207 else if (format == "plain-ext");
208 else if (format == "png");
209 else if (format == "ps");
210 else if (format == "ps2");
211 else if (format == "svg");
212 else if (format == "svgz");
213 else if (format == "vrml");
214 else if (format == "vtx");
215 else if (format == "wbmp");
216 else if (format == "eps");
217 else if (format == "pdf");
218 else {
219 std::stringstream errstr;
220 errstr << "Dot output format \"" << format << "\" unknown";
221 throw Exception("faudes::ProcessDot", errstr.str(), 3);
222 }
223 std::string dotcommand = rDotExec + " -T"+format+" \""+rDotFile+"\" -o \""+rOutFile+"\"";
224 if(system(dotcommand.c_str()) != 0) {
225 throw Exception("faudes::ProcessDot",
226 "Error in running " + dotcommand, 3);
227 }
228}
229
230
231// test executable
232bool DotReady(const std::string& rDotExec) {
233 // cache value
234 static bool ready=false;
235 static bool known=false;
236 if(known) return ready;
237 // test for dot binary
238 std::string testdot = rDotExec + " -V";
239 ready = (system(testdot.c_str()) == 0);
240 known = true;
241 return ready;
242}
243
244
245// CreateTempFile(void)
246// todo: sys dependant, report, investigate threads
247std::string CreateTempFile(void) {
248 char filename[]= "faudes_temp_XXXXXX";
249 std::string res;
250#ifdef FAUDES_POSIX
251 // use mkstemp on recent Posix systems
252 int filedes = -1;
253 filedes= mkstemp(filename);
254 if(filedes==-1) {
255 FD_DF("faudes::CreateTempFile(): error");
256 return res;
257 }
258 close(filedes);
259 res=std::string(filename);
260#endif
261#ifdef FAUDES_WINDOWS
262 // mimique mkstemp on Windows/MinGW
263 /*
264 int filedes = -1;
265 #define _S_IREAD 256
266 #define _S_IWRITE 128
267 mktemp(filename);
268 filedes=open(filename,O_RDWR|O_BINARY|O_CREAT|O_EXCL|_O_SHORT_LIVED, _S_IREAD|_S_IWRITE);
269 if(filedes==-1) {
270 FD_DF("faudes::CreateTempFile(): error");
271 return "";
272 }
273 close(filedes);
274 res=std::string(filename);
275 */
276 // win32 API
277 char* tmpname = _mktemp(filename);
278 FILE* file;
279 if(tmpname==NULL) {
280 FD_DF("faudes::CreateTempFile(): error");
281 return res;
282 }
283 fopen_s(&file,tmpname,"w");
284 if(file==NULL) {
285 FD_DF("faudes::CreateTempFile(): error");
286 return "";
287 }
288 fclose(file);
289 res=std::string(tmpname);
290#endif
291 FD_DF("faudes::CreateTempFile(): " << res);
292 return(res);
293}
294
295// ExtractPath
296std::string ExtractDirectory(const std::string& rFullPath) {
297 std::string res="";
298 std::size_t seppos = rFullPath.find_last_of(faudes_pathseps());
299 if(seppos==std::string::npos) return res;
300 res=rFullPath.substr(0,seppos+1);
301 return res;
302}
303
304// ExtractFilename
305std::string ExtractFilename(const std::string& rFullPath) {
306 std::string res=rFullPath;
307 std::size_t seppos = rFullPath.find_last_of(faudes_pathseps());
308 if(seppos==std::string::npos) return res;
309 res=rFullPath.substr(seppos+1);
310 return res;
311}
312
313// ExtractBasename
314std::string ExtractBasename(const std::string& rFullPath) {
315 std::string res=rFullPath;
316 std::size_t seppos = res.find_last_of(faudes_pathseps());
317 if(seppos!=std::string::npos) {
318 res=res.substr(seppos+1);
319 }
320 std::size_t dotpos = res.find_last_of(".");
321 if(dotpos!=std::string::npos) {
322 res=res.substr(0,dotpos);
323 }
324 return res;
325}
326
327// ExtractSuffix
328std::string ExtractSuffix(const std::string& rFullPath) {
329 std::string res=rFullPath;
330 std::size_t seppos = res.find_last_of(faudes_pathseps());
331 if(seppos!=std::string::npos) {
332 res=res.substr(seppos+1);
333 }
334 std::size_t dotpos = res.find_last_of(".");
335 if(dotpos!=std::string::npos)
336 if(dotpos +1 < res.size()) {
337 return res.substr(dotpos+1,res.size()-dotpos-1);
338 }
339 return std::string();
340}
341
342// PrependPath
343std::string PrependPath(const std::string& rLeft, const std::string& rRight) {
344 // bail out in trivial args
345 if(rLeft=="")
346 return std::string(rRight);
347 if(rRight=="")
348 return std::string(rLeft);
349 // system default
350 char sepchar=faudes_pathsep().at(0);
351 // user overwrite by left argument
352 std::size_t seppos;
353 seppos=rLeft.find_last_of(faudes_pathseps());
354 if(seppos!=std::string::npos)
355 sepchar=rLeft.at(seppos);
356 // go doit
357 std::string res=rLeft;
358 if(res.at(res.length()-1)!=sepchar)
359 res.append(1,sepchar);
360 if(rRight.at(0)!=sepchar){
361 res.append(rRight);
362 return res;
363 }
364 if(rRight.length()<=1) {
365 return res;
366 }
367 res.append(rRight,1,std::string::npos);
368 return res;
369}
370
371// Test directory
372bool DirectoryExists(const std::string& rDirectory) {
373#ifdef FAUDES_POSIX
374 DIR *thedir;
375 thedir=opendir(rDirectory.c_str());
376 if(thedir) closedir(thedir);
377 return thedir!= 0;
378#endif
379#ifdef FAUDES_WINDOWS
380 DWORD fattr = GetFileAttributesA(faudes_extpath(rDirectory).c_str());
381 return
382 (fattr!=INVALID_FILE_ATTRIBUTES) && (fattr & FILE_ATTRIBUTE_DIRECTORY);
383#endif
384 return false;
385}
386
387// scan directory
388std::set< std::string > ReadDirectory(const std::string& rDirectory) {
389 std::set< std::string > res;
390#ifdef FAUDES_POSIX
391 DIR *thedir;
392 struct dirent *theent;
393 thedir=opendir(rDirectory.c_str());
394 if(!thedir) return res;
395 while((theent=readdir(thedir))) {
396 std::string fname(theent->d_name);
397 if(fname==".") continue;
398 if(fname=="..") continue;
399 res.insert(fname);
400 }
401 closedir(thedir);
402#endif
403#ifdef FAUDES_WINDOWS
404 HANDLE hf;
405 WIN32_FIND_DATA data;
406 hf = FindFirstFile((rDirectory+"\\*.*").c_str(), &data);
407 if (hf != INVALID_HANDLE_VALUE) {
408 do {
409 std::string fname(data.cFileName);
410 if(fname==".") continue;
411 if(fname=="..") continue;
412 res.insert(fname);
413 } while (FindNextFile(hf, &data));
414 FindClose(hf);
415 }
416#endif
417 return res;
418}
419
420
421// Test file
422bool FileExists(const std::string& rFilename) {
423 std::fstream fp;
424 fp.open(rFilename.c_str(), std::ios::in | std::ios::binary);
425 return fp.good();
426}
427
428// Delete file
429bool FileDelete(const std::string& rFilename) {
430 return remove(rFilename.c_str()) == 0;
431}
432
433// Copy file
434bool FileCopy(const std::string& rFromFile, const std::string& rToFile) {
435 std::ifstream froms(rFromFile.c_str(), std::ios::binary);
436 std::ofstream tos(rToFile.c_str(), std::ios::binary);
437 tos << froms.rdbuf();
438 tos.flush();
439 return !(froms.fail() || tos.fail());
440}
441
442// ConsoleOut class
443// Note: console-out is not re-entrant; for multithreaded applications
444// you must derive a class that has built-in mutexes;
445ConsoleOut::ConsoleOut(void) : pStream(NULL), mVerb(1) {
446 pInstance=this;
447}
449 if(pStream) { pStream->flush(); delete pStream; }
450 if(this==smpInstance) smpInstance=NULL;
451}
463void ConsoleOut::ToFile(const std::string& filename) {
464 if(pStream) { pStream->flush(); delete pStream; }
465 pStream=NULL;
466 mFilename=filename;
467 if(mFilename=="") return;
468 pStream = new std::ofstream();
469 pStream->open(mFilename.c_str(),std::ios::app);
470}
472 return pStream!=NULL;
473}
474void ConsoleOut::Write(const std::string& message,long int cntnow, long int cntdone, int verb) {
475 DoWrite(message,cntnow,cntdone,verb);
476}
477void ConsoleOut::DoWrite(const std::string& message,long int cntnow, long int cntdone, int verb) {
478 (void) cntnow; (void) cntdone;
479 if(mVerb<verb) return;
480 std::ostream* sout=pStream;
481 if(!sout) sout=&std::cout; // tmoor: used to be std::cerr, using std::cout to facilitate emscripten/js
482 *sout << message;
483 sout->flush();
484}
485
486// global instance
488
489/** API wrapper Print at verbosity */
490void Print(int v, const std::string& message) {
491 // print
492 std::ostringstream line;
493 line << "FAUDES_PRINT: " << message << std::endl;
494 faudes::ConsoleOut::G()->Write(line.str(),0,0,v);
495 // still do loop callback
496 LoopCallback();
497}
498void Print(const std::string& message) {
499 Print(1,message);
500}
501
502/** API wrapper get/set verbosity */
503void Verbosity(int v) {
505}
506int Verbosity(void) {
507 return faudes::ConsoleOut::G()->Verb();
508}
509
510
511// debugging: objectcount
512std::map<std::string,long int>* ObjectCount::mspMax=NULL;
513std::map<std::string,long int>* ObjectCount::mspCount=NULL;
514bool ObjectCount::msDone=false;
516 mspCount= new std::map<std::string,long int>();
517 mspMax= new std::map<std::string,long int>();
518 msDone=true;
519}
521 if(!msDone) ObjectCount();
522}
523void ObjectCount::Inc(const std::string& rTypeName) {
524 if(!msDone) ObjectCount();
525 long int cnt = ((*mspCount)[rTypeName]+=1);
526 if((*mspMax)[rTypeName]<cnt) (*mspMax)[rTypeName]=cnt;
527}
528void ObjectCount::Dec(const std::string& rTypeName) {
529 if(!msDone) ObjectCount();
530 (*mspCount)[rTypeName]-=1;
531}
532
533
534// debugging: report on exit function
535void ExitFunction(void){
536#ifdef FAUDES_DEBUG_CODE
537 FAUDES_WRITE_CONSOLE("faudes::ExitFunction():");
538 // be sure its up and running
540 // get rid of all registry prototypes
541 //TypeRegistry::G()->ClearAll();
542 //FunctionRegistry::G()->Clear();
543 // prepare report
544 std::map<std::string,long int>::iterator cit;
545 cit=ObjectCount::mspCount->begin();
546 for(;cit!=ObjectCount::mspCount->end();cit++) {
547 FAUDES_WRITE_CONSOLE( cit->first << ": #" << ToStringInteger(cit->second) <<
548 " (max #" << (*ObjectCount::mspMax)[cit->first] << ")");
549 }
550#endif
551}
552
553
554#ifdef FAUDES_DEBUG_CODE
555// report on exit install
556class ExitFunctionInstall {
557private:
558 static bool mDone;
559 static ExitFunctionInstall mInstance;
560 ExitFunctionInstall(void) {
561 if(mDone) return;
562 FAUDES_WRITE_CONSOLE("ExitFunctionInstall()");
563 std::atexit(ExitFunction);
564 mDone=true;
565 }
566};
567// exit function: global data
568bool ExitFunctionInstall::mDone=false;
569ExitFunctionInstall ExitFunctionInstall::mInstance;
570#endif
571
572// test protocol: token writer and file
574std::string gTestProtocolFr;
575
576// test protocol: setup
577std::string TestProtocol(const std::string& rSource) {
579 // set up filename
580 std::string filename=rSource;
581 // fix empty source
582 if(filename=="") filename="faudes_dump";
583 // remove directory
584 filename=ExtractFilename(filename);
585 // remove extension
586 std::string::size_type pos=0;
587 for(;pos<filename.length();pos++)
588 if(filename.at(pos)=='.') filename.at(pos)='_';
589 // append extension
590 filename.append(".prot");
591 // record nominal case
592 gTestProtocolFr=filename;
593 // prepend prefix
594 filename.insert(0,"tmp_");
595 // initialise token writer
596 gTestProtocolTw= new TokenWriter(filename);
597 // report filename
598 return gTestProtocolFr;
599}
600
601// test protocol: dump
602void TestProtocol(const std::string& rMessage, const Type& rData, bool full) {
603 if(!gTestProtocolTw) return;
604 gTestProtocolTw->WriteComment("%%% test mark: " + rMessage);
605 if(full) rData.Write(*gTestProtocolTw);
606 else rData.SWrite(*gTestProtocolTw);
610 *gTestProtocolTw << "\n";
611}
612void TestProtocol(const std::string& rMessage, bool data) {
613 Boolean fbool(data);
614 TestProtocol(rMessage,fbool,true);
615}
616void TestProtocol(const std::string& rMessage, long int data) {
617 Integer fint(data);
618 TestProtocol(rMessage,fint,true);
619}
620void TestProtocol(const std::string& rMessage, const std::string& rData) {
621 String fstr(rData);
622 TestProtocol(rMessage,fstr,true);
623}
624
625// test protocol: compare
626bool TestProtocol(void) {
627 // bail out on no protocol
628 if(!gTestProtocolTw) return true;
629 // close protocol file
630 std::string prot=gTestProtocolTw->FileName();
631 delete gTestProtocolTw;
632 gTestProtocolTw=NULL;
633 // open protocol
634 std::fstream fp;
635 fp.open(prot.c_str(), std::ios::in | std::ios::binary);
636 if(!fp.good()) {
637 FAUDES_WRITE_CONSOLE("TestProtocol(): could not open protocol \"" << prot << "\"");
638 return false;
639 }
640 // open reference
641 std::string ref=gTestProtocolFr;
642 std::fstream fr;
643 fr.open(ref.c_str(), std::ios::in | std::ios::binary);
644 if(!fr.good()) {
645 ref="data"+faudes_pathsep()+ref;
646 fr.clear(); // mingw's runtime will not clear on open
647 fr.open(ref.c_str(), std::ios::in | std::ios::binary);
648 }
649 if(!fr.good()) {
650 FAUDES_WRITE_CONSOLE("TestProtocol(): could not open/find reference \"" << gTestProtocolFr << "\"");
651 return true;
652 }
653 // perform comparision
654 int dline=-1;
655 int cline=1;
656 try{
657 while(true) {
658 // read next char
659 char cp = fp.get();
660 char cr= fr.get();
661 // eof
662 if(fp.eof() && fr.eof()) { break; }
663 if(!fp.good() || !fr.good()) { dline=cline; break;}
664 // cheap normalize cr/lf: ignore \r (assume no double \r
665 if( cp=='\r' && cr =='\r') continue;
666 if( cp=='\r' && fp.eof()){ dline=cline; break;}
667 if( cp=='\r') cp = fp.get();
668 if( cr=='\r' && fr.eof()){ dline=cline; break;}
669 if( cr=='\r') cr = fr.get();
670 // count lines
671 if( cr=='\n') cline++;
672 // sense mitmatch
673 if( cp!= cr ){dline=cline; break;}
674 }
675 } catch(std::ios::failure&) {
676 throw Exception("TestProtocol()", "io error at line " + ToStringInteger(cline), 1);
677 }
678 // done
679 if(dline>=0) {
680 FAUDES_WRITE_CONSOLE("TestProtocol(): using reference " << ref << "");
681 FAUDES_WRITE_CONSOLE("TestProtocol(): found difference at line " << dline << "");
682 }
683 return dline== -1;
684}
685
686
687
688// declare loop callback
689static bool (*gBreakFnct)(void)=0;
690
691// set loop callback
692void LoopCallback( bool pBreak(void)) {
693 gBreakFnct=pBreak;
694}
695
696// do loop callback
697// note: this function is meant to be "quiet" during normal
698// operation in order not to mess up console logging
699void LoopCallback(void){
700 if(!gBreakFnct) return;
701 if(! (*gBreakFnct)() ) return;
702 throw Exception("LoopCallback", "break on application request", 110);
703}
704
705} // namespace faudes
#define FAUDES_WRITE_CONSOLE(message)
#define FD_DF(message)
const std::string & faudes_pathseps(void)
std::string faudes_extpath(const std::string &rPath)
const std::string & faudes_pathsep(void)
static ConsoleOut * G(void)
ConsoleOut * pInstance
Definition cfl_utils.h:375
std::ofstream * pStream
Definition cfl_utils.h:369
static ConsoleOut * smpInstance
Definition cfl_utils.h:377
virtual void DoWrite(const std::string &message, long int cntnow=0, long int cntdone=0, int verb=1)
virtual ~ConsoleOut(void)
void Verb(int verb)
Definition cfl_utils.h:358
const std::string & Filename(void)
Definition cfl_utils.h:354
virtual void Write(const std::string &message, long int cntnow=0, long int cntdone=0, int verb=1)
std::string mFilename
Definition cfl_utils.h:371
void Redirect(ConsoleOut *out)
void ToFile(const std::string &filename)
static bool msDone
Definition cfl_utils.h:405
static void Init(void)
static void Inc(const std::string &rTypeName)
static void Dec(const std::string &rTypeName)
static std::map< std::string, long int > * mspCount
Definition cfl_utils.h:403
static std::map< std::string, long int > * mspMax
Definition cfl_utils.h:402
std::string FileName(void) const
void WriteComment(const std::string &rComment)
void Write(const Type *pContext=0) const
void SWrite(TokenWriter &rTw) const
uint32_t Idx
std::string VersionString()
std::string ExtractDirectory(const std::string &rFullPath)
bool DotReady(const std::string &rDotExec)
int Verbosity(void)
std::string PrependPath(const std::string &rLeft, const std::string &rRight)
Idx ToIdx(const std::string &rString)
TokenWriter * gTestProtocolTw
void ProcessDot(const std::string &rDotFile, const std::string &rOutFile, const std::string &rOutFormat, const std::string &rDotExec)
std::string CreateTempFile(void)
bool FileCopy(const std::string &rFromFile, const std::string &rToFile)
void LoopCallback(void)
std::string PluginsString()
std::string ExpandString(const std::string &rString, unsigned int len)
Definition cfl_utils.cpp:80
static bool(* gBreakFnct)(void)=0
std::string BuildString()
bool TestProtocol(void)
bool FileDelete(const std::string &rFilename)
std::string ToStringFloat(Float number)
Definition cfl_utils.cpp:64
std::string ExtractFilename(const std::string &rFullPath)
std::string ToStringInteger16(Int number)
Definition cfl_utils.cpp:54
double Float
std::string ContributorsString()
std::string ToStringInteger(Int number)
Definition cfl_utils.cpp:43
std::set< std::string > ReadDirectory(const std::string &rDirectory)
std::string StringSubstitute(const std::string &rString, const std::string &rFrom, const std::string &rTo)
std::string ToLowerCase(const std::string &rString)
void Print(int v, const std::string &message)
std::string gTestProtocolFr
std::string ExtractBasename(const std::string &rFullPath)
bool DirectoryExists(const std::string &rDirectory)
void ExitFunction(void)
bool FileExists(const std::string &rFilename)
std::string ExtractSuffix(const std::string &rFullPath)
std::string CollapsString(const std::string &rString, unsigned int len)
Definition cfl_utils.cpp:91
long int Int

libFAUDES 2.34e --- 2026.03.16 --- c++ api documentaion by doxygen