Structural deformable models
Functions | Variables
utils.cpp File Reference
#include <stdlib.h>
#include <fstream>
#include <string>
#include "utils.h"
Include dependency graph for utils.cpp:

Go to the source code of this file.

Functions

const string & __set_fnmatchpattern (const string &pattern)
 
int __fixed_fnmatch (const struct dirent *dent)
 
const char * getTemp ()
 
string & replaceAll (string &txt, char src, char tar)
 
int matlabCall (const std::string &cmd)
 

Variables

static string matlabprog = "matlab -nojvw -nosplash -nodesktop -r "
 
static string matpath = "./"
 
static string __fnmatchpattern
 

Function Documentation

int __fixed_fnmatch ( const struct dirent *  dent)

Definition at line 21 of file utils.cpp.

References __fnmatchpattern.

Referenced by __set_fnmatchpattern(), and fromString().

22 { return 0; }
const string& __set_fnmatchpattern ( const string &  pattern)

Definition at line 15 of file utils.cpp.

References __fixed_fnmatch(), and __fnmatchpattern.

Referenced by FFind::find(), and fromString().

16 { return __fnmatchpattern = pattern; }
static string __fnmatchpattern
Definition: utils.cpp:14
const char* getTemp ( )

Definition at line 25 of file utils.cpp.

Referenced by fromString().

26 {
27  const char* tc = getenv("TEMP");
28  if(!tc) tc = getenv("TMP");
29  return tc;
30 }
int matlabCall ( const std::string &  cmd)

Definition at line 41 of file utils.cpp.

References matlabprog.

Referenced by fromString().

42 {
43  return system((matlabprog+"\""+cmd+", exit\"").c_str());
44 }
static string matlabprog
Definition: utils.cpp:11
string& replaceAll ( string &  txt,
char  src,
char  tar 
)

Definition at line 32 of file utils.cpp.

Referenced by fromString().

33 {
34  int pos = 0;
35  while((pos = txt.find(src,pos)) != (int)txt.npos) {
36  txt[pos++] = tar;
37  }
38  return txt;
39 }

Variable Documentation

string __fnmatchpattern
static

Definition at line 14 of file utils.cpp.

Referenced by __set_fnmatchpattern().

string matlabprog = "matlab -nojvw -nosplash -nodesktop -r "
static

Definition at line 11 of file utils.cpp.

Referenced by matlabCall().

string matpath = "./"
static

Definition at line 12 of file utils.cpp.