libqi  1.14.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Classes | Functions
qi::os Namespace Reference

OS abstraction layer. More...

Classes

class  QiException
 Custom exception that may be thrown by QI methods. More...
struct  timeval
 qi::os::timeval struct similar to POSIX timeval More...

Functions

QI_API FILE * fopen (const char *filename, const char *mode)
 Open a file.
QI_API int stat (const char *filename, struct stat *pstat)
 Get file status.
QI_API int checkdbg ()
 Check if the current program is running under a debugger.
QI_API std::string home ()
 Return path to the current user's HOME.
QI_API std::string mktmpdir (const char *prefix="")
 Return a writable temporary directory.The caller is responsible of destroying the returned directory. This will create a unique directory in the temporary directory returned by qi::os::tmp(). The specified prefix will be prefixed to a generated unique name.
QI_API std::string tmp ()
 Return the system's temporary directory.The directory is writeable and exits. The caller is responsible of destroying the temporary file create.
QI_API std::string gethostname ()
 Get the system's hostname.An empty string is returned on failure.
QI_API int getpid ()
QI_API int kill (int pid, int sig)
QI_API bool hostIPAddrs (std::map< std::string, std::vector< std::string > > &ifsMap)
QI_API_DEPRECATED QI_API
std::string 
tmpdir (const char *prefix="")
 Return a temporary directory.look at qi::os::mktmpdir.
Environment Functions
QI_API std::string getenv (const char *var)
 Get an environment variable.
QI_API int setenv (const char *var, const char *value)
 Change or add an environment variable.
Time Functions
QI_API void sleep (unsigned int seconds)
 Sleep for the specified number of seconds.
QI_API void msleep (unsigned int milliseconds)
 Sleep for the specified number of milliseconds.
QI_API int gettimeofday (qi::os::timeval *tp)
 The gettimeofday() function shall obtain the current time, expressed as seconds and microseconds since the Epoch, and store it in the timeval structure pointed to by tp. The resolution of the system clock is unspecified. This clock is subject to NTP adjustments.
Shared Library Functions
QI_API void * dlopen (const char *filename, int flag=-1)
 Loads dynamic library.
QI_API int dlclose (void *handle)
 Decrements the reference count on the dynamic library.
QI_API void * dlsym (void *handle, const char *symbol)
 Get the address where the symbol is loaded into memory.
QI_API const char * dlerror (void)
 Returns a human readable string.
Process Functions
QI_API int spawnvp (char *const argv[])
 Create and execute a new process.
QI_API int spawnlp (const char *argv,...)
 Create and execute a new process.
QI_API int system (const char *command)
 Execute a shell command.
QI_API int waitpid (int pid, int *status)
 Wait for process to change state.
QI_API unsigned short findAvailablePort (unsigned short port)
 Find the first available port starting at `port`.

Detailed Description

OS abstraction layer.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines