Doxygen
portable.h
浏览该文件的文档.
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 "qcstring.h"
9 
10 class Buf;
11 
12 #if defined(_WIN32)
13 typedef __int64 portable_off_t;
14 #else
15 typedef off_t portable_off_t;
16 #endif
17 
18 /** @file
19  * @brief Portable versions of functions that are platform dependent.
20  */
21 
22 namespace Portable
23 {
24  int system(const QCString &command,const QCString &args,bool commandHasConsole=true);
25  unsigned int pid();
26  QCString getenv(const QCString &variable);
27  void setenv(const QCString &variable,const QCString &value);
28  void unsetenv(const QCString &variable);
29  portable_off_t fseek(FILE *f,portable_off_t offset, int whence);
30  portable_off_t ftell(FILE *f);
31  FILE * fopen(const QCString &fileName,const QCString &mode);
32  int fclose(FILE *f);
33  void unlink(const QCString &fileName);
36  const char * ghostScriptCommand();
37  const char * commandExtension();
39  FILE * popen(const QCString &name,const QCString &type);
40  int pclose(FILE *stream);
41  void sysTimerStart();
42  void sysTimerStop();
43  double getSysElapsedTime();
44  void sleep(int ms);
45  bool isAbsolutePath(const QCString &fileName);
46  void correct_path();
47  void setShortDir();
48  const char * strnstr(const char *haystack, const char *needle, size_t haystack_len);
49  const char * devNull();
50  bool checkForExecutable(const QCString &fileName);
51  size_t recodeUtf8StringToW(const QCString &inputStr,uint16_t **buf);
52 }
53 
54 
55 extern "C" {
56  void * portable_iconv_open(const char *tocode, const char *fromcode);
57  size_t portable_iconv (void *cd, const char** inbuf, size_t *inbytesleft,
58  char* * outbuf, size_t *outbytesleft);
59  int portable_iconv_close (void *cd);
60 }
61 
62 #endif
63 
portable_iconv
size_t portable_iconv(void *cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
Portable::popen
FILE * popen(const QCString &name, const QCString &type)
Definition: portable.cpp:452
Portable::fileSystemIsCaseSensitive
bool fileSystemIsCaseSensitive()
Definition: portable.cpp:443
Portable::pathSeparator
QCString pathSeparator()
Definition: portable.cpp:347
Portable::fopen
FILE * fopen(const QCString &fileName, const QCString &mode)
Definition: portable.cpp:322
Portable::devNull
const char * devNull()
Definition: portable.cpp:595
portable_off_t
off_t portable_off_t
Definition: portable.h:10
portable_iconv_open
void * portable_iconv_open(const char *tocode, const char *fromcode)
qcstring.h
Portable::recodeUtf8StringToW
size_t recodeUtf8StringToW(const QCString &inputStr, uint16_t **buf)
Definition: portable.cpp:604
Portable::getenv
QCString getenv(const QCString &variable)
Definition: portable.cpp:279
Portable
Definition: portable.h:22
Portable::setShortDir
void setShortDir()
Definition: portable.cpp:534
Portable::unsetenv
void unsetenv(const QCString &variable)
Definition: portable.cpp:260
Portable::strnstr
const char * strnstr(const char *haystack, const char *needle, size_t haystack_len)
Definition: portable.cpp:581
Portable::ghostScriptCommand
const char * ghostScriptCommand()
Definition: portable.cpp:410
Portable::sysTimerStart
void sysTimerStart()
Definition: portable.cpp:470
Portable::fclose
int fclose(FILE *f)
Definition: portable.cpp:342
Portable::pclose
int pclose(FILE *stream)
Definition: portable.cpp:461
Portable::correct_path
void correct_path()
Correct a possible wrong PATH variable
Definition: portable.cpp:515
Portable::system
int system(const QCString &command, const QCString &args, bool commandHasConsole=true)
Definition: portable.cpp:42
Portable::getSysElapsedTime
double getSysElapsedTime()
Definition: portable.cpp:482
Portable::pathListSeparator
QCString pathListSeparator()
Definition: portable.cpp:356
Portable::fseek
portable_off_t fseek(FILE *f, portable_off_t offset, int whence)
Definition: portable.cpp:300
Portable::checkForExecutable
bool checkForExecutable(const QCString &fileName)
Definition: portable.cpp:396
Portable::sysTimerStop
void sysTimerStop()
Definition: portable.cpp:475
Portable::pid
unsigned int pid()
Definition: portable.cpp:207
Portable::setenv
void setenv(const QCString &variable, const QCString &value)
Definition: portable.cpp:246
Portable::sleep
void sleep(int ms)
Definition: portable.cpp:487
Portable::isAbsolutePath
bool isAbsolutePath(const QCString &fileName)
Definition: portable.cpp:496
Portable::commandExtension
const char * commandExtension()
Definition: portable.cpp:434
portable_iconv_close
int portable_iconv_close(void *cd)
Portable::unlink
void unlink(const QCString &fileName)
Definition: portable.cpp:525
Portable::ftell
portable_off_t ftell(FILE *f)
Definition: portable.cpp:311
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108