Doxygen
Loading...
Searching...
No Matches
portable.h
Go to the documentation of this file.
1#ifndef PORTABLE_H
2#define PORTABLE_H
3
4#include <stdio.h>
5#include <sys/types.h>
6#include <stdint.h>
7
8#include <fstream>
9
10#include "containers.h"
11#include "qcstring.h"
12
13class Buf;
14
15/** @file
16 * @brief Portable versions of functions that are platform dependent.
17 */
18
19namespace Portable
20{
21 int system(const QCString &command,const QCString &args,bool commandHasConsole=true);
22 uint32_t pid();
23 QCString getenv(const QCString &variable);
24 void setenv(const QCString &variable,const QCString &value);
25 void unsetenv(const QCString &variable);
26 FILE * fopen(const QCString &fileName,const QCString &mode);
27 int fclose(FILE *f);
28 void unlink(const QCString &fileName);
31 const char * ghostScriptCommand();
32 const char * commandExtension();
34 FILE * popen(const QCString &name,const QCString &type);
35 int pclose(FILE *stream);
36 double getSysElapsedTime();
37 bool isAbsolutePath(const QCString &fileName);
38 void correctPath(const StringVector &list);
39 void setShortDir();
40 const char * strnstr(const char *haystack, const char *needle, size_t haystack_len);
41 const char * devNull();
42 bool checkForExecutable(const QCString &fileName);
43 size_t recodeUtf8StringToW(const QCString &inputStr,uint16_t **buf);
44 std::ofstream openOutputStream(const QCString &name,bool append=false);
45 std::ifstream openInputStream(const QCString &name,bool binary=false,bool openAtEnd=false);
46}
47
48
49extern "C" {
50 void * portable_iconv_open(const char *tocode, const char *fromcode);
51 size_t portable_iconv (void *cd, const char** inbuf, size_t *inbytesleft,
52 char* * outbuf, size_t *outbytesleft);
53 int portable_iconv_close (void *cd);
54}
55
56#endif
57
This is an alternative implementation of QCString.
Definition qcstring.h:101
std::vector< std::string > StringVector
Definition containers.h:33
std::ifstream openInputStream(const QCString &name, bool binary=false, bool openAtEnd=false)
Definition portable.cpp:676
void correctPath(const StringVector &list)
Correct a possible wrong PATH variable.
Definition portable.cpp:533
bool isAbsolutePath(const QCString &fileName)
Definition portable.cpp:514
QCString pathSeparator()
Definition portable.cpp:391
FILE * popen(const QCString &name, const QCString &type)
Definition portable.cpp:496
std::ofstream openOutputStream(const QCString &name, bool append=false)
Definition portable.cpp:665
double getSysElapsedTime()
Definition portable.cpp:98
QCString pathListSeparator()
Definition portable.cpp:400
bool checkForExecutable(const QCString &fileName)
Definition portable.cpp:440
void unlink(const QCString &fileName)
Definition portable.cpp:561
const char * ghostScriptCommand()
Definition portable.cpp:454
FILE * fopen(const QCString &fileName, const QCString &mode)
Definition portable.cpp:366
uint32_t pid()
Definition portable.cpp:265
int pclose(FILE *stream)
Definition portable.cpp:505
size_t recodeUtf8StringToW(const QCString &inputStr, uint16_t **buf)
Definition portable.cpp:640
bool fileSystemIsCaseSensitive()
Definition portable.cpp:487
int system(const QCString &command, const QCString &args, bool commandHasConsole=true)
Definition portable.cpp:106
void setenv(const QCString &variable, const QCString &value)
Definition portable.cpp:303
void unsetenv(const QCString &variable)
Definition portable.cpp:318
const char * commandExtension()
Definition portable.cpp:478
const char * strnstr(const char *haystack, const char *needle, size_t haystack_len)
Definition portable.cpp:617
QCString getenv(const QCString &variable)
Definition portable.cpp:338
const char * devNull()
Definition portable.cpp:631
int fclose(FILE *f)
Definition portable.cpp:386
void setShortDir()
Definition portable.cpp:570
int portable_iconv_close(void *cd)
size_t portable_iconv(void *cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
void * portable_iconv_open(const char *tocode, const char *fromcode)