25 #include <sys/types.h>
26 #include <tulip/tulipconf.h>
43 inline void tlp_hash_combine(std::size_t &seed,
const T &v) {
45 seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
50 extern TLP_SCOPE
const char PATH_DELIMITER;
51 extern TLP_SCOPE std::string TulipLibDir;
52 extern TLP_SCOPE std::string TulipPluginsPath;
53 extern TLP_SCOPE std::string TulipBitmapDir;
54 extern TLP_SCOPE std::string TulipShareDir;
55 extern TLP_SCOPE
bool TulipProgramExiting;
70 extern TLP_SCOPE
void initTulipLib(
const char *appDirPath =
nullptr);
101 TLP_SCOPE std::istream *
getIgzstream(
const std::string &name,
int open_mode = std::ios::in);
111 TLP_SCOPE std::ostream *
getOgzstream(
const std::string &name,
int open_mode = std::ios::out);
167 std::ios_base::openmode open_mode = std::ios::in);
178 std::ios_base::openmode open_mode = std::ios::out);
187 TLP_SCOPE
bool inGuiTestingMode();
188 TLP_SCOPE
void setGuiTestingMode(
bool);
190 TLP_SCOPE
void registerTulipExitHandler();
std::string demangleTlpClassName(const char *className)
Demangles the name of a C++ class defined in the tlp namespace.
void initTulipLib(const char *appDirPath=nullptr)
Initializes the Tulip library. Looks for the Tulip plug-ins directory. The plug-ins directory can be ...
std::string demangleClassName(const char *className, bool hideTlp=false)
Demangles the name of a C++ class.
unsigned int randomUnsignedInteger(unsigned int max)
Returns a random unsigned integer in the range [0, max].
bool pathExist(const std::string &pathname)
returns if a path exists
char * getStrError()
Returns the error message associated to errno.
double randomDouble(double max=1.0)
Returns a random double in the range [0, max].
unsigned int getSeedOfRandomSequence()
Returns the value of the seed used for further initialization of a random sequence.
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...
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...
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...
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...
void setSeedOfRandomSequence(unsigned int seed=UINT_MAX)
Gives the value of the seed used for further initialization of a random sequence (with further calls ...
int randomInteger(int max)
Returns a random integer in the range [0, max] if max is positive or in the range [max,...