Doxygen
Loading...
Searching...
No Matches
Portable Namespace Reference

Functions

int system (const QCString &command, const QCString &args, bool commandHasConsole=true)
uint32_t pid ()
QCString getenv (const QCString &variable)
void setenv (const QCString &variable, const QCString &value)
void unsetenv (const QCString &variable)
FILE * fopen (const QCString &fileName, const QCString &mode)
int fclose (FILE *f)
void unlink (const QCString &fileName)
QCString pathSeparator ()
QCString pathListSeparator ()
const char * ghostScriptCommand ()
const char * commandExtension ()
bool fileSystemIsCaseSensitive ()
FILE * popen (const QCString &name, const QCString &type)
int pclose (FILE *stream)
double getSysElapsedTime ()
bool isAbsolutePath (const QCString &fileName)
void correctPath (const StringVector &list)
 Correct a possible wrong PATH variable.
void setShortDir ()
const char * strnstr (const char *haystack, const char *needle, size_t haystack_len)
const char * devNull ()
bool checkForExecutable (const QCString &fileName)
size_t recodeUtf8StringToW (const QCString &inputStr, uint16_t **buf)
std::ofstream openOutputStream (const QCString &name, bool append=false)
std::ifstream openInputStream (const QCString &name, bool binary=false, bool openAtEnd=false)

Function Documentation

◆ checkForExecutable()

bool Portable::checkForExecutable ( const QCString & fileName)

Definition at line 424 of file portable.cpp.

425{
426#if defined(_WIN32) && !defined(__CYGWIN__)
427 const char *extensions[] = {".bat",".com",".exe"};
428 for (int i = 0; i < sizeof(extensions) / sizeof(*extensions); i++)
429 {
430 if (ExistsOnPath(fileName + extensions[i])) return true;
431 }
432 return false;
433#else
434 return ExistsOnPath(fileName);
435#endif
436}
static bool ExistsOnPath(const QCString &fileName)
Definition portable.cpp:393

References ExistsOnPath().

Referenced by generateFormula().

◆ commandExtension()

const char * Portable::commandExtension ( )

Definition at line 462 of file portable.cpp.

463{
464#if defined(_WIN32) && !defined(__CYGWIN__)
465 return ".exe";
466#else
467 return "";
468#endif
469}

Referenced by Config::checkAndCorrect(), computeVerifiedDotPath(), and writeDiaGraphFromFile().

◆ correctPath()

void Portable::correctPath ( const StringVector & extraPaths)

Correct a possible wrong PATH variable.

This routine was inspired by the cause for bug 766059 was that in the Windows path there were forward slashes.

Definition at line 517 of file portable.cpp.

518{
519 QCString p = Portable::getenv("PATH");
520 bool first=true;
521 QCString result;
522#if defined(_WIN32) && !defined(__CYGWIN__)
523 for (const auto &path : extraPaths)
524 {
525 if (!first) result+=';';
526 first=false;
527 result += substitute(path,"/","\\");
528 }
529 if (!result.isEmpty() && !p.isEmpty()) result+=';';
530 result += substitute(p,"/","\\");
531#else
532 for (const auto &path : extraPaths)
533 {
534 if (!first) result+=':';
535 first=false;
536 result += path;
537 }
538 if (!result.isEmpty() && !p.isEmpty()) result+=':';
539 result += p;
540#endif
541 if (result!=p) Portable::setenv("PATH",result.data());
542 //printf("settingPath(%s) #extraPaths=%zu\n",Portable::getenv("PATH").data(),extraPaths.size());
543}
This is an alternative implementation of QCString.
Definition qcstring.h:101
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:172
void setenv(const QCString &variable, const QCString &value)
Definition portable.cpp:287
QCString getenv(const QCString &variable)
Definition portable.cpp:322
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition qcstring.cpp:482

References QCString::data(), getenv(), QCString::isEmpty(), setenv(), and substitute().

Referenced by parseInput().

◆ devNull()

const char * Portable::devNull ( )

Definition at line 615 of file portable.cpp.

616{
617#if defined(_WIN32) && !defined(__CYGWIN__)
618 return "NUL";
619#else
620 return "/dev/null";
621#endif
622}

Referenced by createDVIFile(), createSVGFromPDFviaInkscape(), and determineInkscapeVersion().

◆ fclose()

int Portable::fclose ( FILE * f)

Definition at line 370 of file portable.cpp.

371{
372 return ::fclose(f);
373}

Referenced by OutputGenerator::endPlainFile(), finishWarnExit(), and initWarningFormat().

◆ fileSystemIsCaseSensitive()

bool Portable::fileSystemIsCaseSensitive ( )

Definition at line 471 of file portable.cpp.

472{
473#if defined(_WIN32) || defined(macintosh) || defined(__MACOSX__) || defined(__APPLE__) || defined(__CYGWIN__)
474 return FALSE;
475#else
476 return TRUE;
477#endif
478}
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34

References FALSE, and TRUE.

Referenced by findFileDef(), getCaseSenseNames(), and getFilterFromList().

◆ fopen()

FILE * Portable::fopen ( const QCString & fileName,
const QCString & mode )

Definition at line 350 of file portable.cpp.

351{
352#if defined(_WIN32) && !defined(__CYGWIN__)
353 uint16_t *fn = nullptr;
354 size_t fn_len = recodeUtf8StringToW(fileName,&fn);
355 uint16_t *m = nullptr;
356 size_t m_len = recodeUtf8StringToW(mode,&m);
357 FILE *result = nullptr;
358 if (fn_len!=(size_t)-1 && m_len!=(size_t)-1)
359 {
360 result = _wfopen((wchar_t*)fn,(wchar_t*)m);
361 }
362 delete[] fn;
363 delete[] m;
364 return result;
365#else
366 return ::fopen(fileName.data(),mode.data());
367#endif
368}
size_t recodeUtf8StringToW(const QCString &inputStr, uint16_t **buf)
Definition portable.cpp:624

References QCString::data(), and recodeUtf8StringToW().

Referenced by checkPngResult(), FilterCache::getFileContentsPipe(), initWarningFormat(), DotRunner::run(), OutputGenerator::startPlainFile(), and tryPath().

◆ getenv()

QCString Portable::getenv ( const QCString & variable)

Definition at line 322 of file portable.cpp.

323{
324#if defined(_WIN32) && !defined(__CYGWIN__)
325 #define ENV_BUFSIZE 32768
326 LPTSTR pszVal = (LPTSTR) malloc(ENV_BUFSIZE*sizeof(TCHAR));
327 if (GetEnvironmentVariable(variable.data(),pszVal,ENV_BUFSIZE) == 0) return "";
328 QCString out;
329 out = pszVal;
330 free(pszVal);
331 return out;
332 #undef ENV_BUFSIZE
333#else
334 if(!environmentLoaded) // if the environment variables are not loaded already...
335 { // ...call loadEnvironment to store them in class
337 }
338
339 if (proc_env.find(variable.str()) != proc_env.end())
340 {
341 return QCString(proc_env[variable.str()]);
342 }
343 else
344 {
345 return QCString();
346 }
347#endif
348}
const std::string & str() const
Definition qcstring.h:552
static bool environmentLoaded
Definition portable.cpp:38
static std::map< std::string, std::string > proc_env
Definition portable.cpp:39
void loadEnvironment()
Definition portable.cpp:261

References QCString::data(), environmentLoaded, loadEnvironment(), proc_env, and QCString::str().

Referenced by correctPath(), ExistsOnPath(), getCurrentDateTime(), initDoxygen(), parseInput(), setDotFontPath(), and substEnvVarsInString().

◆ getSysElapsedTime()

double Portable::getSysElapsedTime ( )

Definition at line 98 of file portable.cpp.

99{
101}
double elapsedTime() const
Definition portable.cpp:73
static SysTimeKeeper & instance()
Definition portable.cpp:85

References SysTimeKeeper::elapsedTime(), and SysTimeKeeper::instance().

Referenced by generateOutput().

◆ ghostScriptCommand()

const char * Portable::ghostScriptCommand ( )

Definition at line 438 of file portable.cpp.

439{
440#if defined(_WIN32) && !defined(__CYGWIN__)
441 static const char *gsexe = nullptr;
442 if (!gsexe)
443 {
444 const char *gsExec[] = {"gswin32c.exe","gswin64c.exe"};
445 for (int i = 0; i < sizeof(gsExec) / sizeof(*gsExec); i++)
446 {
447 if (ExistsOnPath(gsExec[i]))
448 {
449 gsexe = gsExec[i];
450 return gsexe;
451 }
452 }
453 gsexe = gsExec[0];
454 return gsexe;
455 }
456 return gsexe;
457#else
458 return "gs";
459#endif
460}

References ExistsOnPath().

Referenced by createCroppedEPS(), createCroppedPDF(), createEPSbboxFile(), createPNG(), and writeMakeBat().

◆ isAbsolutePath()

bool Portable::isAbsolutePath ( const QCString & fileName)

Definition at line 498 of file portable.cpp.

499{
500 const char *fn = fileName.data();
501# ifdef _WIN32
502 if (fileName.length()>1 && isalpha(fileName[0]) && fileName[1]==':') fn+=2;
503# endif
504 char const fst = fn[0];
505 if (fst == '/') return true;
506# ifdef _WIN32
507 if (fst == '\\') return true;
508# endif
509 return false;
510}
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:166

References QCString::data(), and QCString::length().

Referenced by findFile(), findFile(), generateOutput(), Markdown::Private::processLink(), and readTextFileByName().

◆ openInputStream()

std::ifstream Portable::openInputStream ( const QCString & name,
bool binary = false,
bool openAtEnd = false )

Definition at line 660 of file portable.cpp.

661{
662 std::ios_base::openmode mode = std::ifstream::in | std::ifstream::binary;
663 if (binary) mode |= std::ios::binary;
664 if (openAtEnd) mode |= std::ios::ate;
665#if defined(__clang__) && defined(__MINGW32__)
666 return std::ifstream(fs::path(fileName.str()).wstring(), mode);
667#else
668 return std::ifstream(fs::path(fileName.str()), mode);
669#endif
670}

References QCString::str().

Referenced by configFileToString(), convertMapFile(), DotFilePatcher::convertMapFile(), determineInkscapeVersion(), finishWarnExit(), CitationManager::generatePage(), FormulaManager::initFromRepository(), CitationManager::insertCrossReferencesForBibFile(), Htags::loadFilemap(), preProcessFile(), DotRunner::readBoundingBox(), FilterCache::readFragmentFromFile(), readInputFile(), readSVGSize(), resetPDFSize(), DotFilePatcher::run(), sameMd5Signature(), testRTFOutput(), and updateEPSBoundingBox().

◆ openOutputStream()

std::ofstream Portable::openOutputStream ( const QCString & name,
bool append = false )

Definition at line 649 of file portable.cpp.

650{
651 std::ios_base::openmode mode = std::ofstream::out | std::ofstream::binary;
652 if (append) mode |= std::ofstream::app;
653#if defined(__clang__) && defined(__MINGW32__)
654 return std::ofstream(fs::path(fileName.str()).wstring(), mode);
655#else
656 return std::ofstream(fs::path(fileName.str()), mode);
657#endif
658}

References QCString::str().

Referenced by Qhp::addContentsItem(), ResourceMgr::copyResourceAs(), FormulaManager::createFormulasTexFile(), FormulaManager::createLatexFile(), PerlModGenerator::createOutputFile(), HtmlHelp::Private::createProjectFile(), dumpSymbolMap(), EclipseHelp::finalize(), generateDEF(), generateJSNavTree(), generateJSTreeFiles(), CitationManager::generatePage(), generateXML(), generateXMLForClass(), generateXMLForConcept(), generateXMLForDir(), generateXMLForFile(), generateXMLForGroup(), generateXMLForModule(), generateXMLForNamespace(), generateXMLForPage(), HtmlGenerator::init(), Crawlmap::initialize(), DocSets::initialize(), EclipseHelp::initialize(), HtmlHelp::initialize(), Qhp::initialize(), Sitemap::initialize(), openOutputFile(), DocbookDocVisitor::operator()(), HtmlDocVisitor::operator()(), LatexDocVisitor::operator()(), RTFDocVisitor::operator()(), DotGraph::prepareDotFile(), RTFGenerator::preProcessFileInplace(), resetPDFSize(), DotFilePatcher::run(), runPlantumlContent(), ManGenerator::startDoxyAnchor(), updateEPSBoundingBox(), SearchIndex::write(), SearchIndexExternal::write(), ResourceMgr::writeCategory(), writeCombineScript(), HtmlGenerator::writeExternalSearchPage(), ClassDiagram::writeFigure(), FlowChart::writeFlowChart(), writeJavascriptSearchData(), writeJavaScriptSearchIndex(), writeJavasScriptSearchDataPage(), writeLatexMakefile(), writeMakeBat(), writeMenuData(), HtmlGenerator::writeSearchData(), HtmlGenerator::writeSearchPage(), and writeTagFile().

◆ pathListSeparator()

QCString Portable::pathListSeparator ( )

Definition at line 384 of file portable.cpp.

385{
386#if defined(_WIN32) && !defined(__CYGWIN__)
387 return ";";
388#else
389 return ":";
390#endif
391}

Referenced by ExistsOnPath(), parseInput(), runPlantumlContent(), and setDotFontPath().

◆ pathSeparator()

QCString Portable::pathSeparator ( )

Definition at line 375 of file portable.cpp.

376{
377#if defined(_WIN32) && !defined(__CYGWIN__)
378 return "\\";
379#else
380 return "/";
381#endif
382}

Referenced by Config::checkAndCorrect(), ExistsOnPath(), findFilePath(), readTextFileByName(), writeDiaGraphFromFile(), and writeMscGraphFromFile().

◆ pclose()

int Portable::pclose ( FILE * stream)

Definition at line 489 of file portable.cpp.

490{
491 #if defined(_MSC_VER) || defined(__BORLANDC__)
492 return ::_pclose(stream);
493 #else
494 return ::pclose(stream);
495 #endif
496}

Referenced by FileDefImpl::acquireFileVersion(), FilterCache::getFileContentsPipe(), readInputFile(), runQHelpGenerator(), and stackTrace().

◆ pid()

uint32_t Portable::pid ( )

Definition at line 249 of file portable.cpp.

250{
251 uint32_t pid;
252#if !defined(_WIN32) || defined(__CYGWIN__)
253 pid = static_cast<uint32_t>(getpid());
254#else
255 pid = static_cast<uint32_t>(GetCurrentProcessId());
256#endif
257 return pid;
258}
uint32_t pid()
Definition portable.cpp:249

References pid().

Referenced by initWarningFormat(), parseInput(), pid(), and system().

◆ popen()

FILE * Portable::popen ( const QCString & name,
const QCString & type )

Definition at line 480 of file portable.cpp.

481{
482 #if defined(_MSC_VER) || defined(__BORLANDC__)
483 return ::_popen(name.data(),type.data());
484 #else
485 return ::popen(name.data(),type.data());
486 #endif
487}

References QCString::data().

Referenced by FileDefImpl::acquireFileVersion(), FilterCache::getFileContentsPipe(), readInputFile(), runQHelpGenerator(), and stackTrace().

◆ recodeUtf8StringToW()

size_t Portable::recodeUtf8StringToW ( const QCString & inputStr,
uint16_t ** buf )

Definition at line 624 of file portable.cpp.

625{
626 if (inputStr.isEmpty() || outBuf==nullptr) return 0; // empty input or invalid output
627 void *handle = portable_iconv_open("UTF-16LE","UTF-8");
628 if (handle==reinterpret_cast<void *>(-1)) return 0; // invalid encoding
629 size_t len = inputStr.length();
630 uint16_t *buf = new uint16_t[len+1];
631 *outBuf = buf;
632 size_t inRemains = len;
633 size_t outRemains = len*sizeof(uint16_t)+2; // chars + \0
634 const char *p = inputStr.data();
635 portable_iconv(handle,&p,&inRemains,reinterpret_cast<char **>(&buf),&outRemains);
636 *buf=0;
637 portable_iconv_close(handle);
638 return len;
639}
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)

References QCString::data(), QCString::isEmpty(), QCString::length(), portable_iconv(), portable_iconv_close(), and portable_iconv_open().

Referenced by fopen(), and system().

◆ setenv()

void Portable::setenv ( const QCString & variable,
const QCString & value )

Definition at line 287 of file portable.cpp.

288{
289#if defined(_WIN32) && !defined(__CYGWIN__)
290 SetEnvironmentVariable(name.data(),!value.isEmpty() ? value.data() : "");
291#else
292 if(!environmentLoaded) // if the environment variables are not loaded already...
293 { // ...call loadEnvironment to store them in class
295 }
296
297 proc_env[name.str()] = value.str(); // create or replace existing value
298 ::setenv(name.data(),value.data(),1);
299#endif
300}

References QCString::data(), environmentLoaded, QCString::isEmpty(), loadEnvironment(), proc_env, setenv(), and QCString::str().

Referenced by correctPath(), initDoxygen(), parseInput(), setDotFontPath(), setenv(), and unsetDotFontPath().

◆ setShortDir()

void Portable::setShortDir ( )

Definition at line 554 of file portable.cpp.

555{
556#if defined(_WIN32) && !defined(__CYGWIN__)
557 long length = 0;
558 TCHAR* buffer = nullptr;
559 // First obtain the size needed by passing nullptr and 0.
560 length = GetShortPathName(Dir::currentDirPath().c_str(), nullptr, 0);
561 // Dynamically allocate the correct size
562 // (terminating null char was included in length)
563 buffer = new TCHAR[length];
564 // Now simply call again using same (long) path.
565 length = GetShortPathName(Dir::currentDirPath().c_str(), buffer, length);
566 // Set the correct directory (short name)
567 Dir::setCurrent(buffer);
568 delete [] buffer;
569#endif
570}
static std::string currentDirPath()
Definition dir.cpp:342
static bool setCurrent(const std::string &path)
Definition dir.cpp:350

References Dir::currentDirPath(), and Dir::setCurrent().

Referenced by runHtmlHelpCompiler().

◆ strnstr()

const char * Portable::strnstr ( const char * haystack,
const char * needle,
size_t haystack_len )

Definition at line 601 of file portable.cpp.

602{
603 size_t needle_len = strnlen(needle, haystack_len);
604 if (needle_len < haystack_len || !needle[needle_len])
605 {
606 const char *x = portable_memmem(haystack, haystack_len, needle, needle_len);
607 if (x && !memchr(haystack, 0, x - haystack))
608 {
609 return x;
610 }
611 }
612 return nullptr;
613}
static const char * portable_memmem(const char *haystack, size_t haystack_len, const char *needle, size_t needle_len)
Definition portable.cpp:573

References portable_memmem().

Referenced by Markdown::Private::addStrEscapeUtf8Nbsp().

◆ system()

int Portable::system ( const QCString & command,
const QCString & args,
bool commandHasConsole = true )

taken from the system() manpage on my Linux box

Definition at line 106 of file portable.cpp.

107{
108 if (command.isEmpty()) return 1;
109 AutoTimeKeeper timeKeeper;
110
111#if defined(_WIN32) && !defined(__CYGWIN__)
112 QCString commandCorrectedPath = substitute(command,'/','\\');
113 QCString fullCmd=commandCorrectedPath;
114#else
115 QCString fullCmd=command;
116#endif
117 fullCmd=fullCmd.stripWhiteSpace();
118 if (fullCmd.at(0)!='"' && fullCmd.find(' ')!=-1)
119 {
120 // add quotes around command as it contains spaces and is not quoted already
121 fullCmd="\""+fullCmd+"\"";
122 }
123 fullCmd += " ";
124 fullCmd += args;
125#ifndef NODEBUG
126 Debug::print(Debug::ExtCmd,0,"Executing external command `{}`\n",fullCmd);
127#endif
128
129#if !defined(_WIN32) || defined(__CYGWIN__)
130 (void)commandHasConsole;
131 /*! taken from the system() manpage on my Linux box */
132 int pid,status=0;
133
134#ifdef _OS_SOLARIS // for Solaris we use vfork since it is more memory efficient
135
136 // on Solaris fork() duplicates the memory usage
137 // so we use vfork instead
138
139 // spawn shell
140 if ((pid=vfork())<0)
141 {
142 status=-1;
143 }
144 else if (pid==0)
145 {
146 execl("/bin/sh","sh","-c",fullCmd.data(),(char*)0);
147 _exit(127);
148 }
149 else
150 {
151 while (waitpid(pid,&status,0 )<0)
152 {
153 if (errno!=EINTR)
154 {
155 status=-1;
156 break;
157 }
158 }
159 }
160 return status;
161
162#else // Other Unices just use fork
163
164 pid = fork();
165 if (pid==-1)
166 {
167 perror("fork error");
168 return -1;
169 }
170 if (pid==0)
171 {
172 const char * const argv[4] = { "sh", "-c", fullCmd.data(), 0 };
173 execve("/bin/sh",const_cast<char * const*>(argv),environ);
174 exit(127);
175 }
176 for (;;)
177 {
178 if (waitpid(pid,&status,0)==-1)
179 {
180 if (errno!=EINTR) return -1;
181 }
182 else
183 {
184 if (WIFEXITED(status))
185 {
186 return WEXITSTATUS(status);
187 }
188 else
189 {
190 return status;
191 }
192 }
193 }
194#endif // !_OS_SOLARIS
195
196#else // Win32 specific
197 if (commandHasConsole)
198 {
199 return ::system(fullCmd.data());
200 }
201 else
202 {
203 uint16_t* fullCmdW = nullptr;
204 recodeUtf8StringToW(fullCmd, &fullCmdW);
205
206 STARTUPINFOW sStartupInfo;
207 std::memset(&sStartupInfo, 0, sizeof(sStartupInfo));
208 sStartupInfo.cb = sizeof(sStartupInfo);
209 sStartupInfo.dwFlags |= STARTF_USESHOWWINDOW;
210 sStartupInfo.wShowWindow = SW_HIDE;
211
212 PROCESS_INFORMATION sProcessInfo;
213 std::memset(&sProcessInfo, 0, sizeof(sProcessInfo));
214
215 if (!CreateProcessW(
216 nullptr, // No module name (use command line)
217 reinterpret_cast<wchar_t*>(fullCmdW), // Command line, can be mutated by CreateProcessW
218 nullptr, // Process handle not inheritable
219 nullptr, // Thread handle not inheritable
220 FALSE, // Set handle inheritance to FALSE
221 CREATE_NO_WINDOW,
222 nullptr, // Use parent's environment block
223 nullptr, // Use parent's starting directory
224 &sStartupInfo,
225 &sProcessInfo
226 ))
227 {
228 delete[] fullCmdW;
229 return -1;
230 }
231 else if (sProcessInfo.hProcess) /* executable was launched, wait for it to finish */
232 {
233 WaitForSingleObject(sProcessInfo.hProcess,INFINITE);
234 /* get process exit code */
235 DWORD exitCode;
236 bool retval = GetExitCodeProcess(sProcessInfo.hProcess,&exitCode);
237 CloseHandle(sProcessInfo.hProcess);
238 CloseHandle(sProcessInfo.hThread);
239 delete[] fullCmdW;
240 if (!retval) return -1;
241 return exitCode;
242 }
243 }
244#endif
245 return 1; // we should never get here
246
247}
@ ExtCmd
Definition debug.h:36
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
Definition debug.h:76
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:593
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:260
char ** environ

References QCString::at(), QCString::data(), environ, Debug::ExtCmd, FALSE, QCString::find(), QCString::isEmpty(), pid(), Debug::print(), recodeUtf8StringToW(), QCString::stripWhiteSpace(), and substitute().

Referenced by createCroppedEPS(), createCroppedPDF(), createDVIFile(), createEPSbboxFile(), createPNG(), createPostscriptFile(), FlowChart::createSVG(), createSVGFromPDF(), createSVGFromPDFviaInkscape(), determineInkscapeVersion(), do_mscgen_generate(), Htags::execute(), DocParser::findAndCopyImage(), CitationManager::generatePage(), DotRunner::run(), runHtmlHelpCompiler(), runPlantumlContent(), runQHelpGenerator(), writeDiaGraphFromFile(), ClassDiagram::writeFigure(), and writeMscGraphFromFile().

◆ unlink()

void Portable::unlink ( const QCString & fileName)

Definition at line 545 of file portable.cpp.

546{
547#if defined(_WIN32) && !defined(__CYGWIN__)
548 _unlink(fileName.data());
549#else
550 ::unlink(fileName.data());
551#endif
552}
void unlink(const QCString &fileName)
Definition portable.cpp:545

References QCString::data(), and unlink().

Referenced by finishWarnExit(), RTFGenerator::preProcessFileInplace(), DotRunner::run(), and unlink().

◆ unsetenv()

void Portable::unsetenv ( const QCString & variable)

Definition at line 302 of file portable.cpp.

303{
304#if defined(_WIN32) && !defined(__CYGWIN__)
305 SetEnvironmentVariable(variable.data(),nullptr);
306#else
307 /* Some systems don't have unsetenv(), so we do it ourselves */
308 if (variable.isEmpty() || variable.find('=')!=-1)
309 {
310 return; // not properly formatted
311 }
312
313 auto it = proc_env.find(variable.str());
314 if (it != proc_env.end())
315 {
316 proc_env.erase(it);
317 ::unsetenv(variable.data());
318 }
319#endif
320}
void unsetenv(const QCString &variable)
Definition portable.cpp:302

References QCString::data(), QCString::find(), QCString::isEmpty(), proc_env, QCString::str(), and unsetenv().

Referenced by setDotFontPath(), unsetDotFontPath(), and unsetenv().