25 #include <sys/types.h> 27 #include <tulip/tulipconf.h> 30 typedef struct _stat tlp_stat_t;
32 typedef struct stat tlp_stat_t;
50 inline void tlp_hash_combine(std::size_t &seed,
const T &v) {
52 seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
57 extern TLP_SCOPE
const char PATH_DELIMITER;
58 extern TLP_SCOPE std::string TulipLibDir;
59 extern TLP_SCOPE std::string TulipPluginsPath;
60 extern TLP_SCOPE std::string TulipBitmapDir;
61 extern TLP_SCOPE std::string TulipShareDir;
76 extern TLP_SCOPE
void initTulipLib(
const char *appDirPath =
nullptr);
86 TLP_SCOPE std::string
demangleClassName(
const char *className,
bool hideTlp =
false);
107 TLP_SCOPE std::istream *
getIgzstream(
const std::string &name,
int open_mode = std::ios::in);
117 TLP_SCOPE std::ostream *
getOgzstream(
const std::string &name,
int open_mode = std::ios::out);
162 TLP_SCOPE
int statPath(
const std::string &pathname, tlp_stat_t *buf);
173 std::ios_base::openmode open_mode = std::ios::in);
184 std::ios_base::openmode open_mode = std::ios::out);
188 TLP_SCOPE
bool inGuiTestingMode();
190 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.