25 #include <sys/types.h> 27 #include <tulip/tulipconf.h> 30 typedef struct _stat tlp_stat_t;
32 typedef struct stat tlp_stat_t;
36 extern TLP_SCOPE
const char PATH_DELIMITER;
37 extern TLP_SCOPE std::string TulipLibDir;
38 extern TLP_SCOPE std::string TulipPluginsPath;
39 extern TLP_SCOPE std::string TulipBitmapDir;
40 extern TLP_SCOPE std::string TulipShareDir;
55 extern TLP_SCOPE
void initTulipLib(
const char *appDirPath =
nullptr);
65 TLP_SCOPE std::string
demangleClassName(
const char *className,
bool hideTlp =
false);
86 TLP_SCOPE std::istream *
getIgzstream(
const std::string &name,
int open_mode = std::ios::in);
96 TLP_SCOPE std::ostream *
getOgzstream(
const std::string &name,
int open_mode = std::ios::out);
141 TLP_SCOPE
int statPath(
const std::string &pathname, tlp_stat_t *buf);
152 std::ios_base::openmode open_mode = std::ios::in);
163 std::ios_base::openmode open_mode = std::ios::out);
167 TLP_SCOPE
bool inGuiTestingMode();
169 TLP_SCOPE
void setGuiTestingMode(
bool);
double randomDouble(double max=1.0)
Returns a random double in the range [0, max].
int statPath(const std::string &pathname, tlp_stat_t *buf)
Cross-platform function to stat a path on a filesystem. Its purpose is to support paths on windows pl...
std::ostream * getOutputFileStream(const std::string &filename, std::ios_base::openmode open_mode=std::ios::out)
Cross-platform function to get an output file stream. Its purpose is to support paths on windows plat...
void initTulipLib(const char *appDirPath=nullptr)
Initializes the Tulip library. Looks for the Tulip plug-ins directory. The plug-ins directory can be ...
int randomInteger(int max)
Returns a random integer in the range [0, max] if max is positive or in the range [max...
unsigned int randomUnsignedInteger(unsigned int max)
Returns a random unsigned integer in the range [0, max].
unsigned int getSeedOfRandomSequence()
Returns the value of the seed used for further initialization of a random sequence.
std::string demangleTlpClassName(const char *className)
Demangles the name of a C++ class defined in the tlp namespace.
std::istream * getInputFileStream(const std::string &filename, std::ios_base::openmode open_mode=std::ios::in)
Cross-platform function to get an input file stream. Its purpose is to support paths on windows platf...
std::istream * getIgzstream(const std::string &name, int open_mode=std::ios::in)
Returns an istream to read from a gzipped file (uses gzstream lib). The stream has to be deleted afte...
void initRandomSequence()
Initializes a random sequence with the seed previously set Further calls to rand() or random() will r...
std::ostream * getOgzstream(const std::string &name, int open_mode=std::ios::out)
Returns an ostream to write to a gzipped file (uses gzstream lib). The stream has to be deleted after...
void setSeedOfRandomSequence(unsigned int seed=UINT_MAX)
Gives the value of the seed used for further initialization of a random sequence (with further calls ...
std::string demangleClassName(const char *className, bool hideTlp=false)
Demangles the name of a C++ class.