Functions
defgen.h File Reference

Go to the source code of this file.

Functions

void generateDEF ()
 

Function Documentation

void generateDEF ( )

Definition at line 558 of file defgen.cpp.

559 {
560  QCString outputDirectory = Config_getString("OUTPUT_DIRECTORY");
561  if (outputDirectory.isEmpty())
562  {
563  outputDirectory=QDir::currentDirPath().utf8();
564  }
565  else
566  {
567  QDir dir(outputDirectory);
568  if (!dir.exists())
569  {
570  dir.setPath(QDir::currentDirPath());
571  if (!dir.mkdir(outputDirectory))
572  {
573  err("tag OUTPUT_DIRECTORY: Output directory `%s' does not "
574  "exist and cannot be created\n",outputDirectory.data());
575  exit(1);
576  }
577  else
578  {
579  msg("Notice: Output directory `%s' does not exist. "
580  "I have created it for you.\n", outputDirectory.data());
581  }
582  dir.cd(outputDirectory);
583  }
584  outputDirectory=dir.absPath().utf8();
585  }
586 
587  QDir dir(outputDirectory);
588  if (!dir.exists())
589  {
590  dir.setPath(QDir::currentDirPath());
591  if (!dir.mkdir(outputDirectory))
592  {
593  err("Cannot create directory %s\n",outputDirectory.data());
594  return;
595  }
596  }
597  QDir defDir(outputDirectory+"/def");
598  if (!defDir.exists() && !defDir.mkdir(outputDirectory+"/def"))
599  {
600  err("Could not create def directory in %s\n",outputDirectory.data());
601  return;
602  }
603 
604  QCString fileName=outputDirectory+"/def/doxygen.def";
605  QFile f(fileName);
606  if (!f.open(IO_WriteOnly))
607  {
608  err("Cannot open file %s for writing!\n",fileName.data());
609  return;
610  }
611  FTextStream t(&f);
612  t << "AutoGen Definitions dummy;" << endl;
613 
615  {
617  ClassDef *cd;
618  for (cli.toFirst();(cd=cli.current());++cli)
619  {
621  }
623  FileName *fn;
624  for (;(fn=fnli.current());++fnli)
625  {
626  FileNameIterator fni(*fn);
627  FileDef *fd;
628  for (;(fd=fni.current());++fni)
629  {
630  generateDEFForFile(fd,t);
631  }
632  }
633  }
634  else
635  {
636  t << "dummy_value = true;" << endl;
637  }
638 }
Traverses directory structures and contents in a platform-independent way.
Definition: qdir.h:52
bool isEmpty() const
Definition: qcstring.h:189
void msg(const char *fmt,...)
Definition: message.cpp:107
#define IO_WriteOnly
Definition: qiodevice.h:62
static FileNameList * inputNameList
Definition: doxygen.h:109
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
string dir
void generateDEFForClass(ClassDef *cd, FTextStream &t)
Definition: defgen.cpp:340
def cli(ctx)
Definition: main.py:7
QAsciiDict< Entry > fn
fileName
Definition: dumpTree.py:9
static QString currentDirPath()
Definition: qdir_unix.cpp:141
const char * data() const
Definition: qcstring.h:207
#define Config_getString(val)
Definition: config.cpp:660
void err(const char *fmt,...)
Definition: message.cpp:226
The QFile class is an I/O device that operates on files.
Definition: qfile.h:50
void generateDEFForFile(FileDef *fd, FTextStream &t)
Definition: defgen.cpp:528
friend class Iterator
Definition: sortdict.h:289
QCString utf8() const
Definition: qstring.cpp:14507
static ClassSDict * classSDict
Definition: doxygen.h:99
QTextStream & endl(QTextStream &s)