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 423 of file portable.cpp.

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

References ExistsOnPath().

Referenced by generateFormula().

◆ commandExtension()

const char * Portable::commandExtension ( )

Definition at line 461 of file portable.cpp.

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

Referenced by 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 516 of file portable.cpp.

517{
518 QCString p = Portable::getenv("PATH");
519 bool first=true;
520 QCString result;
521#if defined(_WIN32) && !defined(__CYGWIN__)
522 for (const auto &path : extraPaths)
523 {
524 if (!first) result+=';';
525 first=false;
526 result += substitute(path,"/","\\");
527 }
528 if (!result.isEmpty() && !p.isEmpty()) result+=';';
529 result += substitute(p,"/","\\");
530#else
531 for (const auto &path : extraPaths)
532 {
533 if (!first) result+=':';
534 first=false;
535 result += path;
536 }
537 if (!result.isEmpty() && !p.isEmpty()) result+=':';
538 result += p;
539#endif
540 if (result!=p) Portable::setenv("PATH",result.data());
541 //printf("settingPath(%s) #extraPaths=%zu\n",Portable::getenv("PATH").data(),extraPaths.size());
542}
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:286
QCString getenv(const QCString &variable)
Definition portable.cpp:321
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition qcstring.cpp:571

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

Referenced by parseInput().

◆ devNull()

const char * Portable::devNull ( )

Definition at line 614 of file portable.cpp.

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

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

◆ fclose()

int Portable::fclose ( FILE * f)

Definition at line 369 of file portable.cpp.

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

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

◆ fileSystemIsCaseSensitive()

bool Portable::fileSystemIsCaseSensitive ( )

Definition at line 470 of file portable.cpp.

471{
472#if defined(_WIN32) || defined(macintosh) || defined(__MACOSX__) || defined(__APPLE__) || defined(__CYGWIN__)
473 return FALSE;
474#else
475 return TRUE;
476#endif
477}
#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 349 of file portable.cpp.

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

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

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

◆ getenv()

QCString Portable::getenv ( const QCString & variable)

Definition at line 321 of file portable.cpp.

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

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 97 of file portable.cpp.

98{
100}
double elapsedTime() const
Definition portable.cpp:72
static SysTimeKeeper & instance()
Definition portable.cpp:84

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

Referenced by generateOutput().

◆ ghostScriptCommand()

const char * Portable::ghostScriptCommand ( )

Definition at line 437 of file portable.cpp.

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

References ExistsOnPath().

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

◆ isAbsolutePath()

bool Portable::isAbsolutePath ( const QCString & fileName)

Definition at line 497 of file portable.cpp.

498{
499 const char *fn = fileName.data();
500# ifdef _WIN32
501 if (fileName.length()>1 && isalpha(fileName[0]) && fileName[1]==':') fn+=2;
502# endif
503 char const fst = fn[0];
504 if (fst == '/') return true;
505# ifdef _WIN32
506 if (fst == '\\') return true;
507# endif
508 return false;
509}
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(), generateOutput(), Markdown::Private::processLink(), and readTextFileByName().

◆ openInputStream()

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

Definition at line 659 of file portable.cpp.

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

References QCString::str().

Referenced by 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 648 of file portable.cpp.

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

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(), generateXMLForRequirement(), generateXMLForRequirements(), HtmlGenerator::init(), Crawlmap::initialize(), DocSets::initialize(), EclipseHelp::initialize(), HtmlHelp::initialize(), Qhp::initialize(), Sitemap::initialize(), openOutputFile(), DotGraph::prepareDotFile(), RTFGenerator::preProcessFileInplace(), resetPDFSize(), DotFilePatcher::run(), runPlantumlContent(), ManGenerator::startDoxyAnchor(), updateEPSBoundingBox(), SearchIndex::write(), SearchIndexExternal::write(), ResourceMgr::writeCategory(), writeCombineScript(), HtmlGenerator::writeExternalSearchPage(), ClassDiagram::writeFigure(), writeFileContents(), FlowChart::writeFlowChart(), writeJavascriptSearchData(), writeJavaScriptSearchIndex(), writeJavasScriptSearchDataPage(), writeLatexMakefile(), writeMakeBat(), HtmlGenerator::writeSearchData(), HtmlGenerator::writeSearchPage(), and writeTagFile().

◆ pathListSeparator()

QCString Portable::pathListSeparator ( )

Definition at line 383 of file portable.cpp.

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

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

◆ pathSeparator()

QCString Portable::pathSeparator ( )

Definition at line 374 of file portable.cpp.

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

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

◆ pclose()

int Portable::pclose ( FILE * stream)

Definition at line 488 of file portable.cpp.

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

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

◆ pid()

uint32_t Portable::pid ( )

Definition at line 248 of file portable.cpp.

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

References pid().

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

◆ popen()

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

Definition at line 479 of file portable.cpp.

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

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 623 of file portable.cpp.

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

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

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 553 of file portable.cpp.

554{
555#if defined(_WIN32) && !defined(__CYGWIN__)
556 long length = 0;
557 TCHAR* buffer = nullptr;
558 // First obtain the size needed by passing nullptr and 0.
559 length = GetShortPathName(Dir::currentDirPath().c_str(), nullptr, 0);
560 // Dynamically allocate the correct size
561 // (terminating null char was included in length)
562 buffer = new TCHAR[length];
563 // Now simply call again using same (long) path.
564 length = GetShortPathName(Dir::currentDirPath().c_str(), buffer, length);
565 // Set the correct directory (short name)
566 Dir::setCurrent(buffer);
567 delete [] buffer;
568#endif
569}
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 600 of file portable.cpp.

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

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 105 of file portable.cpp.

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

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

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

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

◆ unsetenv()

void Portable::unsetenv ( const QCString & variable)

Definition at line 301 of file portable.cpp.

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

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

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