From 6aa7383e23c850af36c25b87e5737a2e2f635083 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Wed, 15 Dec 1999 19:29:47 +0000 Subject: mods for doxygen-0.49-990728 --- INSTALL | 30 +- LICENSE | 483 +++++++++++++++++ Makefile | 7 +- Makefile.config | 2 +- README | 4 +- doc/Doxyfile | 4 +- doc/commands.doc | 4 +- doc/config.doc | 18 + doc/doxygen_manual.tex | 2 + doc/doxysearch_usage.doc | 15 +- doc/faq.doc | 49 ++ doc/index.doc | 26 +- doc/language.doc | 264 +++++++++ doc/starting.doc | 118 +++- examples/Makefile | 6 +- examples/example.cfg | 1 + examples/example.tag | 2 +- examples/resdefine.cfg | 6 - examples/resdefine.cpp | 21 - examples/templ.cpp | 10 +- src/Makefile | 2 +- src/classdef.cpp | 169 +++--- src/classdef.h | 35 +- src/code.h | 4 +- src/code.l | 55 +- src/config.h | 124 +++-- src/config.l | 603 +++++++++++++-------- src/constexp.h | 6 +- src/constexp.l | 4 +- src/debug.cpp | 7 +- src/declinfo.h | 18 +- src/declinfo.l | 59 +- src/defargs.h | 2 +- src/defargs.l | 17 +- src/define.cpp | 2 +- src/define.h | 18 +- src/definition.cpp | 13 +- src/definition.h | 24 +- src/diagram.cpp | 18 +- src/diagram.h | 7 +- src/doxygen.cpp | 929 ++++++++++++++++++------------- src/doxygen.h | 15 +- src/doxygen.pro | 2 +- src/doxysearch.cpp | 34 +- src/doxytag.l | 50 +- src/entry.cpp | 33 +- src/entry.h | 50 +- src/example.h | 8 +- src/filedef.cpp | 53 +- src/filedef.h | 30 +- src/filename.cpp | 10 +- src/filename.h | 3 +- src/formula.cpp | 15 +- src/formula.h | 6 +- src/groupdef.cpp | 3 +- src/groupdef.h | 8 +- src/htmlgen.cpp | 66 ++- src/htmlgen.h | 9 +- src/image.cpp | 107 +--- src/index.cpp | 146 ++--- src/index.h | 3 +- src/instdox.cpp | 11 +- src/language.cpp | 16 +- src/latexgen.cpp | 253 +++++---- src/latexgen.h | 2 + src/logos.cpp | 9 +- src/mangen.cpp | 29 +- src/mangen.h | 2 + src/memberdef.cpp | 51 +- src/memberdef.h | 44 +- src/memberlist.cpp | 21 +- src/membername.h | 8 +- src/message.cpp | 4 +- src/namespacedef.cpp | 9 +- src/namespacedef.h | 20 +- src/outputgen.cpp | 9 +- src/outputgen.h | 8 +- src/outputlist.h | 6 +- src/pre.h | 15 +- src/pre.l | 499 ++++++++++------- src/qtbc.h | 42 ++ src/scanner.h | 8 +- src/scanner.l | 422 ++++++++++----- src/searchindex.cpp | 3 +- src/searchindex.h | 6 +- src/section.h | 8 +- src/suffixtree.cpp | 6 +- src/suffixtree.h | 4 +- src/tag.l | 33 +- src/translator.h | 277 +++++----- src/translator_cz.h | 212 ++++---- src/translator_de.h | 559 +++++++++++++++++++ src/translator_es.h | 405 ++++++++++++++ src/translator_fr.h | 216 ++++---- src/translator_it.h | 499 ++++++++++------- src/translator_jp.h | 268 +++++++++ src/translator_nl.h | 252 ++++----- src/translator_se.h | 489 ++++++++++++----- src/util.cpp | 1354 ++++++++++++++++++++++++++++------------------ src/util.h | 29 +- 100 files changed, 6753 insertions(+), 3194 deletions(-) create mode 100644 LICENSE create mode 100644 doc/faq.doc create mode 100644 doc/language.doc delete mode 100644 examples/resdefine.cfg delete mode 100644 examples/resdefine.cpp create mode 100644 src/qtbc.h create mode 100644 src/translator_de.h create mode 100644 src/translator_es.h create mode 100644 src/translator_jp.h diff --git a/INSTALL b/INSTALL index 6a9e9b9..c62f167 100644 --- a/INSTALL +++ b/INSTALL @@ -1,12 +1,12 @@ -DOXYGEN Version 0.49-990522 +DOXYGEN Version 0.49-990728 INSTALLATION INSTRUCTIONS FOR UNIX: ----------------------------------- 1. Unpack the archive, unless you already have: - gunzip doxygen-0.49-990522.src.tar.gz # uncompress the archive - tar xf doxygen-0.49-990522.src.tar # unpack it + gunzip doxygen-0.49-990728.src.tar.gz # uncompress the archive + tar xf doxygen-0.49-990728.src.tar # unpack it 2. Make sure Qt is installed properly (check the environment variable $QTDIR) @@ -104,7 +104,7 @@ KNOWN CONFIGURATION PROBLEMS HTML RELATED PROBLEMS: - the indent continuously increases. This seems to be a problem that can be observed with Netscape 4.01. - It is not present in many later and earlier versions. + It is not present in many later and earlier versions I tested. LATEX RELATED PROBLEMS: @@ -116,16 +116,32 @@ LATEX RELATED PROBLEMS: - the file fancyheader.sty is known as fancyhdr.sty on some systems. Please change that in src/latexgen.cpp -HP-UX PROBLEMS: +HP-UX / DIGITAL UNIX PROBLEMS: - If you are compiling for HP-UX with aCC and you get this error: /opt/aCC/lbin/ld: Unsatisfied symbols: alloca (code) - then you should edit ce_parse.cpp and replace + then you should (according to Anke Selig) edit ce_parse.cpp and replace extern "C" { void *alloca (unsigned int); }; with #include +- If you are compiling for Digital Unix, the same problem can be solved + (according to Barnard Schmallhof) by replacing the following in + ce_parse.cpp: + + #else /* not GNU C. */ + #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || + defined (__sparc) || defined (__sgi) + #include + + with + + #else /* not GNU C. */ + #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || + defined (__sparc) || defined (__sgi) || defined (__osf__) + #include + This seems to be a problem with bison, but I don't know how to fix it. ----------------------------------------------------------------------------- @@ -138,4 +154,4 @@ The latest version of doxygen can be obtained at Enjoy, -Dimitri van Heesch (22 May 1999) +Dimitri van Heesch (30 July 1999) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0b643ac --- /dev/null +++ b/LICENSE @@ -0,0 +1,483 @@ + + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + diff --git a/Makefile b/Makefile index 037c87a..7fb6010 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,11 @@ dgux-g++: src/version.cpp TMAKEPATH=../tmake/lib/dgux-g++ \ $(MAKE) +gnu-g++: src/version.cpp + cd src; \ + TMAKEPATH=../tmake/lib/gnu-g++ \ + $(MAKE) + freebsd-g++: src/version.cpp cd src; \ TMAKEPATH=../tmake/lib/freebsd-g++ \ @@ -170,7 +175,7 @@ ps: docs archive: clean $(TAR) zcvf backup/dx`date +%y%m%d`.tgz tmake doc examples bin objects \ src Makefile Makefile.windows INSTALL make.bat Makefile.config \ - LANGUAGE.HOWTO + LANGUAGE.HOWTO LICENSE src/version.cpp: FORCE echo "char versionString[]=\"$(VERSION)\";" > src/version.cpp diff --git a/Makefile.config b/Makefile.config index a10a57b..9dc23f3 100644 --- a/Makefile.config +++ b/Makefile.config @@ -9,4 +9,4 @@ PERL = perl # The values below should probably be left unmodified TAR = tar # name of the GNU tar tool TMAKE = ../tmake/bin/tmake -VERSION = 0.49-990522 +VERSION = 0.49-990728 diff --git a/README b/README index 899040e..d79e9b8 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 0.49-990522 +DOXYGEN Version 0.49-990728 Please read INSTALL for compilation instructions. @@ -7,4 +7,4 @@ The latest version of doxygen can be obtained at Enjoy, -Dimitri van Heesch (22 May 1999) +Dimitri van Heesch (30 July 1999) diff --git a/doc/Doxyfile b/doc/Doxyfile index 79cbb31..5891572 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -10,11 +10,11 @@ EXTRACT_PRIVATE = NO GENERATE_LATEX = YES GENERATE_HTML = YES ENABLE_PREPROCESSING = NO -INPUT = index.doc install.doc starting.doc trouble.doc \ +INPUT = index.doc install.doc starting.doc faq.doc trouble.doc \ history.doc features.doc \ doxygen_usage.doc doxytag_usage.doc doxysearch_usage.doc \ installdox_usage.doc autolink.doc \ - config.doc commands.doc htmlcmds.doc + config.doc commands.doc htmlcmds.doc language.doc FILE_PATTERNS = *.cpp *.h *.doc EXAMPLE_PATH = ../examples RECURSIVE = NO diff --git a/doc/commands.doc b/doc/commands.doc index 48f5c53..5965aaf 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -183,6 +183,7 @@ Doxygen. Unrecognized commands are treated as normal text. \sa section \ref cmdcode "\\code"
+ \subsection cmdenum \enum \addindex \enum @@ -664,6 +665,7 @@ Doxygen. Unrecognized commands are treated as normal text. \sa Section \ref cmdpage "\\page" for an example of the \\cmdsection command. +
\subsection cmdsubsection \subsection (subsection title) @@ -677,6 +679,7 @@ Doxygen. Unrecognized commands are treated as normal text. \sa Section \ref cmdpage "\\page" for an example of the \\cmdsubsection command. +

\htmlonly
--- \endhtmlonly @@ -1054,7 +1057,6 @@ Doxygen. Unrecognized commands are treated as normal text. character has to be escaped because it has a special meaning in HTML.
-

\htmlonly
--- \endhtmlonly Commands included for JavaDoc compatibility \htmlonly ---
\endhtmlonly

diff --git a/doc/config.doc b/doc/config.doc index 481925c..2bf3dc7 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -63,6 +63,14 @@ Below is a list of tags that are recognized for each category. If a relative path is entered, it will be relative to the location where doxygen was started. If left blank the current directory will be used. +
\c OUTPUT_LANGUAGE
+ \addindex OUTPUT_LANGUAGE + The \c OUTPUT_LANGUAGE tag is used to specify the language in which all + documentation generated by doxygen is written. Doxygen will use this + information to generate all constant output in the proper language. + The default language is English, other supported languages are: + Dutch, French, Italian, Czech, Swedish, German and Japanese. +
\c QUIET
\addindex QUIET The \c QUIET tag can be used to turn on/off the messages that are generated @@ -268,6 +276,11 @@ Below is a list of tags that are recognized for each category. \endverbatim If the tag is left blank doxygen will generate a standard header. + + The following commands have a special meaning inside the header: + \$title, \$datetime, \$date. + Doxygen will replace them by respectively + the title of the page, the current date and time, or only the current date.
\c HTML_FOOTER
\addindex HTML_FOOTER @@ -280,6 +293,11 @@ Below is a list of tags that are recognized for each category. \endverbatim If the tag is left blank doxygen will generate a standard footer. + The following commands have a special meaning inside the footer: + \$title, \$datetime, \$date. + Doxygen will replace them by respectively + the title of the page, the current date and time, or only the current date. + \subsection latex_output LaTeX related options diff --git a/doc/doxygen_manual.tex b/doc/doxygen_manual.tex index 8d28a55..bb8d599 100644 --- a/doc/doxygen_manual.tex +++ b/doc/doxygen_manual.tex @@ -26,6 +26,7 @@ Written by Dimitri van Heesch\\[2ex] \part{User Manual} \input{install} \input{starting} +\input{faq} \input{trouble} \part{Reference Manual} \input{features} @@ -38,5 +39,6 @@ Written by Dimitri van Heesch\\[2ex] \input{config} \input{commands} \input{htmlcmds} +\input{langhowto} \printindex \end{document} diff --git a/doc/doxysearch_usage.doc b/doc/doxysearch_usage.doc index a4a3e96..e3b1657 100644 --- a/doc/doxysearch_usage.doc +++ b/doc/doxysearch_usage.doc @@ -67,7 +67,7 @@ follow these steps: documentation. Apart from the documentation, Doxygen will create the following files:
    -
  • A small CGI script. the name of the script is determined by the +
  • A small shell script. the name of the script is determined by the \c CGI_NAME tag in the configuration file. The script is a small wrapper that calls \c doxysearch with the correct parameters. Using this script allows multiple @@ -80,6 +80,16 @@ follow these steps:
  • \c search.gif: this is the image that is used for the search button.
+ \par Notice: + On the Windows platform Unix shell scripts cannot be used. + In fact the HTTP daemon that I tried (apache for Windows) only + recognized .cgi files that were renamed + executables (so DOS batch files do not seem to work either). Therefore, + on Windows a small C program will generated by doxygen. + You should compile and link the program with your favourite + compiler and change the extension of the executable from + .exe to .cgi. +
  • Copy (or move) the CGI script to the directory where the CGI binaries are located. This is usually a special directory on your system or in your @@ -112,7 +122,8 @@ This can be done by carefully following these steps:
  • Goto the html directory of the Qt-distribution:
    cd $QTDIR/html
  • Generate the search index by typing: -
    doxytag -s search.idx *.html
    +
    doxytag -s search.idx
    + in the directory where the HTML files are located. This will parse all files and build a search index. Apart from the file search.idx two other files will be generated: search.gif and search.cgi diff --git a/doc/faq.doc b/doc/faq.doc new file mode 100644 index 0000000..c730289 --- /dev/null +++ b/doc/faq.doc @@ -0,0 +1,49 @@ +/****************************************************************************** + * + * $Id$ + * + * Copyright (C) 1997-1999 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * All output generated with Doxygen is not covered by this license. + * + */ +/*! \page faq Frequently Asked Questions + +
      +
    1. How do get information on the index page in HTML? +

      +There is no real support for title pages at the moment. But you can +override the default index page, by using the following comment block: +\verbatim +/*! \page index My Personal Index Page + * + * This is my index personal index page. + */ +\endverbatim + +

    2. How can I avoid that some code fragment is parsed by Doxyen? +

      +You can use Doxygen's preprocessor for this: +If you put +\verbatim +#ifndef DOXYGEN_SHOULD_SKIP_THIS + + /* code that must be skipped by Doxygen */ + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ +\endverbatim +around the blocks that should be hidden and put: +\verbatim + PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS +\endverbatim +in the config file then all blocks should be skipped by Doxygen as long +as PREPROCESSING = YES. +

    +*/ + diff --git a/doc/index.doc b/doc/index.doc index f60eec9..7db1d27 100644 --- a/doc/index.doc +++ b/doc/index.doc @@ -58,10 +58,12 @@ sections. The first part forms a user manual:
      -
    • Section \ref install discusses how to download, compile and install +
    • Section \ref install discusses how to + download, compile and install doxygen for your platform.
    • Section \ref starting tells you how to generate your first piece of documentation quickly. +
    • Section \ref faq gives answers to frequently asked questions.
    • Section \ref trouble tells you what to do when you have problems.
    @@ -84,8 +86,23 @@ The second part forms a reference manual: used within the documentation.
  • Section \ref htmlcmds shows an overview of the HTML commands that can be used within the documentation. +
  • Section \ref langhowto explains how to add support for new + output languages. + +

    Projects using doxygen

    + +I have compiled a small +\htmlonly +list of projects +that use doxygen +\endhtmlonly +\latexonly +list of projects that use doxygen (see {\tt http://www.stack.nl/$\sim$dimitri/doxygen/projects.html}) +\endlatexonly +If you know other projects, let me know and I'll add them. +

    Acknowledgements

    \addindex acknowledgements Thanks go to: @@ -156,9 +173,10 @@ Olaf Meeuwissen, Feiyi Wang, Robert J. Clark, Matthias Baas, -Walter Mueller, and -William van Dieten - for suggestions, patches and bug reports. +Walter Mueller, +William van Dieten, and +Joshua Jensen and +many others for suggestions, patches and bug reports. */ diff --git a/doc/language.doc b/doc/language.doc new file mode 100644 index 0000000..f05dce3 --- /dev/null +++ b/doc/language.doc @@ -0,0 +1,264 @@ +/****************************************************************************** + * + * $Id$ + * + * Copyright (C) 1997-1999 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * All output generated with Doxygen is not covered by this license. + * + */ +/*! \page langhowto Internationalization + +

    Support for multiple languages

    + +Doxygen has support for multiple languages. This means that the text fragments that +doxygen generates can changed into languages other than English +(the default) at configuration time. +

    +Currently, supported languages are English, French, Czech, Dutch, +Swedish, Italian, German and Japanese. A number +of people have volunteered to add support for other languages as well. +Here is a list of the languages and their current maintainers: +

    + +\htmlonly + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Language Maintainer Contact address
    + German + + Jens Breitenstein + + + Jens.Breitenstein@tlc.de +
    + French + + Christophe Bordeux + + + bordeux@lig.di.epfl.ch +
    + Swedish + + Samuel Hägglund
    + XeT Erixon +
    + + sahag96@nts.mh.se
    + + xet@hem.passagen.se +
    + Czech + + Vlastimil Havran + + + havran@fel.cvut.cz +
    + Romanian + + Ionutz Borcoman + + + borco@borco-ei.eng.hokudai.ac.jp +
    + Polish + + Piotr Piatkowski + + + kompas@ceti.com.pl +
    + Italian + + Ahmed Aldo Faisal
    + Alessandro Falappa +
    + + aaf23@cam.ac.uk
    + + a.falappa@flashnet.it +
    + Japanese + + Kenji Nagamatsu + + + naga@joyful.club.ne.jp +
    + Spanish + + Francisco Oltra Thennet + + + foltra@puc.cl +
    + Dutch + + Dimitri van Heesch + + + dimitri@stack.nl +
    +
    +\endhtmlonly +\latexonly +\begin{tabular}{|l|l|l|} + \hline + {\bf Language} & {\bf Maintainer} & {Contact address} \\ + \hline + German & Jens Breitenstein & {\tt Jens.Breitenstein@tlc.de} \\ + \hline + French & Christophe Bordeux & {\tt bordeux@lig.di.epfl.ch} \\ + \hline + Swedish & Samuel Hägglund & {\tt sahag96@nts.mh.se} \\ + & XeT Erixon & {\tt xet@hem.passagen.se} \\ + \hline + Czech & Vlastimil Havran & {\tt havran@fel.cvut.cz} \\ + \hline + Romanian & Ionutz Borcoman & {\tt borco@borco-ei.eng.hokudai.ac.jp} \\ + \hline + Polish & Piotr Piatkowski & {\tt kompas@ceti.com.pl} \\ + \hline + Italian & Ahmed Aldo Faisal & {\tt aaf23@cam.ac.uk} \\ + & Alessandro Falappa & {\tt a.falappa@flashnet.it} \\ + \hline + Japanese & Kenji Nagamatsu & {\tt naga@joyful.club.ne.jp} \\ + \hline + Spanish & Francisco Oltra Thennet & {\tt foltra@puc.cl} \\ + \hline + Dutch & Dimitri van Heesch & {\tt dimitri@stack.nl} \\ + \hline +\end{tabular} +\endlatexonly +

    + +Most people on the list have indicated that they were also busy +doing other things, so if you want to help to speed things up please +let them (or me) know. + +If you want to add support for a language that is not yet listed +please see the next section. + +

    Language HOWTO

    + +This short HOWTO explains how to add support for a new language to Doxygen: + +Just follow these steps: +
      +
    1. Tell me for which language you want to add support. If no one else + is already working on support for that language, you will be + assigned as the maintainer for the language. +
    2. Create a copy of translator_nl.h and name it + translator_.h + I'll use xx in the rest of this document. +
    3. Edit language.cpp: + Add a +\verbatim +#include +\endverbatim + in setTranslator() add +\verbatim + else if (L_EQUAL("your_language_name")) + { + theTranslator = new TranslatorYourLanguage; + } +\endverbatim + after the if { ... } +
    4. Edit doxygen.pro and add \c translator_xx.h to + the \c HEADERS line in the file doxygen.pro. +
    5. Edit translator_xx.h: +
        +
      • Rename TRANSLATOR_NL_H to TRANSLATOR_XX_H twice. +
      • Rename TranslatorDutch to TranslatorYourLanguage +
      • In the member latexBabelPackage() change "dutch" into the name of the + latex package that adds support for your language. +
      • Edit all the strings that are returned by the members that start + with tr. + Look at the corresponding member in translator.h for the english text + that is returned and translate that into your language. + Try to match punctuation and capitals! + To enter special characters (with accents) you can: +
          +
        • Enter them directly if your keyboard supports that and you are + using a Latin-1 font. + Doxygen will translate the characters to proper Latex and + leave the Html and man output for what it is. +
        • Use html codes like \ä for an a with an umlaut (i.e. ä). + See the HTML specification for the codes. +
        +
      +
    6. Recompile everything (do this from the root of the distribution, + because the Makefile.dox* have to be regenerated!) +
    7. Now you can use OUTPUT_LANGUAGE = your_language_name + in the config file to generate output in your language. +
    8. Send translator_xx.h or a diff -u of the changes + to me so I can add it to doxygen. +
    +*/ + diff --git a/doc/starting.doc b/doc/starting.doc index 1d3cbcd..78f9309 100644 --- a/doc/starting.doc +++ b/doc/starting.doc @@ -397,6 +397,122 @@ from typos in formulas. It may have to be necessary to remove the file formula.repository that is written in the html directory to a rid of an incorrect formula +\subsection preprocessing Preprocessing + +Source files that are used as input to doxygen can be parsed by doxygen's +build-in C-preprocessor. + +By default doxygen does only partial preprocessing. That is, it +evaluates conditional compilation statements (like \#if) and +evaluates macro definitions, but is does not perform macro expansion. + +So if you have the following code fragment +\verbatim +#define VERSION 200 +#define CONST_STRING const char * + +#if VERSION >= 200 + static CONST_STRING version = "2.xx"; +#else + static CONST_STRING version = "1.xx"; +#endif +\endverbatim + +Then by default doxygen will feed the following to its parser: + +\verbatim +#define VERSION +#define CONST_STRING + + static CONST_STRING version = "1.xx"; +\endverbatim + +You can disable all preprocessing by setting \c ENABLE_PREPROCESSING to \c +NO in the configuation file. In the case above doxygen will then read +both statements! + +In case you want to expand the \c CONST_STRING macro, you should set the +\c MACRO_EXPANSION tag in the config file to \c YES. Then the result +after preprocessing becomes: + +\verbatim +#define VERSION +#define CONST_STRING + + static const char * version = "1.xx"; +\endverbatim + +Notice that doxygen will now expand \e all macro definitions +(recursively if needed). This is often too much, therefore doxygen also +allows you to expand only those defines that you explicitly +specify. For this you have to set the \c EXPAND_ONLY_PREDEF tag to \c YES +and specify the macro definitions after the \c PREDEFINED tag. + +As an example, suppose you have the following obfusciated code fragment +of an abstract base class called \c IUnknown: + +\verbatim +/*! A reference to an IID */ +#ifdef __cplusplus +#define REFIID const IID & +#else +#define REFIID const IID * +#endif + +/*! The IUnknown interface */ +DECLARE_INTERFACE(IUnknown) +{ + MEMBER(HRESULT,QueryInterface) (THIS_ REFIID iid, void **ppv) PURE; + MEMBER(ULONG,AddRef) (THIS) PURE; + MEMBER(ULONG,Release) (THIS) PURE; +}; +\endverbatim + +without macro expansion doxygen will get confused, but we may not want to +expand the REFIID macro, because it is documented and the user that reads +the documentation should use it when implementing the interface. + +By setting the following in the config file: + +\verbatim +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +PREDEFINED = "DECLARE_INTERFACE(name)=class name" \ + "MEMBER(result,name)=virtual result name" \ + "PURE= = 0" \ + THIS_= \ + THIS= \ + __cplusplus +\endverbatim + +we can make sure that the proper result is fed to doxygen's parser: +\verbatim +/*! A reference to an IID */ +#define REFIID + +/*! The IUnknown interface */ +class IUnknown +{ + virtual HRESULT QueryInterface ( REFIID iid, void **ppv) = 0; + virtual ULONG AddRef () = 0; + virtual ULONG Release () = 0; +}; +\endverbatim + +Notice that the \c PREDEFINED tag accepts function like macro definitions +(like \c DECLARE_INTERFACE), normal macro substitutions (like \c PURE +and \c THIS) and plain defines (like \c __cplusplus). + +Notice also that preprocessor definitions that are normally defined +automatically by the preprocessor (like \c __cplusplus), have to be defined +by hand with doxygen's parser (this is done because these defines +are often platform/compiler specific). + +As you can see doxygen's preprocessor is quite powerful, but if you want +even more flexibility you can always write an input filter and specify it on +the \c INPUT_FILTER flag. + \subsection moreinfo More information \addindex QdbtTabular @@ -405,7 +521,7 @@ the documentation of QdbtTabular \latexonly ({\tt http://www.stack.nl/$\sim$dimitri/qdbttabular/html})\endlatexonly. \htmlonly I hope that was clear. If not, please let me know, so I can improve this document. If you have problems -take a look at the troubleshooting section. +take a look at the faq and the troubleshooting sections. \endhtmlonly */ diff --git a/examples/Makefile b/examples/Makefile index dd97c2c..1bbc2c1 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -17,7 +17,6 @@ all: class/html/index.html \ jdstyle/html/index.html \ structcmd/html/index.html \ autolink/html/index.html \ - resdefine/html/index.html \ restypedef/html/index.html \ afterdoc/html/index.html \ template/html/index.html \ @@ -26,7 +25,7 @@ all: class/html/index.html \ clean: rm -rf class define enum file func page relates author \ par overload example include qtstyle jdstyle structcmd \ - autolink tag resdefine restypedef afterdoc template + autolink tag restypedef afterdoc template class/html/index.html: class.h class.cfg $(DOXYDIR)/doxygen class.cfg @@ -81,9 +80,6 @@ tag/html/index.html: tag.cpp tag.cfg sed -e "1,1s.perl.$(PERL).g" tag/html/installdox >tag/html/installdox.perl cd tag/html ; $(PERL) installdox.perl -lexample.tag@../../example/html -resdefine/html/index.html: resdefine.cpp resdefine.cfg - $(DOXYDIR)/doxygen resdefine.cfg - restypedef/html/index.html: restypedef.cpp restypedef.cfg $(DOXYDIR)/doxygen restypedef.cfg diff --git a/examples/example.cfg b/examples/example.cfg index a30b3ff..dc4cb86 100644 --- a/examples/example.cfg +++ b/examples/example.cfg @@ -1,5 +1,6 @@ PROJECT_NAME = "Example Command" OUTPUT_DIRECTORY = example +GENERATE_TAGFILE = example.tag GENERATE_LATEX = NO GENERATE_MAN = NO INPUT = example.cpp diff --git a/examples/example.tag b/examples/example.tag index 3998b90..d30de7b 100644 --- a/examples/example.tag +++ b/examples/example.tag @@ -1,2 +1,2 @@ ->Test: +>Test: "class_test.html" example a0 "()" diff --git a/examples/resdefine.cfg b/examples/resdefine.cfg deleted file mode 100644 index 009a4e8..0000000 --- a/examples/resdefine.cfg +++ /dev/null @@ -1,6 +0,0 @@ -PROJECT_NAME = "Resolving Defines" -OUTPUT_DIRECTORY = resdefine -GENERATE_LATEX = NO -GENERATE_MAN = NO -INPUT = resdefine.cpp -QUIET = YES diff --git a/examples/resdefine.cpp b/examples/resdefine.cpp deleted file mode 100644 index 05a77c5..0000000 --- a/examples/resdefine.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#define ExportedName InternalName - -class InternalName -{ - public: - InternalName() {} - ~InternalName() {} -}; - -/*! \class ExportedName - * This class's real name is InternalName but everyone should use - * ExportedName. - */ - -/*! \fn ExportedName::ExportedName() - * The constructor - */ - -/*! \fn ExportedName::~ExportedName() - * The destructor - */ diff --git a/examples/templ.cpp b/examples/templ.cpp index c838c6e..3250abc 100644 --- a/examples/templ.cpp +++ b/examples/templ.cpp @@ -1,10 +1,10 @@ + /*! A template class */ template class Test { public: Test(); Test(const Test &); - friend void friendTempFunc(Test &, int=5); }; /*! complete specialization */ @@ -15,7 +15,7 @@ template<> class Test }; /*! A partial template specialization */ -template class Test< T * > : public Test +template class Test : public Test { public: Test(); @@ -27,11 +27,9 @@ template Test::Test() {} /*! The copy constructor */ template Test::Test(const Test &t) {} -/*! A friend function of a template class */ -template void friendTempFunc(Test &t,int a) {} +/*! The constructor of the partial specilization */ +template Test::Test() {} /*! The constructor of the specilization */ template<> Test::Test() {} -/*! The constructor of the partial specilization */ -template Test::Test() {} diff --git a/src/Makefile b/src/Makefile index e57994c..9812d37 100644 --- a/src/Makefile +++ b/src/Makefile @@ -39,6 +39,6 @@ clean: $(MAKE) -f Makefile.doxysearch clean -rm -f scanner.cpp code.cpp config.cpp pre.cpp ce_lex.cpp \ ce_parse.cpp ce_parse.h doxytag.cpp tag.cpp \ - declinfo.cpp defargs.cpp version.cpp + declinfo.cpp defargs.cpp FORCE: diff --git a/src/classdef.cpp b/src/classdef.cpp index 50cd54c..005a397 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -29,9 +29,9 @@ #include "diagram.h" #include "language.h" -static QString stripExtension(const char *fName) +static QCString stripExtension(const char *fName) { - QString result=fName; + QCString result=fName; if (result.right(5)==".html") result=result.left(result.length()-5); return result; } @@ -47,7 +47,7 @@ ClassDef::ClassDef(const char *nm,CompoundType ct,const char *ref,const char *fN fileName="class_"+nameToFile(nm); if (ref) { - //url=(QString)"doxygen=\""+ref+":\" href=\""+fileName; + //url=(QCString)"doxygen=\""+ref+":\" href=\""+fileName; exampleList = 0; exampleDict = 0; } @@ -105,7 +105,7 @@ void ClassDef::insertMember(const MemberDef *md) //printf("adding %s::%s\n",name(),md->name()); if (!reference) { - if (md->isRelated() && (extractPrivateFlag || md->protection()!=Private)) + if (md->isRelated() && (Config::extractPrivateFlag || md->protection()!=Private)) { related.append(md); } @@ -152,7 +152,7 @@ void ClassDef::insertMember(const MemberDef *md) } } // check if we should add this member in the `all members' list - if (md->isFriend() || md->protection()!=Private || extractPrivateFlag) + if (md->isFriend() || md->protection()!=Private || Config::extractPrivateFlag) { MemberInfo *mi = new MemberInfo((MemberDef *)md,Public,Normal); MemberNameInfo *mni=0; @@ -220,8 +220,8 @@ static void writeInheritanceSpecifier(OutputList &ol,BaseClassDef *bcd) void ClassDef::writeDocumentation(OutputList &ol) { // write title - QString pageTitle=name().copy(); - QString pageType; + QCString pageTitle=name().copy(); + QCString pageType; switch(compType) { case Class: pageType=" Class"; break; @@ -257,12 +257,12 @@ void ClassDef::writeDocumentation(OutputList &ol) if (incFile) { - QString nm=incName.copy(); + QCString nm=incName.copy(); if (incName.isNull()) nm=incFile->name(); ol.startTypewriter(); ol.docify("#include <"); ol.disable(OutputGenerator::Man); - if (verbatimHeaderFlag) + if (Config::verbatimHeaderFlag) { ol.writeObjectLink(0,fileName+"-include",0,nm); } @@ -279,9 +279,9 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.newParagraph(); } - if (genTagFile.length()>0) tagFile << ">" << name() << ":"; + if (Config::genTagFile.length()>0) tagFile << ">" << name() << ":"; - if (classDiagramFlag) ol.disableAllBut(OutputGenerator::Man); + if (Config::classDiagramFlag) ol.disableAllBut(OutputGenerator::Man); // write superclasses int count; @@ -289,7 +289,7 @@ void ClassDef::writeDocumentation(OutputList &ol) { //parseText(ol,theTranslator->trInherits()+" "); - QString inheritLine = theTranslator->trInheritsList(inherits->count()); + QCString inheritLine = theTranslator->trInheritsList(inherits->count()); QRegExp marker("@[0-9]+"); int index=0,newIndex,matchLen; // now replace all markers in inheritLine with links to the classes @@ -304,7 +304,7 @@ void ClassDef::writeDocumentation(OutputList &ol) ClassDef *cd=bcd->classDef; if (cd->hasDocumentation() || cd->isReference()) { - if (genTagFile.length()>0) tagFile << cd->getOutputFileBase() << "?"; + if (Config::genTagFile.length()>0) tagFile << cd->getOutputFileBase() << "?"; ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->name()+bcd->templSpecifiers); } else @@ -320,41 +320,14 @@ void ClassDef::writeDocumentation(OutputList &ol) } parseText(ol,inheritLine.right(inheritLine.length()-index)); ol.newParagraph(); - -#if 0 - BaseClassDef *bcd=inherits->first(); - while (bcd) - { - ClassDef *cd=bcd->classDef; - if (cd->hasDocumentation() || cd->isReference()) - { - if (genTagFile.length()>0) tagFile << cd->classFile() << "?"; - ol.writeObjectLink(cd->getReference(),cd->classFile(),0,cd->name()+bcd->templSpecifiers); - } - else - { - ol.docify(cd->name()); - } - writeInheritanceSpecifier(ol,bcd); - bcd=inherits->next(); - if (bcd) - { - if (inherits->at()==count-1) - parseText(ol," "+theTranslator->trAnd()+" "); - else - ol.writeString(", "); - } - } - ol.writeString("."); -#endif } - if (genTagFile.length()>0) tagFile << " \"" << fileName << ".html\"\n"; + if (Config::genTagFile.length()>0) tagFile << " \"" << fileName << ".html\"\n"; // write subclasses if ((count=inheritedBy->count())>0) { - QString inheritLine = theTranslator->trInheritedByList(inheritedBy->count()); + QCString inheritLine = theTranslator->trInheritedByList(inheritedBy->count()); QRegExp marker("@[0-9]+"); int index=0,newIndex,matchLen; // now replace all markers in inheritLine with links to the classes @@ -381,37 +354,9 @@ void ClassDef::writeDocumentation(OutputList &ol) } parseText(ol,inheritLine.right(inheritLine.length()-index)); ol.newParagraph(); - -#if 0 - parseText(ol,theTranslator->trInheritedBy()+" "); - BaseClassDef *bcd=inheritedBy->first(); - while (bcd) - { - ClassDef *cd=bcd->classDef; - if (cd->hasDocumentation() || cd->isReference()) - { - ol.writeObjectLink(cd->getReference(),cd->classFile(),0,cd->name()); - } - else - { - ol.docify(cd->name()); - } - writeInheritanceSpecifier(ol,bcd); - bcd=inheritedBy->next(); - if (bcd) - { - if (inheritedBy->at()==count-1) - parseText(ol," "+theTranslator->trAnd()+" "); - else - ol.writeString(", "); - } - } - ol.writeString("."); - ol.newParagraph(); -#endif } - if (classDiagramFlag) ol.enableAll(); + if (Config::classDiagramFlag) ol.enableAll(); count=0; BaseClassDef *ibcd; @@ -419,23 +364,17 @@ void ClassDef::writeDocumentation(OutputList &ol) while (ibcd) { ClassDef *icd=ibcd->classDef; - if (//(icd->protection()!=Private || extractPrivateFlag) && - //(icd->hasDocumentation() || !hideClassFlag || icd->isReference()) - icd->isVisibleExt() - ) count++; + if ( icd->isVisibleExt()) count++; ibcd=inheritedBy->next(); } ibcd=inherits->first(); while (ibcd) { ClassDef *icd=ibcd->classDef; - if (//(icd->protection()!=Private || extractPrivateFlag) && - //(icd->hasDocumentation() || !hideClassFlag | icd->isReference()) - icd->isVisibleExt() - ) count++; + if ( icd->isVisibleExt()) count++; ibcd=inherits->next(); } - if (classDiagramFlag && count>0) + if (Config::classDiagramFlag && count>0) // write class diagram { ClassDiagram diagram(this); // create a diagram of this class. @@ -465,7 +404,7 @@ void ClassDef::writeDocumentation(OutputList &ol) writeMemberDecs(ol,this,0,0,theTranslator->trProtectedMembers(),0,&proMembers); writeMemberDecs(ol,this,0,0,theTranslator->trProtectedSlots(),0,&proSlots); writeMemberDecs(ol,this,0,0,theTranslator->trStaticProtectedMembers(),0,&proStaticMembers); - if (extractPrivateFlag) + if (Config::extractPrivateFlag) { writeMemberDecs(ol,this,0,0,theTranslator->trPrivateMembers(),0,&priMembers); writeMemberDecs(ol,this,0,0,theTranslator->trPrivateSlots(),0,&priSlots); @@ -491,10 +430,28 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.startGroupHeader(); parseText(ol,theTranslator->trDetailedDescription()); ol.endGroupHeader(); - if (tempArgs) // class is a template + + ArgumentList *al=0; + int ti; + ClassDef *pcd=0; + int pi=0; + // find the outer most class scope + while ((ti=name().find("::",pi))!=-1 && + (pcd=getClass(name().left(ti)))==0 + ) pi=ti+2; + + if (pcd) + { + al=pcd->templateArguments(); + } + else + { + al=tempArgs; + } + + if (al) // class is a template { ol.startSubsubsection(); - ArgumentList *al=tempArgs; ol.docify("template<"); Argument *a=al->first(); while (a) @@ -554,7 +511,7 @@ void ClassDef::writeDocumentation(OutputList &ol) signals.countDocMembers(); if ( pubMembers.typedefCount() + proMembers.typedefCount() + - (extractPrivateFlag ? priMembers.typedefCount() : 0 ) + (Config::extractPrivateFlag ? priMembers.typedefCount() : 0 ) ) { ol.writeRuler(); @@ -564,7 +521,7 @@ void ClassDef::writeDocumentation(OutputList &ol) writeMemberDocs(ol,&pubMembers,name(),MemberDef::Typedef); writeMemberDocs(ol,&proMembers,name(),MemberDef::Typedef); - if (extractPrivateFlag) + if (Config::extractPrivateFlag) { writeMemberDocs(ol,&priMembers,name(),MemberDef::Typedef); } @@ -572,7 +529,7 @@ void ClassDef::writeDocumentation(OutputList &ol) if (pubMembers.enumCount() + proMembers.enumCount() + - ( extractPrivateFlag ? priMembers.enumCount() : 0 ) + ( Config::extractPrivateFlag ? priMembers.enumCount() : 0 ) ) { ol.writeRuler(); @@ -582,7 +539,7 @@ void ClassDef::writeDocumentation(OutputList &ol) writeMemberDocs(ol,&pubMembers,name(),MemberDef::Enumeration); writeMemberDocs(ol,&proMembers,name(),MemberDef::Enumeration); - if (extractPrivateFlag) + if (Config::extractPrivateFlag) { writeMemberDocs(ol,&priMembers,name(),MemberDef::Enumeration); } @@ -590,7 +547,7 @@ void ClassDef::writeDocumentation(OutputList &ol) if (pubMembers.enumValueCount() + proMembers.enumValueCount() + - ( extractPrivateFlag ? priMembers.enumValueCount() : 0 ) + ( Config::extractPrivateFlag ? priMembers.enumValueCount() : 0 ) ) { ol.writeRuler(); @@ -600,7 +557,7 @@ void ClassDef::writeDocumentation(OutputList &ol) writeMemberDocs(ol,&pubMembers,name(),MemberDef::EnumValue); writeMemberDocs(ol,&proMembers,name(),MemberDef::EnumValue); - if (extractPrivateFlag) + if (Config::extractPrivateFlag) { writeMemberDocs(ol,&priMembers,name(),MemberDef::EnumValue); } @@ -610,7 +567,7 @@ void ClassDef::writeDocumentation(OutputList &ol) pubStaticMembers.funcCount() + proMembers.funcCount() + proSlots.funcCount() + proStaticMembers.funcCount() + - (extractPrivateFlag ? + (Config::extractPrivateFlag ? priMembers.funcCount() + priSlots.funcCount() + priStaticMembers.funcCount() : 0 ) @@ -628,7 +585,7 @@ void ClassDef::writeDocumentation(OutputList &ol) writeMemberDocs(ol,&proMembers,name(),MemberDef::Function); writeMemberDocs(ol,&proSlots,name(),MemberDef::Slot); writeMemberDocs(ol,&proStaticMembers,name(),MemberDef::Function); - if (extractPrivateFlag) + if (Config::extractPrivateFlag) { writeMemberDocs(ol,&priMembers,name(),MemberDef::Function); writeMemberDocs(ol,&priSlots,name(),MemberDef::Slot); @@ -636,7 +593,7 @@ void ClassDef::writeDocumentation(OutputList &ol) } } - if ( friends.count() + related.count() ) + if ( friends.friendCount() + related.count() ) { ol.writeRuler(); ol.startGroupHeader(); @@ -649,7 +606,7 @@ void ClassDef::writeDocumentation(OutputList &ol) if ( pubMembers.varCount() + pubStaticMembers.varCount() + proMembers.varCount() + proStaticMembers.varCount() + - (extractPrivateFlag ? + (Config::extractPrivateFlag ? priMembers.varCount() + priStaticMembers.varCount() : 0 ) ) @@ -663,7 +620,7 @@ void ClassDef::writeDocumentation(OutputList &ol) writeMemberDocs(ol,&pubStaticMembers,name(),MemberDef::Variable); writeMemberDocs(ol,&proMembers,name(),MemberDef::Variable); writeMemberDocs(ol,&proStaticMembers,name(),MemberDef::Variable); - if (extractPrivateFlag) + if (Config::extractPrivateFlag) { writeMemberDocs(ol,&priMembers,name(),MemberDef::Variable); writeMemberDocs(ol,&priStaticMembers,name(),MemberDef::Variable); @@ -691,13 +648,13 @@ void ClassDef::writeDocumentation(OutputList &ol) } ol.writeListItem(); - QString path=fd->getPath().copy(); - if (fullPathNameFlag) + QCString path=fd->getPath().copy(); + if (Config::fullPathNameFlag) { // strip part of the path - if (path.left(stripFromPath.length())==stripFromPath) + if (path.left(Config::stripFromPath.length())==Config::stripFromPath) { - path=path.right(path.length()-stripFromPath.length()); + path=path.right(path.length()-Config::stripFromPath.length()); } ol.docify(path); } @@ -723,7 +680,7 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.startGroupHeader(); parseText(ol,theTranslator->trAuthor()); ol.endGroupHeader(); - parseText(ol,theTranslator->trGeneratedAutomatically(projectName)); + parseText(ol,theTranslator->trGeneratedAutomatically(Config::projectName)); ol.enableAll(); endFile(ol); @@ -776,7 +733,7 @@ void ClassDef::writeMemberList(OutputList &ol) if (cd && !md->name().isEmpty() && md->name()[0]!='@' && ( md->isFriend() || - (mi->prot!=Private && (protect!=Private || extractPrivateFlag)) + (mi->prot!=Private && (protect!=Private || Config::extractPrivateFlag)) ) ) { @@ -784,7 +741,7 @@ void ClassDef::writeMemberList(OutputList &ol) if (cd->isVisible() && (md->hasDocumentation() || md->isReference())) // create a link to the documentation { - QString name=mi->ambiguityResolutionScope+md->name(); + QCString name=mi->ambiguityResolutionScope+md->name(); ol.writeListItem(); ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(), md->anchor(),name); @@ -801,7 +758,7 @@ void ClassDef::writeMemberList(OutputList &ol) ol.writeString("\n"); memberWritten=TRUE; } - else if (!hideMemberFlag) // no documentation, + else if (!Config::hideMemberFlag) // no documentation, // generate link to the class instead. { ol.writeListItem(); @@ -874,7 +831,7 @@ void ClassDef::writeIncludeFile(OutputList &ol) ol.disableAllBut(OutputGenerator::Html); startFile(ol,fileName+"-include",name()+" Include File"); startTitle(ol); - QString n=incName.copy(); + QCString n=incName.copy(); if (incName.isNull()) n=incFile->name(); parseText(ol,n); endTitle(ol,0); @@ -917,7 +874,7 @@ bool ClassDef::hasExamples() // write the list of all examples that are use this class. void ClassDef::writeExample(OutputList &ol) { - QString exampleLine=theTranslator->trWriteList(exampleList->count()); + QCString exampleLine=theTranslator->trWriteList(exampleList->count()); QRegExp marker("@[0-9]+"); int index=0,newIndex,matchLen; @@ -970,9 +927,9 @@ void ClassDef::setTemplateArguments(ArgumentList *al) } } -QString ClassDef::getTemplateNameString() +QCString ClassDef::getTemplateNameString() { - QString result; + QCString result; if (!tempArgs || tempArgs->count()==0) return result; result="<"; Argument *a=tempArgs->first(); diff --git a/src/classdef.h b/src/classdef.h index d5fc466..dd24b69 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -17,11 +17,11 @@ #ifndef CLASSDEF_H #define CLASSDEF_H -#include +//#include +#include "qtbc.h" #include #include #include -#include #include #include "membername.h" @@ -51,8 +51,8 @@ class ClassDef : public Definition ClassDef(const char *name,CompoundType ct,const char *ref=0,const char *fName=0); ~ClassDef(); - //QString classFile() const { return fileName; } - QString getOutputFileBase() const { return fileName; } + //QCString classFile() const { return fileName; } + QCString getOutputFileBase() const { return fileName; } CompoundType compoundType() const { return compType; } const char *memberListFileName() const { return memListFileName; } void insertBaseClass(ClassDef *,Protection p,Specifier s,const char *t=0); @@ -81,34 +81,35 @@ class ClassDef : public Definition Protection protection() const { return prot; } bool isVisible() { return !name().isEmpty() && name().at(0)!='@' && - (prot!=Private || extractPrivateFlag) && + (prot!=Private || Config::extractPrivateFlag) && hasDocumentation(); } bool hasNonReferenceSuperClass(); bool isVisibleExt() - { return (allExtFlag || hasNonReferenceSuperClass()) && + { return (Config::allExtFlag || hasNonReferenceSuperClass()) && !name().isEmpty() && name().at(0)!='@' && - (prot!=Private || extractPrivateFlag) && - (hasDocumentation() || !hideClassFlag || !reference.isNull()); + (prot!=Private || Config::extractPrivateFlag) && + (hasDocumentation() || !Config::hideClassFlag || + !reference.isNull()); } // template argument functions ArgumentList *templateArguments() const { return tempArgs; } void setTemplateArguments(ArgumentList *al); - QString getTemplateNameString(); + QCString getTemplateNameString(); void setNamespace(NamespaceDef *nd) { nspace = nd; } NamespaceDef *getNamespace() { return nspace; } bool visited; private: - //QString name; // name of the class - QString fileName; // HTML containing the class docs - //QString doc; // general class documentation + //QCString name; // name of the class + QCString fileName; // HTML containing the class docs + //QCString doc; // general class documentation FileDef *incFile; // header file to refer to - QString incName; // alternative include file name - //QString brief; // brief class discription - QString memListFileName; + QCString incName; // alternative include file name + //QCString brief; // brief class discription + QCString memListFileName; BaseClassList *inherits; BaseClassList *inheritedBy; NamespaceDef *nspace; // the namespace this class is in @@ -128,7 +129,7 @@ class ClassDef : public Definition MemberNameInfoDict *allMemberNameInfoDict; ArgumentList *tempArgs; QStrList files; - QString reference; + QCString reference; ExampleList *exampleList; ExampleDict *exampleDict; CompoundType compType; @@ -143,7 +144,7 @@ struct BaseClassDef ClassDef *classDef; Protection prot; Specifier virt; - QString templSpecifiers; + QCString templSpecifiers; }; class BaseClassList : public QList diff --git a/src/code.h b/src/code.h index 4b781fb..bf67df6 100644 --- a/src/code.h +++ b/src/code.h @@ -17,12 +17,12 @@ #ifndef CODE_H #define CODE_H +#include "qtbc.h" #include -#include class OutputList; -extern void parseCode(OutputList &,const char *,const QString &, +extern void parseCode(OutputList &,const char *,const QCString &, bool ,const char *); extern void initParseCodeContext(); #endif diff --git a/src/code.l b/src/code.l index dd5ec0c..beafeca 100644 --- a/src/code.l +++ b/src/code.l @@ -24,8 +24,7 @@ #include #include -#include - +#include "qtbc.h" #include "scanner.h" #include "entry.h" #include "doxygen.h" @@ -47,7 +46,7 @@ class CodeClassDef } ~CodeClassDef() {} - QString name; + QCString name; QStrList bases; }; @@ -63,9 +62,9 @@ class CodeVarDef } ~CodeVarDef() {} - QString name; - QString type; - QString classScope; + QCString name; + QCString type; + QCString classScope; }; typedef QList CodeClassList; @@ -91,19 +90,19 @@ static int bracketCount = 0; static int curlyCount = 0; static int sharpCount = 0; static int yyLineNr = 0; -static QString type; -static QString name; -static QString args; -static QString parmType; -static QString parmName; +static QCString type; +static QCString name; +static QCString args; +static QCString parmType; +static QCString parmName; static bool inClass; -static QString classScope; +static QCString classScope; static OutputList *code; static CodeClassDef ccd; static CodeVarDef cvd; static bool exampleBlock; -static QString exampleName; -static QString exampleFile; +static QCString exampleName; +static QCString exampleFile; static int anchorCount; static void addType() @@ -125,9 +124,9 @@ static void addParmType() parmName.resize(0) ; } -static void setClassScope(const QString &name) +static void setClassScope(const QCString &name) { - QString n=name; + QCString n=name; n=n.simplifyWhiteSpace(); int index; if ((index=n.find("::"))!=-1) @@ -165,14 +164,14 @@ static void addParameter() static void generateClassLink(OutputList &ol,const char *clName) { - QString className=clName; + QCString className=clName; if (className.length()==0) return; ClassDef *cd; if ((cd=getClass(className)) && cd->isVisible()) { if (exampleBlock) { - QString anchor; + QCString anchor; anchor.sprintf("_a%d",anchorCount); //printf("addExampleClass(%s,%s,%s)\n",anchor.data(),exampleName.data(), // exampleFile.data()); @@ -200,16 +199,16 @@ static bool getLink(const char *className, ClassDef *cd; FileDef *fd; NamespaceDef *nd; - QString m=memberName; - QString c=className; + QCString m=memberName; + QCString c=className; //printf("Trying `%s'::`%s'\n",c.data(),m.data()); - if (getDefs(m,c,"()",md,cd,fd,nd) && + if (getDefs(c,m,"()",md,cd,fd,nd) && (md->hasDocumentation() || md->isReference())) { //printf("Found!\n"); if (exampleBlock) { - QString anchor; + QCString anchor; anchor.sprintf("a%d",anchorCount); //printf("addExampleFile(%s,%s,%s)\n",anchor.data(),exampleName.data(), // exampleFile.data()); @@ -339,6 +338,8 @@ static int yyread(char *buf,int max_size) ID [a-z_A-Z][a-z_A-Z0-9]* +%option noyywrap + %x SkipString %x SkipCPP %x SkipComment @@ -380,7 +381,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* code->codify(yytext); } char c=yyinput(); - QString text; + QCString text; text+=c; code->codify(text); BEGIN( Body ); @@ -663,7 +664,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* } [ \t]*"*/"[ \t\n]*"\n"/"/*" { //code->codify("\n"); - QString lineText=yytext; + QCString lineText=yytext; yyLineNr+=lineText.contains('\n'); BEGIN( lastDContext ) ; } @@ -700,7 +701,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* code->codify(yytext); } <*>([ \t\n]*"\n"){2,} { // combine multiple blank lines - QString sepLine=yytext; + QCString sepLine=yytext; code->codify("\n\n"); yyLineNr+=sepLine.contains('\n'); } @@ -723,7 +724,7 @@ void initParseCodeContext() anchorCount = 0; } -void parseCode(OutputList &ol,const char *className,const QString &s, +void parseCode(OutputList &ol,const char *className,const QCString &s, bool e, const char *exName) { code = new OutputList(&ol); @@ -752,6 +753,6 @@ void parseCode(OutputList &ol,const char *className,const QString &s, } extern "C" { // some bogus code to keep the compiler happy - int codeYYwrap() { return 1 ; } +// int codeYYwrap() { return 1 ; } void codeYYdummy() { yy_flex_realloc(0,0); } } diff --git a/src/config.h b/src/config.h index 492f356..d2bec11 100644 --- a/src/config.h +++ b/src/config.h @@ -17,66 +17,78 @@ #ifndef CONFIG_H #define CONFIG_H -#include +#ifndef DOXYWIZARD +#include "qtbc.h" +#endif #include #include -extern void parseConfig(const QString &config); +extern void parseConfig(const QCString &config); extern void writeTemplateConfig(QFile *f,bool shortList); +extern void checkConfig(); + +struct Config +{ + static void init(); -extern QString projectName; // the name of the project -extern QString projectNumber; // the number of the project -extern QString htmlOutputDir; // the directory to put the HTML files -extern QString latexOutputDir; // the directory to put the Latex files -extern QString manOutputDir; // the directory to put the man pages -extern QString headerFile; // the name of the personal HTML header -extern QString footerFile; // the name of the personal HTML footer -extern QString cgiName; // the name of the CGI binary -extern QString cgiURL; // the absolute URL to the CGI binary -extern QString docURL; // the absolute URL to the documentation -extern QString binAbsPath; // the absolute path to the doxysearch -extern QString docAbsPath; // the absolute path to the documentation -extern QString perlPath; // the absolute path to perl -extern QString genTagFile; // the tag file to generate -extern QString inputFilter; // a filter command that is applied to input files -extern QString paperType; // the page type to generate docs for -extern QString stripFromPath; // the string to strip from the file path -extern QString manExtension; // extension the man page files -extern QStrList includePath; // list of include paths -extern QStrList examplePath; // list of example paths -extern QStrList inputSources; // list of input files -extern QStrList excludeSources; // list of files to exclude from the input -extern QStrList filePatternList; // list of file patterns -extern QStrList excludePatternList; // list of patterns to exclude from input -extern QStrList tagFileList; // list of tag files -extern QStrList extDocPathList; // list of external doc. directories. -extern QStrList predefined; // list of predefined macro names. -extern QStrList extraPackageList; // list of extra LaTeX packages. -extern bool quietFlag; // generate progress messages flag -extern bool warningFlag; // generate warnings flag -extern bool recursiveFlag; // scan directories recursively -extern bool allExtFlag; // include all external classes flag -extern bool searchEngineFlag; // generate search engine flag -extern bool extractAllFlag; // gererate docs for all classes flag -extern bool extractPrivateFlag; // generate docs for private members flag -extern bool noIndexFlag; // generate condensed index flag -extern bool generateHtml; // generate HTML output -extern bool generateLatex; // generate Latex output -extern bool generateMan; // generate Man pages -extern bool preprocessingFlag; // enable preprocessing -extern bool briefMemDescFlag; // enable `inline' brief member descr. -extern bool hideMemberFlag; // hide undocumented members. -extern bool hideClassFlag; // hide undocumented members. -extern bool searchIncludeFlag; // search for included files -extern bool macroExpansionFlag; // expand macros in the source. -extern bool onlyPredefinedFlag; // expand only predefined macros -extern bool fullPathNameFlag; // using full path name in output -extern bool classDiagramFlag; // enable the generation of class diagrams. -extern bool compactLatexFlag; // generate compact LaTeX documentation. -extern bool repeatBriefFlag; // repeat brief descriptions. -extern bool internalDocsFlag; // determines what happens to internal docs. -extern bool caseSensitiveNames; // determines if output can be mixed case. -extern bool verbatimHeaderFlag; // enable/disable generation of verb headers. -extern bool htmlAlignMemberFlag; // align members in HTML using tables. + static QCString projectName; // the name of the project + static QCString projectNumber; // the number of the project + static QCString outputDir; // the global output directory + static QCString htmlOutputDir; // the directory to put the HTML files + static QCString latexOutputDir; // the directory to put the Latex files + static QCString manOutputDir; // the directory to put the man pages + static QCString outputLanguage; // the output language + static QCString headerFile; // the name of the personal HTML header + static QCString footerFile; // the name of the personal HTML footer + static QCString cgiName; // the name of the CGI binary + static QCString cgiURL; // the absolute URL to the CGI binary + static QCString docURL; // the absolute URL to the documentation + static QCString binAbsPath; // the absolute path to the doxysearch + static QCString docAbsPath; // the absolute path to the documentation + static QCString perlPath; // the absolute path to perl + static QCString genTagFile; // the tag file to generate + static QCString inputFilter; // a filter command that is applied to input files + static QCString paperType; // the page type to generate docs for + static QCString stripFromPath; // the string to strip from the file path + static QCString manExtension; // extension the man page files + static QStrList includePath; // list of include paths + static QStrList examplePath; // list of example paths + static QStrList inputSources; // list of input files + static QStrList excludeSources; // list of files to exclude from the input + static QStrList filePatternList; // list of file patterns + static QStrList excludePatternList; // list of patterns to exclude from input + static QStrList tagFileList; // list of tag files + static QStrList extDocPathList; // list of external doc. directories. + static QStrList predefined; // list of predefined macro names. + static QStrList extraPackageList; // list of extra LaTeX packages. + static bool quietFlag; // generate progress messages flag + static bool warningFlag; // generate warnings flag + static bool recursiveFlag; // scan directories recursively + static bool allExtFlag; // include all external classes flag + static bool searchEngineFlag; // generate search engine flag + static bool extractAllFlag; // gererate docs for all classes flag + static bool extractPrivateFlag; // generate docs for private members flag + static bool noIndexFlag; // generate condensed index flag + static bool generateHtml; // generate HTML output + static bool generateLatex; // generate Latex output + static bool generateMan; // generate Man pages + static bool preprocessingFlag; // enable preprocessing + static bool briefMemDescFlag; // enable `inline' brief member descr. + static bool hideMemberFlag; // hide undocumented members. + static bool hideClassFlag; // hide undocumented members. + static bool searchIncludeFlag; // search for included files + static bool macroExpansionFlag; // expand macros in the source. + static bool onlyPredefinedFlag; // expand only predefined macros + static bool fullPathNameFlag; // using full path name in output + static bool classDiagramFlag; // enable the generation of class diagrams. + static bool compactLatexFlag; // generate compact LaTeX documentation. + static bool repeatBriefFlag; // repeat brief descriptions. + static bool internalDocsFlag; // determines what happens to internal docs. + static bool caseSensitiveNames; // determines if output can be mixed case. + static bool verbatimHeaderFlag; // enable/disable generation of verb headers. + static bool htmlAlignMemberFlag; // align members in HTML using tables. + static bool includeSourceFlag; // include source code in documentation. + static bool autoBriefFlag; // javadoc comments behaves as Qt comments. +}; #endif diff --git a/src/config.l b/src/config.l index 0545f32..57897e9 100644 --- a/src/config.l +++ b/src/config.l @@ -24,17 +24,36 @@ #include #include -#include #include #include #include -#include "doxygen.h" #include "config.h" +#include "version.h" + +#ifdef DOXYWIZARD +#include +void err(const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + vfprintf(stderr, fmt, args); + va_end(args); +} +void warn(const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + vfprintf(stderr, fmt, args); + va_end(args); +} +#else +#include "doxygen.h" #include "message.h" #include "pre.h" #include "version.h" #include "language.h" +#endif #define YY_NEVER_INTERACTIVE 1 @@ -43,62 +62,65 @@ * exported variables */ -QString projectName; -QString projectNumber; -QString outputDir; -QString htmlOutputDir; -QString latexOutputDir; -QString manOutputDir; -QString headerFile; -QString footerFile; -QString cgiName; -QString cgiURL; -QString docURL; -QString binAbsPath; -QString docAbsPath; -QString perlPath; -QString genTagFile; -QString inputFilter; -QString paperType; -QString outputLanguage; -QString stripFromPath; -QString manExtension; -QStrList includePath; -QStrList examplePath; -QStrList inputSources; -QStrList excludeSources; -QStrList filePatternList; -QStrList excludePatternList; -QStrList tagFileList; -QStrList extDocPathList; -QStrList predefined; -QStrList extraPackageList; -bool quietFlag = FALSE; -bool warningFlag = FALSE; -bool recursiveFlag = FALSE; -bool allExtFlag = FALSE; -bool searchEngineFlag = FALSE; -bool extractAllFlag = FALSE; -bool extractPrivateFlag = FALSE; -bool noIndexFlag = FALSE; -bool hideMemberFlag = FALSE; -bool hideClassFlag = FALSE; -bool macroExpansionFlag = FALSE; -bool onlyPredefinedFlag = FALSE; -bool fullPathNameFlag = FALSE; -bool compactLatexFlag = FALSE; -bool internalDocsFlag = FALSE; -bool caseSensitiveNames = FALSE; -bool generateHtml = TRUE; -bool generateLatex = TRUE; -bool generateMan = TRUE; -bool preprocessingFlag = TRUE; -bool briefMemDescFlag = TRUE; -bool searchIncludeFlag = TRUE; -bool classDiagramFlag = TRUE; -bool repeatBriefFlag = TRUE; -bool verbatimHeaderFlag = TRUE; -bool htmlAlignMemberFlag = TRUE; + +QCString Config::projectName; +QCString Config::projectNumber; +QCString Config::outputDir; +QCString Config::htmlOutputDir; +QCString Config::latexOutputDir; +QCString Config::manOutputDir; +QCString Config::outputLanguage; +QCString Config::headerFile; +QCString Config::footerFile; +QCString Config::cgiName; +QCString Config::cgiURL; +QCString Config::docURL; +QCString Config::binAbsPath; +QCString Config::docAbsPath; +QCString Config::perlPath; +QCString Config::genTagFile; +QCString Config::inputFilter; +QCString Config::paperType; +QCString Config::stripFromPath; +QCString Config::manExtension; +QStrList Config::includePath; +QStrList Config::examplePath; +QStrList Config::inputSources; +QStrList Config::excludeSources; +QStrList Config::filePatternList; +QStrList Config::excludePatternList; +QStrList Config::tagFileList; +QStrList Config::extDocPathList; +QStrList Config::predefined; +QStrList Config::extraPackageList; +bool Config::quietFlag = FALSE; +bool Config::recursiveFlag = FALSE; +bool Config::allExtFlag = FALSE; +bool Config::searchEngineFlag = FALSE; +bool Config::extractAllFlag = FALSE; +bool Config::extractPrivateFlag = FALSE; +bool Config::noIndexFlag = FALSE; +bool Config::hideMemberFlag = FALSE; +bool Config::hideClassFlag = FALSE; +bool Config::macroExpansionFlag = FALSE; +bool Config::onlyPredefinedFlag = FALSE; +bool Config::fullPathNameFlag = FALSE; +bool Config::compactLatexFlag = FALSE; +bool Config::internalDocsFlag = FALSE; +bool Config::caseSensitiveNames = FALSE; +bool Config::includeSourceFlag = FALSE; +bool Config::autoBriefFlag = TRUE; +bool Config::warningFlag = TRUE; +bool Config::generateHtml = TRUE; +bool Config::generateLatex = TRUE; +bool Config::generateMan = TRUE; +bool Config::preprocessingFlag = TRUE; +bool Config::briefMemDescFlag = TRUE; +bool Config::searchIncludeFlag = TRUE; +bool Config::classDiagramFlag = TRUE; +bool Config::repeatBriefFlag = TRUE; +bool Config::verbatimHeaderFlag = TRUE; +bool Config::htmlAlignMemberFlag = TRUE; /* ----------------------------------------------------------------- * @@ -108,13 +130,13 @@ bool htmlAlignMemberFlag = TRUE; static const char * inputString; static int inputPosition; static int yyLineNr; -static QString tmpString; -static QString * s=0; +static QCString tmpString; +static QCString * s=0; static bool * b=0; static QStrList * l=0; static int lastState; static int lastEnvState; -static QString elemStr; +static QCString elemStr; /* ----------------------------------------------------------------- */ @@ -134,6 +156,8 @@ static int yyread(char *buf,int max_size) %} +%option noyywrap + %x Start %x SkipComment %x GetString @@ -146,62 +170,64 @@ static int yyread(char *buf,int max_size) <*>\0x0d "#" { BEGIN(SkipComment); } -"PROJECT_NAME"[ \t]*"=" { BEGIN(GetString); s=&projectName; } -"PROJECT_NUMBER"[ \t]*"=" { BEGIN(GetString); s=&projectNumber; } -"OUTPUT_DIRECTORY"[ \t]*"=" { BEGIN(GetString); s=&outputDir; } -"HTML_OUTPUT"[ \t]*"=" { BEGIN(GetString); s=&htmlOutputDir; } -"MAN_OUTPUT"[ \t]*"=" { BEGIN(GetString); s=&manOutputDir; } -"LATEX_OUTPUT"[ \t]*"=" { BEGIN(GetString); s=&latexOutputDir; } -"HTML_HEADER"[ \t]*"=" { BEGIN(GetString); s=&headerFile; } -"HTML_FOOTER"[ \t]*"=" { BEGIN(GetString); s=&footerFile; } -"CGI_NAME"[ \t]*"=" { BEGIN(GetString); s=&cgiName; } -"CGI_URL"[ \t]*"=" { BEGIN(GetString); s=&cgiURL; } -"DOC_URL"[ \t]*"=" { BEGIN(GetString); s=&docURL; } -"BIN_ABSPATH"[ \t]*"=" { BEGIN(GetString); s=&binAbsPath; } -"DOC_ABSPATH"[ \t]*"=" { BEGIN(GetString); s=&docAbsPath; } -"PERL_PATH"[ \t]*"=" { BEGIN(GetString); s=&perlPath; } -"GENERATE_TAGFILE"[ \t]*"=" { BEGIN(GetString); s=&genTagFile; } -"INPUT_FILTER"[ \t]*"=" { BEGIN(GetString); s=&inputFilter; } -"PAPER_TYPE"[ \t]*"=" { BEGIN(GetString); s=&paperType; } -"OUTPUT_LANGUAGE"[ \t]*"=" { BEGIN(GetString); s=&outputLanguage; } -"STRIP_FROM_PATH"[ \t]*"=" { BEGIN(GetString); s=&stripFromPath; } -"MAN_EXTENSION"[ \t]*"=" { BEGIN(GetString); s=&manExtension; } -"INCLUDE_PATH"[ \t]*"=" { BEGIN(GetStrList); l=&includePath; elemStr=""; } -"EXAMPLE_PATH"[ \t]*"=" { BEGIN(GetStrList); l=&examplePath; elemStr=""; } -"INPUT"[ \t]*"=" { BEGIN(GetStrList); l=&inputSources; elemStr=""; } -"EXCLUDE"[ \t]*"=" { BEGIN(GetStrList); l=&excludeSources; elemStr=""; } -"FILE_PATTERNS"[ \t]*"=" { BEGIN(GetStrList); l=&filePatternList; elemStr=""; } -"EXCLUDE_PATTERNS"[ \t]*"=" { BEGIN(GetStrList); l=&excludePatternList; elemStr=""; } -"TAGFILES"[ \t]*"=" { BEGIN(GetStrList); l=&tagFileList; elemStr=""; } -"EXT_DOC_PATHS"[ \t]*"=" { BEGIN(GetStrList); l=&extDocPathList; elemStr=""; } -"PREDEFINED"[ \t]*"=" { BEGIN(GetStrList); l=&predefined; elemStr=""; } -"EXTRA_PACKAGES"[ \t]*"=" { BEGIN(GetStrList); l=&extraPackageList; elemStr=""; } -"QUIET"[ \t]*"=" { BEGIN(GetBool); b=&quietFlag; } -"WARNINGS"[ \t]*"=" { BEGIN(GetBool); b=&warningFlag; } -"RECURSIVE"[ \t]*"=" { BEGIN(GetBool); b=&recursiveFlag; } -"ALLEXTERNALS"[ \t]*"=" { BEGIN(GetBool); b=&allExtFlag; } -"SEARCHENGINE"[ \t]*"=" { BEGIN(GetBool); b=&searchEngineFlag; } -"EXTRACT_ALL"[ \t]*"=" { BEGIN(GetBool); b=&extractAllFlag; } -"EXTRACT_PRIVATE"[ \t]*"=" { BEGIN(GetBool); b=&extractPrivateFlag; } -"DISABLE_INDEX"[ \t]*"=" { BEGIN(GetBool); b=&noIndexFlag; } -"GENERATE_LATEX"[ \t]*"=" { BEGIN(GetBool); b=&generateLatex; } -"GENERATE_HTML"[ \t]*"=" { BEGIN(GetBool); b=&generateHtml; } -"GENERATE_MAN"[ \t]*"=" { BEGIN(GetBool); b=&generateMan; } -"ENABLE_PREPROCESSING"[ \t]*"=" { BEGIN(GetBool); b=&preprocessingFlag; } -"MACRO_EXPANSION"[ \t]*"=" { BEGIN(GetBool); b=¯oExpansionFlag; } -"SEARCH_INCLUDES"[ \t]*"=" { BEGIN(GetBool); b=&searchIncludeFlag; } -"BRIEF_MEMBER_DESC"[ \t]*"=" { BEGIN(GetBool); b=&briefMemDescFlag; } -"HIDE_UNDOC_MEMBERS"[ \t]*"=" { BEGIN(GetBool); b=&hideMemberFlag; } -"HIDE_UNDOC_CLASSES"[ \t]*"=" { BEGIN(GetBool); b=&hideClassFlag; } -"EXPAND_ONLY_PREDEF"[ \t]*"=" { BEGIN(GetBool); b=&onlyPredefinedFlag; } -"FULL_PATH_NAMES"[ \t]*"=" { BEGIN(GetBool); b=&fullPathNameFlag; } -"CLASS_DIAGRAMS"[ \t]*"=" { BEGIN(GetBool); b=&classDiagramFlag; } -"COMPACT_LATEX"[ \t]*"=" { BEGIN(GetBool); b=&compactLatexFlag; } -"REPEAT_BRIEF"[ \t]*"=" { BEGIN(GetBool); b=&repeatBriefFlag; } -"INTERNAL_DOCS"[ \t]*"=" { BEGIN(GetBool); b=&internalDocsFlag; } -"CASE_SENSE_NAMES"[ \t]*"=" { BEGIN(GetBool); b=&caseSensitiveNames; } -"VERBATIM_HEADERS"[ \t]*"=" { BEGIN(GetBool); b=&verbatimHeaderFlag; } -"HTML_ALIGN_MEMBERS"[ \t]*"=" { BEGIN(GetBool); b=&htmlAlignMemberFlag; } +"PROJECT_NAME"[ \t]*"=" { BEGIN(GetString); s=&Config::projectName; } +"PROJECT_NUMBER"[ \t]*"=" { BEGIN(GetString); s=&Config::projectNumber; } +"OUTPUT_DIRECTORY"[ \t]*"=" { BEGIN(GetString); s=&Config::outputDir; } +"HTML_OUTPUT"[ \t]*"=" { BEGIN(GetString); s=&Config::htmlOutputDir; } +"MAN_OUTPUT"[ \t]*"=" { BEGIN(GetString); s=&Config::manOutputDir; } +"LATEX_OUTPUT"[ \t]*"=" { BEGIN(GetString); s=&Config::latexOutputDir; } +"HTML_HEADER"[ \t]*"=" { BEGIN(GetString); s=&Config::headerFile; } +"HTML_FOOTER"[ \t]*"=" { BEGIN(GetString); s=&Config::footerFile; } +"CGI_NAME"[ \t]*"=" { BEGIN(GetString); s=&Config::cgiName; } +"CGI_URL"[ \t]*"=" { BEGIN(GetString); s=&Config::cgiURL; } +"DOC_URL"[ \t]*"=" { BEGIN(GetString); s=&Config::docURL; } +"BIN_ABSPATH"[ \t]*"=" { BEGIN(GetString); s=&Config::binAbsPath; } +"DOC_ABSPATH"[ \t]*"=" { BEGIN(GetString); s=&Config::docAbsPath; } +"PERL_PATH"[ \t]*"=" { BEGIN(GetString); s=&Config::perlPath; } +"GENERATE_TAGFILE"[ \t]*"=" { BEGIN(GetString); s=&Config::genTagFile; } +"INPUT_FILTER"[ \t]*"=" { BEGIN(GetString); s=&Config::inputFilter; } +"PAPER_TYPE"[ \t]*"=" { BEGIN(GetString); s=&Config::paperType; } +"OUTPUT_LANGUAGE"[ \t]*"=" { BEGIN(GetString); s=&Config::outputLanguage; } +"STRIP_FROM_PATH"[ \t]*"=" { BEGIN(GetString); s=&Config::stripFromPath; } +"MAN_EXTENSION"[ \t]*"=" { BEGIN(GetString); s=&Config::manExtension; } +"INCLUDE_PATH"[ \t]*"=" { BEGIN(GetStrList); l=&Config::includePath; elemStr=""; } +"EXAMPLE_PATH"[ \t]*"=" { BEGIN(GetStrList); l=&Config::examplePath; elemStr=""; } +"INPUT"[ \t]*"=" { BEGIN(GetStrList); l=&Config::inputSources; elemStr=""; } +"EXCLUDE"[ \t]*"=" { BEGIN(GetStrList); l=&Config::excludeSources; elemStr=""; } +"FILE_PATTERNS"[ \t]*"=" { BEGIN(GetStrList); l=&Config::filePatternList; elemStr=""; } +"EXCLUDE_PATTERNS"[ \t]*"=" { BEGIN(GetStrList); l=&Config::excludePatternList; elemStr=""; } +"TAGFILES"[ \t]*"=" { BEGIN(GetStrList); l=&Config::tagFileList; elemStr=""; } +"EXT_DOC_PATHS"[ \t]*"=" { BEGIN(GetStrList); l=&Config::extDocPathList; elemStr=""; } +"PREDEFINED"[ \t]*"=" { BEGIN(GetStrList); l=&Config::predefined; elemStr=""; } +"EXTRA_PACKAGES"[ \t]*"=" { BEGIN(GetStrList); l=&Config::extraPackageList; elemStr=""; } +"QUIET"[ \t]*"=" { BEGIN(GetBool); b=&Config::quietFlag; } +"WARNINGS"[ \t]*"=" { BEGIN(GetBool); b=&Config::warningFlag; } +"RECURSIVE"[ \t]*"=" { BEGIN(GetBool); b=&Config::recursiveFlag; } +"ALLEXTERNALS"[ \t]*"=" { BEGIN(GetBool); b=&Config::allExtFlag; } +"SEARCHENGINE"[ \t]*"=" { BEGIN(GetBool); b=&Config::searchEngineFlag; } +"EXTRACT_ALL"[ \t]*"=" { BEGIN(GetBool); b=&Config::extractAllFlag; } +"EXTRACT_PRIVATE"[ \t]*"=" { BEGIN(GetBool); b=&Config::extractPrivateFlag; } +"DISABLE_INDEX"[ \t]*"=" { BEGIN(GetBool); b=&Config::noIndexFlag; } +"GENERATE_LATEX"[ \t]*"=" { BEGIN(GetBool); b=&Config::generateLatex; } +"GENERATE_HTML"[ \t]*"=" { BEGIN(GetBool); b=&Config::generateHtml; } +"GENERATE_MAN"[ \t]*"=" { BEGIN(GetBool); b=&Config::generateMan; } +"ENABLE_PREPROCESSING"[ \t]*"=" { BEGIN(GetBool); b=&Config::preprocessingFlag; } +"MACRO_EXPANSION"[ \t]*"=" { BEGIN(GetBool); b=&Config::macroExpansionFlag; } +"SEARCH_INCLUDES"[ \t]*"=" { BEGIN(GetBool); b=&Config::searchIncludeFlag; } +"BRIEF_MEMBER_DESC"[ \t]*"=" { BEGIN(GetBool); b=&Config::briefMemDescFlag; } +"HIDE_UNDOC_MEMBERS"[ \t]*"=" { BEGIN(GetBool); b=&Config::hideMemberFlag; } +"HIDE_UNDOC_CLASSES"[ \t]*"=" { BEGIN(GetBool); b=&Config::hideClassFlag; } +"EXPAND_ONLY_PREDEF"[ \t]*"=" { BEGIN(GetBool); b=&Config::onlyPredefinedFlag; } +"FULL_PATH_NAMES"[ \t]*"=" { BEGIN(GetBool); b=&Config::fullPathNameFlag; } +"CLASS_DIAGRAMS"[ \t]*"=" { BEGIN(GetBool); b=&Config::classDiagramFlag; } +"COMPACT_LATEX"[ \t]*"=" { BEGIN(GetBool); b=&Config::compactLatexFlag; } +"REPEAT_BRIEF"[ \t]*"=" { BEGIN(GetBool); b=&Config::repeatBriefFlag; } +"INTERNAL_DOCS"[ \t]*"=" { BEGIN(GetBool); b=&Config::internalDocsFlag; } +"CASE_SENSE_NAMES"[ \t]*"=" { BEGIN(GetBool); b=&Config::caseSensitiveNames; } +"VERBATIM_HEADERS"[ \t]*"=" { BEGIN(GetBool); b=&Config::verbatimHeaderFlag; } +"HTML_ALIGN_MEMBERS"[ \t]*"=" { BEGIN(GetBool); b=&Config::htmlAlignMemberFlag; } +"SOURCE_BROWSER"[ \t]*"=" { BEGIN(GetBool); b=&Config::includeSourceFlag; } +"JAVADOC_AUTOBRIEF"[ \t]*"=" { BEGIN(GetBool); b=&Config::autoBriefFlag; } [a-z_A-Z0-9]+ { err("Warning: ignoring unknown tag `%s' at line %d\n",yytext,yyLineNr); } \n { yyLineNr++; BEGIN(Start); } \n { @@ -258,7 +284,7 @@ static int yyread(char *buf,int max_size) } . { tmpString+=*yytext; } [a-zA-Z]+ { - QString bs=yytext; + QCString bs=yytext; bs=bs.upper(); if (bs=="YES") *b=TRUE; @@ -272,11 +298,6 @@ static int yyread(char *buf,int max_size) bs.data(),yyLineNr); } } - /* -[a-z_A-Z.*:?~0-9/\\\-]+ { - elemStr+=yytext; - } - */ [^ \#\"\$\t\r\n]+ { elemStr+=yytext; } @@ -294,56 +315,122 @@ static int yyread(char *buf,int max_size) void dumpConfig() { - printf("projectName=`%s'\n",projectName.data()); - printf("outputDir=`%s'\n", outputDir.data()); - printf("headerFile=`%s'\n", headerFile.data()); - printf("footerFile=`%s'\n", footerFile.data()); - char *ip=includePath.first(); + printf("projectName=`%s'\n",Config::projectName.data()); + printf("outputDir=`%s'\n", Config::outputDir.data()); + printf("headerFile=`%s'\n", Config::headerFile.data()); + printf("footerFile=`%s'\n", Config::footerFile.data()); + char *ip=Config::includePath.first(); while (ip) { printf("includePath=`%s'\n",ip); - ip=includePath.next(); + ip=Config::includePath.next(); } - printf("quiet=`%d'\n", quietFlag); - printf("warnings=`%d'\n", warningFlag); - char *is=inputSources.first(); + printf("quiet=`%d'\n", Config::quietFlag); + printf("warnings=`%d'\n", Config::warningFlag); + char *is=Config::inputSources.first(); while (is) { printf("inputSources=`%s'\n",is); - is=inputSources.next(); + is=Config::inputSources.next(); } - char *fp=filePatternList.first(); + char *fp=Config::filePatternList.first(); while (fp) { printf("filePattern=`%s'\n",fp); - fp=filePatternList.next(); + fp=Config::filePatternList.next(); } - printf("recusive=`%d'\n",recursiveFlag); - printf("inputFilter=`%s'\n",inputFilter.data()); - char *tf=tagFileList.first(); + printf("recusive=`%d'\n",Config::recursiveFlag); + printf("inputFilter=`%s'\n",Config::inputFilter.data()); + char *tf=Config::tagFileList.first(); while (tf) { printf("tagFile=`%s'\n",tf); - tf=tagFileList.next(); - } - printf("allExternals=`%d'\n",allExtFlag); - printf("searchEngine=`%d'\n",searchEngineFlag); - printf("cgiName=`%s'\n",cgiName.data()); - printf("cgiURL=`%s'\n",cgiURL.data()); - printf("docURL=`%s'\n",docURL.data()); - printf("binAbsPath=`%s'\n",binAbsPath.data()); - char *ed=extDocPathList.first(); + tf=Config::tagFileList.next(); + } + printf("allExternals=`%d'\n",Config::allExtFlag); + printf("searchEngine=`%d'\n",Config::searchEngineFlag); + printf("cgiName=`%s'\n",Config::cgiName.data()); + printf("cgiURL=`%s'\n",Config::cgiURL.data()); + printf("docURL=`%s'\n",Config::docURL.data()); + printf("binAbsPath=`%s'\n",Config::binAbsPath.data()); + char *ed=Config::extDocPathList.first(); while (ed) { printf("binAbsPathFile=`%s'\n",ed); - ed=extDocPathList.next(); + ed=Config::extDocPathList.next(); } } +void Config::init() +{ + Config::projectName.resize(0); + Config::projectNumber.resize(0); + Config::outputDir.resize(0); + Config::htmlOutputDir = "html"; + Config::latexOutputDir ="latex"; + Config::manOutputDir ="man"; + Config::outputLanguage = "English"; + Config::headerFile.resize(0); + Config::footerFile.resize(0); + Config::cgiName = "search.cgi"; + Config::cgiURL.resize(0); + Config::docURL.resize(0); + Config::binAbsPath = "/usr/local/bin/"; + Config::docAbsPath.resize(0); + Config::perlPath = "/usr/bin/perl"; + Config::genTagFile.resize(0); + Config::inputFilter.resize(0); + Config::paperType = "a4wide"; + Config::stripFromPath.resize(0); + Config::manExtension = ".3"; + Config::includePath.clear(); + Config::examplePath.clear(); + Config::inputSources.clear(); + Config::excludeSources.clear(); + Config::filePatternList.clear(); + Config::excludePatternList.clear(); + Config::tagFileList.clear(); + Config::extDocPathList.clear(); + Config::predefined.clear(); + Config::extraPackageList.clear(); + Config::quietFlag = FALSE; + Config::recursiveFlag = FALSE; + Config::allExtFlag = FALSE; + Config::searchEngineFlag = FALSE; + Config::extractAllFlag = FALSE; + Config::extractPrivateFlag = FALSE; + Config::noIndexFlag = FALSE; + Config::hideMemberFlag = FALSE; + Config::hideClassFlag = FALSE; + Config::macroExpansionFlag = FALSE; + Config::onlyPredefinedFlag = FALSE; + Config::fullPathNameFlag = FALSE; + Config::compactLatexFlag = FALSE; + Config::internalDocsFlag = FALSE; + Config::caseSensitiveNames = FALSE; + Config::includeSourceFlag = FALSE; + Config::warningFlag = TRUE; + Config::generateHtml = TRUE; + Config::generateLatex = TRUE; + Config::generateMan = TRUE; + Config::preprocessingFlag = TRUE; + Config::briefMemDescFlag = TRUE; + Config::searchIncludeFlag = TRUE; + Config::classDiagramFlag = TRUE; + Config::repeatBriefFlag = TRUE; + Config::verbatimHeaderFlag = TRUE; + Config::htmlAlignMemberFlag = TRUE; + Config::autoBriefFlag = TRUE; +} + void writeTemplateConfig(QFile *f,bool sl) { QTextStream t(f); +#ifdef DOXYWIZARD + t << "# Doxygen configuration generated by Doxywizard version " << versionString << endl; +#else t << "# Doxyfile " << versionString << endl; +#endif if (!sl) { t << "# This file describes the settings to be used by doxygen for a project\n"; @@ -387,7 +474,8 @@ void writeTemplateConfig(QFile *f,bool sl) t << "# The OUTPUT_LANGUAGE tag is used to specify the language in which all\n"; t << "# documentation generated by doxygen is written. Doxygen will use this\n"; t << "# information to generate all constant output in the proper language.\n"; - t << "# The default language is English, other supported languages are: Dutch\n"; + t << "# The default language is English, other supported languages are: \n"; + t << "# Dutch, French, Italian, Czech, Swedish, German and Japanese\n"; t << "\n"; } t << "OUTPUT_LANGUAGE = English\n"; @@ -516,11 +604,20 @@ void writeTemplateConfig(QFile *f,bool sl) t << "# supports case sensitive file names.\n"; t << "\n"; } + t << "SOURCE_BROWSER = NO\n"; + if (!sl) + { + t << "\n"; + t << "# If the SOURCE_BROWSER tag is set to YES than the body of a member or\n"; + t << "# function will be appended as a block of code to the documentation of.\n"; + t << "# that member or function.\n"; + t << "\n"; + } t << "CASE_SENSE_NAMES = NO\n"; if (!sl) { t << "\n"; - t << "# If the VERBATIM_HEADERS tag is set the YES (the default) then Doxygen\n"; + t << "# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen\n"; t << "# will generate a verbatim copy of the header file for each class for\n"; t << "# which an include is specified. Set to NO to disable this.\n"; t << "\n"; @@ -529,6 +626,16 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; + t << "# If the JAVADOC_NO_AUTOBRIEF is set to YES (the default) then Doxygen\n"; + t << "# will interpret the first line (until the first dot) of a JavaDoc-style\n"; + t << "# comment as the brief description. If set to NO, the Javadoc-style will\n"; + t << "# behave just like the Qt-style comments.\n"; + t << "\n"; + } + t << "JAVADOC_AUTOBRIEF = YES\n"; + if (!sl) + { + t << "\n"; t << "#---------------------------------------------------------------------------\n"; t << "# configuration options related to the input files\n"; t << "#---------------------------------------------------------------------------\n"; @@ -817,7 +924,7 @@ void writeTemplateConfig(QFile *f,bool sl) t << "# interpreter (i.e. the result of `which perl').\n"; t << "\n"; } - t << "PERL_PATH = /usr/local/bin/perl\n"; + t << "PERL_PATH = /usr/bin/perl\n"; if (!sl) { t << "\n"; @@ -893,147 +1000,154 @@ void checkConfig() //} // set default man page extension if non is given by the user - if (manExtension.isEmpty()) + if (Config::manExtension.isEmpty()) { - manExtension=".3"; + Config::manExtension=".3"; } - paperType = paperType.lower().stripWhiteSpace(); - if (paperType.isEmpty()) + Config::paperType = Config::paperType.lower().stripWhiteSpace(); + if (Config::paperType.isEmpty()) { - paperType = "a4wide"; + Config::paperType = "a4wide"; } - if (paperType!="a4" && paperType!="a4wide" && paperType!="letter" && - paperType!="legal" && paperType!="executive") + if (Config::paperType!="a4" && Config::paperType!="a4wide" && Config::paperType!="letter" && + Config::paperType!="legal" && Config::paperType!="executive") { err("Error: Unknown page type specified"); } - outputLanguage=outputLanguage.stripWhiteSpace(); - if (outputLanguage.isEmpty()) + Config::outputLanguage=Config::outputLanguage.stripWhiteSpace(); + if (Config::outputLanguage.isEmpty()) { + Config::outputLanguage = "English"; +#ifndef DOXYWIZARD setTranslator("English"); +#endif } else { - if (!setTranslator(outputLanguage)) +#ifndef DOXYWIZARD + if (!setTranslator(Config::outputLanguage)) { - err("Error: Output language %s not supported! Using english instead.\n", - outputLanguage.data()); + err("Error: Output language %s not supported! Using English instead.\n", + Config::outputLanguage.data()); } +#endif } // Test to see if output directory is valid - if (outputDir.isEmpty()) - outputDir=QDir::currentDirPath(); + if (Config::outputDir.isEmpty()) + Config::outputDir=QDir::currentDirPath(); else { - QDir dir(outputDir); + QDir dir(Config::outputDir); if (!dir.exists()) { dir.setPath(QDir::currentDirPath()); - if (!dir.mkdir(outputDir)) + if (!dir.mkdir(Config::outputDir)) { err("Error: tag OUTPUT_DIRECTORY: Output directory `%s' does not " - "exist and cannot be created\n",outputDir.data()); + "exist and cannot be created\n",Config::outputDir.data()); exit(1); } - else if (!quietFlag) + else if (!Config::quietFlag) { err("Notice: Output directory `%s' does not exist. " - "I have created it for you.\n", outputDir.data()); + "I have created it for you.\n", Config::outputDir.data()); } - dir.cd(outputDir); + dir.cd(Config::outputDir); } - outputDir=dir.absPath(); + Config::outputDir=dir.absPath(); } - if (htmlOutputDir.isEmpty() && generateHtml) + if (Config::htmlOutputDir.isEmpty() && Config::generateHtml) { - htmlOutputDir=outputDir+"/html"; + Config::htmlOutputDir=Config::outputDir+"/html"; } - else if (htmlOutputDir && htmlOutputDir[0]!='/') + else if (Config::htmlOutputDir && Config::htmlOutputDir[0]!='/') { - htmlOutputDir.prepend(outputDir+'/'); + Config::htmlOutputDir.prepend(Config::outputDir+'/'); } - QDir htmlDir(htmlOutputDir); - if (!htmlDir.exists() && !htmlDir.mkdir(htmlOutputDir)) + QDir htmlDir(Config::htmlOutputDir); + if (!htmlDir.exists() && !htmlDir.mkdir(Config::htmlOutputDir)) { - err("Could not create output directory %s\n",htmlOutputDir.data()); + err("Could not create output directory %s\n",Config::htmlOutputDir.data()); exit(1); } - if (latexOutputDir.isEmpty() && generateLatex) + if (Config::latexOutputDir.isEmpty() && Config::generateLatex) { - latexOutputDir=outputDir+"/latex"; + Config::latexOutputDir=Config::outputDir+"/latex"; } - else if (latexOutputDir && latexOutputDir[0]!='/') + else if (Config::latexOutputDir && Config::latexOutputDir[0]!='/') { - latexOutputDir.prepend(outputDir+'/'); + Config::latexOutputDir.prepend(Config::outputDir+'/'); } - QDir latexDir(latexOutputDir); - if (!latexDir.exists() && !latexDir.mkdir(latexOutputDir)) + QDir latexDir(Config::latexOutputDir); + if (!latexDir.exists() && !latexDir.mkdir(Config::latexOutputDir)) { - err("Could not create output directory %s\n",latexOutputDir.data()); + err("Could not create output directory %s\n",Config::latexOutputDir.data()); exit(1); } - if (manOutputDir.isEmpty() && generateMan) + if (Config::manOutputDir.isEmpty() && Config::generateMan) { - manOutputDir=outputDir+"/man"; + Config::manOutputDir=Config::outputDir+"/man"; } - else if (manOutputDir && manOutputDir[0]!='/') + else if (Config::manOutputDir && Config::manOutputDir[0]!='/') { - manOutputDir.prepend(outputDir+'/'); + Config::manOutputDir.prepend(Config::outputDir+'/'); } - QDir manDir(manOutputDir); - if (!manDir.exists() && !manDir.mkdir(manOutputDir)) + QDir manDir(Config::manOutputDir); + if (!manDir.exists() && !manDir.mkdir(Config::manOutputDir)) { - err("Could not create output directory %s\n",manOutputDir.data()); + err("Could not create output directory %s\n",Config::manOutputDir.data()); exit(1); } // Test to see if HTML header is valid - if (headerFile.length()>0) + if (Config::headerFile.length()>0) { - QFileInfo fi(headerFile); + QFileInfo fi(Config::headerFile); if (!fi.exists()) { err("Error: tag HTML_HEADER: header file `%s' " - "does not exist\n",headerFile.data()); + "does not exist\n",Config::headerFile.data()); exit(1); } } // Test to see if HTML footer is valid - if (footerFile.length()>0) + if (Config::footerFile.length()>0) { - QFileInfo fi(footerFile); + QFileInfo fi(Config::footerFile); if (!fi.exists()) { err("Error: tag HTML_FOOTER: footer file `%s' " - "does not exist\n",footerFile.data()); + "does not exist\n",Config::footerFile.data()); exit(1); } } // check include path - char *s=includePath.first(); + char *s=Config::includePath.first(); while (s) { QFileInfo fi(s); if (!fi.exists()) err("Warning: tag INCLUDE_PATH: include path `%s' " "does not exist\n",s); +#ifndef DOXYWIZARD addSearchDir(fi.absFilePath()); - s=includePath.next(); +#endif + s=Config::includePath.next(); } // check input - if (inputSources.count()==0) + if (Config::inputSources.count()==0) { err("Error: tag INPUT: no input files specified after the INPUT tag.\n"); exit(1); } else { - s=inputSources.first(); + s=Config::inputSources.first(); while (s) { QFileInfo fi(s); @@ -1042,89 +1156,105 @@ void checkConfig() err("Error: tag INPUT: input source `%s' does not exist\n",s); exit(1); } - s=inputSources.next(); + s=Config::inputSources.next(); } } // add default pattern if needed - if (filePatternList.count()==0) + if (Config::filePatternList.count()==0) { - filePatternList.append("*"); + Config::filePatternList.append("*"); } // more checks needed if and only if the search engine is enabled. - if (searchEngineFlag) + if (Config::searchEngineFlag) { // check cgi name - if (cgiName.length()==0) + if (Config::cgiName.length()==0) { err("Error: tag CGI_NAME: no cgi script name after the CGI_NAME tag.\n"); exit(1); } // check cgi URL - if (cgiURL.length()==0) + if (Config::cgiURL.length()==0) { err("Error: tag CGI_URL: no URL to cgi directory specified.\n"); exit(1); } - else if (cgiURL.left(7)!="http://") + else if (Config::cgiURL.left(7)!="http://") { err("Error: tag CGI_URL: URL to cgi directory is invalid (must " "start with http://).\n"); exit(1); } // check documentation URL - if (docURL.length()==0) + if (Config::docURL.length()==0) { - docURL = outputDir.copy().prepend("file://").append("html"); + Config::docURL = Config::outputDir.copy().prepend("file://").append("html"); } - else if (docURL.left(7)!="http://" && docURL.left(7)!="file://") + else if (Config::docURL.left(7)!="http://" && Config::docURL.left(7)!="file://") { err("Error: tag DOC_URL: URL to documentation is invalid or " "not absolute.\n"); exit(1); } // check absolute documentation path - if (docAbsPath.length()==0) + if (Config::docAbsPath.length()==0) { - docAbsPath = outputDir+"/html"; + Config::docAbsPath = Config::outputDir+"/html"; } - else if (docAbsPath && docAbsPath[0]!='/') + else if (Config::docAbsPath[0]!='/' && Config::docAbsPath[1]!=':') { - err("Error: tag DOC_ABSPATH: path is not absolute\n"); + err("Error: tag DOC_ABSPATH: path is not absolute!\n"); exit(1); } // check path to doxysearch - if (binAbsPath.length()==0) + if (Config::binAbsPath.length()==0) { err("Error: tag BIN_ABSPATH: no absolute path to doxysearch " "specified.\n"); exit(1); } - else + else if (Config::binAbsPath[0]!='/' && Config::binAbsPath[1]!=':') { - if (binAbsPath && binAbsPath[0]!='/') - { - err("Error: tag BIN_ABSPATH: path is not absolute " - "(must start with /).\n"); - exit(1); - } + err("Error: tag BIN_ABSPATH: path is not absolute!\n"); + exit(1); } + // check perl path - if (perlPath.length()==0) + bool found=FALSE; + if (Config::perlPath.length()==0) { - perlPath="/usr/local/bin/perl"; + QFileInfo fi; + fi.setFile("/usr/bin/perl"); + if (fi.exists()) + { + Config::perlPath="/usr/bin/perl"; + found=TRUE; + } + else + { + fi.setFile("/usr/local/bin/perl"); + if (fi.exists()) + { + Config::perlPath="/usr/local/bin/perl"; + found=TRUE; + } + } } - QFileInfo fi(perlPath); - if (!fi.exists()) + if (!found) { - err("Error: tag PERL_PATH: perl interpreter not found at `%s'\n", - perlPath.data()); - exit(1); + QFileInfo fi(Config::perlPath); + if (!fi.exists()) + { + warn("Warning: tag PERL_PATH: perl interpreter not found at default or" + "user specified (%s) location\n", + Config::perlPath.data()); + } } } } -void parseConfig(const QString &s) +void parseConfig(const QCString &s) { inputString = s; inputPosition = 0; @@ -1132,9 +1262,8 @@ void parseConfig(const QString &s) configYYrestart( configYYin ); BEGIN( Start ); configYYlex(); - checkConfig(); } -extern "C" { // some bogus code to keep the compiler happy - int configYYwrap() { return 1 ; } -} +//extern "C" { // some bogus code to keep the compiler happy +// int configYYwrap() { return 1 ; } +//} diff --git a/src/constexp.h b/src/constexp.h index 9979bfd..8c33a5e 100644 --- a/src/constexp.h +++ b/src/constexp.h @@ -18,13 +18,13 @@ #ifndef _CONSTEXP_H #define _CONSTEXP_H -#include +#include "qtbc.h" #include "cppvalue.h" -extern bool parseCppExpression(const QString &s); +extern bool parseCppExpression(const QCString &s); extern int cppExpYYparse(); extern int cppExpYYdebug; -extern QString strToken; +extern QCString strToken; extern CPPValue resultValue; #endif diff --git a/src/constexp.l b/src/constexp.l index f023507..43c7167 100644 --- a/src/constexp.l +++ b/src/constexp.l @@ -24,7 +24,7 @@ #define YY_NO_UNPUT #define YY_NEVER_INTERACTIVE 1 -QString strToken; +QCString strToken; static const char *inputString; static int inputPosition; @@ -94,7 +94,7 @@ static int yyread(char *buf,int max_size) %% -bool parseCppExpression(const QString &s) +bool parseCppExpression(const QCString &s) { //printf("Expression: `%s'\n",s.data()); inputString = s; diff --git a/src/debug.cpp b/src/debug.cpp index fc2731d..d7f1ba8 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -14,10 +14,11 @@ * */ -#include "debug.h" #include #include -#include + +#include "qtbc.h" +#include "debug.h" Debug::DebugMask Debug::curMask = Debug::Quiet; int Debug::curPrio = 0; @@ -35,7 +36,7 @@ void Debug::print(DebugMask mask,int prio,const char *fmt,...) static int labelToEnumValue(const char *l) { - QString label=l; + QCString label=l; if (label=="FindMembers") return Debug::FindMembers; else if (label=="Functions") diff --git a/src/declinfo.h b/src/declinfo.h index 4ec3ec5..df206e0 100644 --- a/src/declinfo.h +++ b/src/declinfo.h @@ -17,16 +17,16 @@ #ifndef DECLINFO_H #define DECLINFO_H +#include "qtbc.h" #include -#include -extern void parseFuncDecl(const QString &decl, - QString &clName, - QString &classTempList, - QString &type, - QString &name, - QString &args, - QString &funcTempList, - QString &exceptions +extern void parseFuncDecl(const QCString &decl, + QCString &clName, + QCString &classTempList, + QCString &type, + QCString &name, + QCString &args, + QCString &funcTempList, + QCString &exceptions ); #endif diff --git a/src/declinfo.l b/src/declinfo.l index 0f0505d..dfa3e47 100644 --- a/src/declinfo.l +++ b/src/declinfo.l @@ -37,18 +37,18 @@ static const char * inputString; static int inputPosition; -static QString scope; -static QString className; -static QString classTempList; -static QString funcTempList; -static QString type; -static QString name; -static QString args; -static QString tmpType; +static QCString scope; +static QCString className; +static QCString classTempList; +static QCString funcTempList; +static QCString type; +static QCString name; +static QCString args; +static QCString tmpType; static int sharpCount; static bool classTempListFound; static bool funcTempListFound; -static QString exceptionString; +static QCString exceptionString; static void addType() { @@ -95,6 +95,8 @@ static int yyread(char *buf,int max_size) B [ \t] ID [a-z_A-Z][a-z_A-Z0-9]* +%option noyywrap + %x Start %x Template %x ReadArgs @@ -198,8 +200,8 @@ ID [a-z_A-Z][a-z_A-Z0-9]* /*@ ---------------------------------------------------------------------------- */ -void parseFuncDecl(const QString &decl,QString &cl,QString &ctl,QString &t, - QString &n,QString &a,QString &ftl,QString &exc) +void parseFuncDecl(const QCString &decl,QCString &cl,QCString &ctl,QCString &t, + QCString &n,QCString &a,QCString &ftl,QCString &exc) { inputString = decl; //printf("Input=`%s'\n",inputString); @@ -221,17 +223,18 @@ void parseFuncDecl(const QString &decl,QString &cl,QString &ctl,QString &t, declinfoYYlex(); cl=scope.copy(); - int i; - if ((i=cl.find('<'))!=-1) // split up scope and template arguments + int il,ir; + if ((il=cl.find('<'))!=-1 && (ir=cl.findRev('>'))!=-1) // split up scope and template arguments { - ctl=removeRedundantWhiteSpace(cl.right(cl.length()-i)); - cl=cl.left(i); + if (ir==-1) ir=cl.length(); else ir++; + ctl=removeRedundantWhiteSpace(cl.mid(il,ir-il)); + cl=cl.left(il)+cl.right(cl.length()-ir); } n=removeRedundantWhiteSpace(name); - if ((i=n.find('<'))!=-1 && n.left(8)!="operator") + if ((il=n.find('<'))!=-1 && n.left(8)!="operator") { - ftl=removeRedundantWhiteSpace(n.right(n.length()-i)); - n=n.left(i); + ftl=removeRedundantWhiteSpace(n.right(n.length()-il)); + n=n.left(il); } //ctl=classTempList.copy(); @@ -253,20 +256,20 @@ void parseFuncDecl(const QString &decl,QString &cl,QString &ctl,QString &t, } -extern "C" { // some bogus code to keep the compiler happy - int declinfoYYwrap() { return 1 ; } - void declinfoYYdummy() { yy_flex_realloc(0,0); } -} +//extern "C" { // some bogus code to keep the compiler happy +// int declinfoYYwrap() { return 1 ; } +// void declinfoYYdummy() { yy_flex_realloc(0,0); } +//} #if 0 void dumpDecl(const char *s) { - QString className; - QString classTNames; - QString type; - QString name; - QString args; - QString funcTNames; + QCString className; + QCString classTNames; + QCString type; + QCString name; + QCString args; + QCString funcTNames; printf("-----------------------------------------\n"); parseFuncDecl(s,className,classTNames,type,name,args,funcTNames); printf("type=`%s' class=`%s' classTempl=`%s' name=`%s' " diff --git a/src/defargs.h b/src/defargs.h index d2cd8f2..70e901c 100644 --- a/src/defargs.h +++ b/src/defargs.h @@ -17,8 +17,8 @@ #ifndef DEFARGS_H #define DEFARGS_H +#include "qtbc.h" #include -#include class ArgumentList; diff --git a/src/defargs.l b/src/defargs.l index b7dfd57..d82c2fe 100644 --- a/src/defargs.l +++ b/src/defargs.l @@ -19,6 +19,7 @@ /* * includes */ +#include "qtbc.h" #include #include #include @@ -40,10 +41,10 @@ static const char *inputString; static int inputPosition; static ArgumentList *argList; -static QString *copyArgValue; -static QString curArgTypeName; -static QString curArgDefValue; -static QString curArgName; +static QCString *copyArgValue; +static QCString curArgTypeName; +static QCString curArgDefValue; +static QCString curArgName; static int argRoundCount; static int argSharpCount; static int argCurlyCount; @@ -72,6 +73,8 @@ static int yyread(char *buf,int max_size) B [ \t] ID [a-z_A-Z][a-z_A-Z0-9]* +%option noyywrap + %x Start %x CopyArgString %x CopyArgRound @@ -239,7 +242,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* } } {ID} { - QString name=yytext; //resolveDefines(yytext); + QCString name=yytext; //resolveDefines(yytext); //printf("resolveName `%s'->`%s'\n",yytext,name.data()); curArgTypeName+=name; } @@ -250,7 +253,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* curArgDefValue+=*yytext; } {ID} { - QString name=yytext; //resolveDefines(yytext); + QCString name=yytext; //resolveDefines(yytext); *copyArgValue+=name; } . { @@ -293,6 +296,6 @@ void stringToArgumentList(const char *argsString,ArgumentList* &al) } extern "C" { // some bogus code to keep the compiler happy - int defargsYYwrap() { return 1 ; } +// int defargsYYwrap() { return 1 ; } void defargsYYdummy() { yy_flex_realloc(0,0); } } diff --git a/src/define.cpp b/src/define.cpp index 2fa7fa4..336d6da 100644 --- a/src/define.cpp +++ b/src/define.cpp @@ -39,5 +39,5 @@ Define::~Define() bool Define::hasDocumentation() { - return definition && (doc || extractAllFlag); + return definition && (doc || Config::extractAllFlag); } diff --git a/src/define.h b/src/define.h index 14ac008..92027af 100644 --- a/src/define.h +++ b/src/define.h @@ -17,8 +17,8 @@ #ifndef DEFINE_H #define DEFINE_H +#include "qtbc.h" #include -#include #include "util.h" class FileDef; @@ -30,13 +30,13 @@ class Define Define(const Define &d); ~Define(); bool hasDocumentation(); - QString name; - QString definition; - QString fileName; - QString doc; - QString brief; - QString args; - QString anchor; + QCString name; + QCString definition; + QCString fileName; + QCString doc; + QCString brief; + QCString args; + QCString anchor; FileDef *fileDef; int lineNr; int nargs; @@ -67,7 +67,7 @@ class DefineName : public QList } private: - QString name; + QCString name; }; class DefineNameList : public QList diff --git a/src/definition.cpp b/src/definition.cpp index 328bebe..4474113 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -14,6 +14,7 @@ * */ +#include "qtbc.h" #include #include "definition.h" #include "doxygen.h" @@ -28,23 +29,23 @@ Definition::~Definition() delete sectionList; } -QString Definition::nameToFile(const char *name) +QCString Definition::nameToFile(const char *name) { - QString result; + QCString result; char c; const char *p=name; while ((c=*p++)!=0) { switch(c) { - case ':': break; + case ':': result+="_"; break; case '<': result+="_lt"; break; case '>': result+="_gt"; break; case '*': result+="_ast"; break; case '&': result+="_amp"; break; case ' ': break; default: - if (caseSensitiveNames) + if (Config::caseSensitiveNames) result+=c; else result+=tolower(c); @@ -54,10 +55,10 @@ QString Definition::nameToFile(const char *name) return result; } -void Definition::addSectionsToDefinition(QList *anchorList) +void Definition::addSectionsToDefinition(QList *anchorList) { if (!anchorList) return; - QString *s=anchorList->first(); + QCString *s=anchorList->first(); while (s) { SectionInfo *si=0; diff --git a/src/definition.h b/src/definition.h index 48301bc..282ecdc 100644 --- a/src/definition.h +++ b/src/definition.h @@ -17,7 +17,7 @@ #ifndef DEFINITION_H #define DEFINITION_H -#include +#include "qtbc.h" #include #include "config.h" #include "section.h" @@ -31,13 +31,13 @@ class Definition //! destroys the definition virtual ~Definition(); //! returns the name of the definition - QString name() const { return n; } + QCString name() const { return n; } //! returns the base name of the output file that contains this definition. - virtual QString getOutputFileBase() const = 0; + virtual QCString getOutputFileBase() const = 0; //! returns the detailed description of this definition - QString documentation() const { return doc; } + QCString documentation() const { return doc; } //! returns the brief description of this definition - QString briefDescription() const { return brief; } + QCString briefDescription() const { return brief; } //! sets a new name for the definition void setName(const char *name) { n=name; } //! sets the documentation of this definition @@ -54,16 +54,16 @@ class Definition brief.at(bl-1)!='?') brief+='.'; } //! returns TRUE iff the definition is documented - bool hasDocumentation() - { return !doc.isNull() || !brief.isNull() || extractAllFlag; } - QString nameToFile(const char *name); + virtual bool hasDocumentation() + { return !doc.isNull() || !brief.isNull() || Config::extractAllFlag; } + QCString nameToFile(const char *name); - void addSectionsToDefinition(QList *anchorList); + void addSectionsToDefinition(QList *anchorList); private: - QString n; // name of the definition - QString brief; // brief description - QString doc; // detailed description + QCString n; // name of the definition + QCString brief; // brief description + QCString doc; // detailed description SectionList *sectionList; // list of all sections }; diff --git a/src/diagram.cpp b/src/diagram.cpp index 87d5488..8cbe128 100644 --- a/src/diagram.cpp +++ b/src/diagram.cpp @@ -15,10 +15,10 @@ * */ +#include "qtbc.h" #include #include #include -#include #include #include #include @@ -43,9 +43,9 @@ const uint labelVertSpacing = 32; // vertical distance between labels const uint labelHorMargin = 6; // horiz. spacing between label and box const uint fontHeight = 12; // height of a character -//static QString escapeLatex(const char *s) +//static QCString escapeLatex(const char *s) //{ -// QString result; +// QCString result; // char c; // while ((c=*s++)) // { @@ -77,7 +77,7 @@ static uint protToColor(Protection p) return 0; } -static QString protToString(Protection p) +static QCString protToString(Protection p) { switch(p) { @@ -180,12 +180,12 @@ DiagramItem::~DiagramItem() delete children; } -QString DiagramItem::label() const +QCString DiagramItem::label() const { return classDef->name()+templSpec; } -QString DiagramItem::fileName() const +QCString DiagramItem::fileName() const { return classDef->getOutputFileBase(); } @@ -960,10 +960,10 @@ void ClassDiagram::writeFigure(QTextStream &output,const char *path, //printf("writeFigure rows=%d cols=%d\n",rows,cols); - QFile f1((QString)path+"/"+fileName+".eps"); + QFile f1((QCString)path+"/"+fileName+".eps"); if (!f1.open(IO_WriteOnly)) { - err("Could not open file %s for writing\n",f1.name()); + err("Could not open file %s for writing\n",convertToQCString(f1.name()).data()); exit(1); } QTextStream t(&f1); @@ -1229,7 +1229,7 @@ void ClassDiagram::writeImageMap(QTextStream &t,const char *path, base->drawConnectors(t,&image,TRUE,TRUE,baseRows,superRows,cellWidth,cellHeight); super->drawConnectors(t,&image,FALSE,TRUE,baseRows,superRows,cellWidth,cellHeight); - image.save((QString)path+"/"+fileName+".gif"); + image.save((QCString)path+"/"+fileName+".gif"); t << "

    " << endl; } diff --git a/src/diagram.h b/src/diagram.h index 5bc30f8..792aa8f 100644 --- a/src/diagram.h +++ b/src/diagram.h @@ -15,6 +15,7 @@ * */ +#include "qtbc.h" #include "entry.h" class ClassDef; @@ -30,8 +31,8 @@ class DiagramItem DiagramItem(DiagramItem *p,int number,ClassDef *cd, Protection prot,Specifier virt,const char *ts); ~DiagramItem(); - QString label() const; - QString fileName() const; + QCString label() const; + QCString fileName() const; DiagramItem *parentItem() { return parent; } DiagramItemList *getChildren() { return children; } void move(int dx,int dy) { x+=dx; y+=dy; } @@ -53,7 +54,7 @@ class DiagramItem int num; Protection prot; Specifier virt; - QString templSpec; + QCString templSpec; bool inList; ClassDef *classDef; }; diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 8c11c0b..76518ba 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -15,7 +15,7 @@ * */ -#include +#include "qtbc.h" #include #include #include @@ -109,6 +109,7 @@ QTextStream tagFile; void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, bool over_load); +const char idMask[] = "[A-Za-z_][A-Za-z_0-9]*"; //---------------------------------------------------------------------- // Returns the standard string that is generated when the \overload @@ -166,8 +167,8 @@ void buildGroupList(Entry *root) // // if ((gd=groupDict[root->name])) // { -// QListIterator sli(*root->groups); -// QString *s; +// QListIterator sli(*root->groups); +// QCString *s; // for (;(s=sli.current());++sli) // { // GroupDef *pgd; @@ -192,7 +193,7 @@ void buildGroupList(Entry *root) void buildFileList(Entry *root) { if (((root->section==Entry::FILEDOC_SEC) || - ((root->section & Entry::FILE_MASK) && extractAllFlag)) && + ((root->section & Entry::FILE_MASK) && Config::extractAllFlag)) && root->name.length()>0 ) { @@ -212,8 +213,8 @@ void buildFileList(Entry *root) fd->setDocumentation(root->doc); fd->setBriefDescription(root->brief); fd->addSectionsToDefinition(root->anchors); - QListIterator sli(*root->groups); - QString *s; + QListIterator sli(*root->groups); + QCString *s; for (;(s=sli.current());++sli) { GroupDef *gd=0; @@ -307,11 +308,11 @@ void addIncludeFile(ClassDef *cd,FileDef *ifd,Entry *root) /*! Input is a scopeName, output is the scopename split into a * namespace part (as large as possible) and a classname part. */ -void extractNamespaceName(const QString &scopeName, - QString &className,QString &namespaceName) +void extractNamespaceName(const QCString &scopeName, + QCString &className,QCString &namespaceName) { - QString clName=scopeName.copy(); - QString nsName; + QCString clName=scopeName.copy(); + QCString nsName; if (clName.length()>0 && namespaceDict[clName]) { // the whole name is a namespace namespaceName=clName.copy(); @@ -346,7 +347,9 @@ static bool addNamespace(Entry *root,ClassDef *cd) if (e->section==Entry::NAMESPACE_SEC) { NamespaceDef *nd=0; - if (!e->name.isEmpty() && (nd=namespaceDict[e->name])) + if (!e->name.isEmpty() && e->name.at(0)!='@' && + (nd=namespaceDict[e->name]) + ) { cd->setNamespace(nd); nd->insertClass(cd); @@ -359,6 +362,7 @@ static bool addNamespace(Entry *root,ClassDef *cd) return FALSE; } + //---------------------------------------------------------------------- // build a list of all classes mentioned in the documentation // and all classes that have a documentation block before their definition. @@ -370,7 +374,7 @@ void buildClassList(Entry *root) root->name.length()>0 ) { - QString fullName=root->name.copy(); + QCString fullName=root->name.copy(); if (fullName.length()==0) { // this should not be called @@ -379,19 +383,7 @@ void buildClassList(Entry *root) } else { - //QString className; - //QString namespaceName; - //extractNamespaceName(fullName,className,namespaceName); - - //printf("Found class %s in %s at line %d\n",fullName.data(), - // root->fileName.data(),root->startLine); - // add class name substitution entry iff the class name is alterned by a - // define. This is needed to properly document Qt's template classes - // (although, it's quite general) - //if (resolveDefines(fullName)!=fullName) - //{ - // substituteDict.insert(resolveDefines(fullName),new QString(fullName)); - //} + fullName=stripAnnonymousScope(fullName); bool ambig; ClassDef *cd; @@ -427,13 +419,7 @@ void buildClassList(Entry *root) } addNamespace(root,cd); } - else if (fullName[0]!='@' /* && - (root->doc.length()>0 || - root->brief.length()>0 || - extractAllFlag - )*/ - ) - // new class + else // new class { ClassDef::CompoundType sec=ClassDef::Class; switch(root->section) @@ -448,13 +434,12 @@ void buildClassList(Entry *root) ClassDef *cd=new ClassDef(fullName,sec); cd->setDocumentation(root->doc); // copy docs to definition cd->setBriefDescription(root->brief); - //printf("new ClassDef tempArgList=%p\n",root->tArgList); cd->setTemplateArguments(root->tArgList); cd->setProtection(root->protection); cd->addSectionsToDefinition(root->anchors); - QListIterator sli(*root->groups); - QString *s; + QListIterator sli(*root->groups); + QCString *s; for (;(s=sli.current());++sli) { GroupDef *gd=0; @@ -475,7 +460,7 @@ void buildClassList(Entry *root) // if the class is not in a namespace then we insert // it in the file definition if (!found && ifd) ifd->insertClass(cd); - + // the empty string test is needed for extract all case cd->setBriefDescription(root->brief); cd->insertUsedFile(root->fileName); @@ -506,7 +491,7 @@ void buildNamespaceList(Entry *root) root->name.length()>0 ) { - QString fullName=root->name.copy(); + QCString fullName=root->name.copy(); if (fullName.length()==0) { // this should not be called @@ -549,7 +534,7 @@ void buildNamespaceList(Entry *root) } else /* if (root->doc.length()>0 || root->brief.length()>0 || - extractAllFlag + Config::extractAllFlag ) */ { @@ -558,8 +543,8 @@ void buildNamespaceList(Entry *root) nd->setBriefDescription(root->brief); nd->addSectionsToDefinition(root->anchors); - QListIterator sli(*root->groups); - QString *s; + QListIterator sli(*root->groups); + QCString *s; for (;(s=sli.current());++sli) { GroupDef *gd=0; @@ -645,35 +630,29 @@ void buildVarList(Entry *root) } } - QString scope,name=root->name.copy(); + QCString scope,name=root->name.copy(); bool stat=root->stat; - ClassDef *cd=0; Entry *p = root->parent; - while ((p->section & Entry::COMPOUND_MASK) || - p->section==Entry::NAMESPACE_SEC) + while ((p->section & Entry::SCOPE_MASK)) { - if (p->name.length()>0 && p->name[0]!='@') + QCString scopeName = stripAnnonymousScope(p->name); + if (!scopeName.isEmpty()) { - if (!scope.isEmpty()) scope.prepend("::"); - scope.prepend(p->name); + scope.prepend(scopeName); break; } + //if (p->name.length()>0 && p->name[0]!='@') + //{ + // if (!scope.isEmpty()) scope.prepend("::"); + // scope.prepend(p->name); + // break; + //} p=p->parent; } //printf("scope=%s\n",scope.data()); int ni; -#if 0 - if ((ni=root->name.findRev("::"))!=-1) - { - if (scope.length()>0) scope+="::"; - scope+=root->name.left(ni); - name=root->name.right(root->name.length()-ni-2); - stat=TRUE; - } -#endif - if ((ni=root->name.findRev("::"))!=-1) goto nextMember; /* skip this member, because it is a * static variable definition (always?), which will be @@ -684,7 +663,7 @@ void buildVarList(Entry *root) MemberDef::MemberType mtype; // NamespaceDef *nd = 0; - QString type=root->type.stripWhiteSpace(); + QCString type=root->type.stripWhiteSpace(); if (type=="@") mtype=MemberDef::EnumValue; else if (type.left(8)=="typedef ") @@ -694,6 +673,7 @@ void buildVarList(Entry *root) else mtype=MemberDef::Variable; + ClassDef *cd=0; if (scope.length()>0 && name.length()>0 && (cd=getClass(scope))) { @@ -712,7 +692,7 @@ void buildVarList(Entry *root) // scope+=cd->getTemplateNameString(); //} // generate member definition. - QString def; + QCString def; if (root->type.length()>0) { if (mtype==MemberDef::Friend) @@ -743,23 +723,6 @@ void buildVarList(Entry *root) if (md->memberClass()==cd) // member already in the scope { addMemberDocs(root,md,def,FALSE); - -#if 0 - // always trust the most protected scope, so adjust if needed - // This is needed to properly place static private variables, - // which are defined in a `public' scope. - printf("Checking protection level\n"); - if (root->protection==Private || md->protection()!=Private) - { - printf("Set to private\n"); - md->setProtection(Private); - } - else if (root->protection==Protected && md->protection()==Public) - { - printf("Set to protected\n"); - md->setProtection(Protected); - } -#endif found=TRUE; } md=mn->next(); @@ -802,56 +765,6 @@ void buildVarList(Entry *root) cd->insertUsedFile(root->fileName); } } -#if 0 - else if (scope.length()>0 && name.length()>0 && (nd=namespaceDict[scope])) - { - Debug::print(Debug::Variables,0, - " namespace variable:\n" - " type=`%s' scope=`%s' name=`%s' args=`%s' prot=`%d\n", - root->type.data(), - scope.data(), - name.data(), - root->args.data(), - root->protection - ); - // new global variable, enum value or typedef - MemberDef *md=new MemberDef(root->type,name,root->args,0, - Public, Normal,root->stat,FALSE, - mtype,0,0); - md->setDefFile(root->fileName); - md->setDefLine(root->startLine); - md->setDocumentation(root->doc); - md->setBriefDescription(root->brief); - md->addSectionsToDefinition(root->anchors); - QString def; - nd->insertMember(md); - md->setNamespace(nd); - if (root->type.length()>0) - { - def=root->type+" "+nd->name()+"::"+name+root->args; - } - else - { - def=nd->name()+"::"+name+root->args; - } - if (def.left(7)=="static ") def=def.right(def.length()-7); - md->setDefinition(def); - - MemberName *mn; - // add member definition to the list of globals - if ((mn=namespaceNameDict[name])) - { - mn->inSort(md); - } - else - { - mn = new MemberName(name); - mn->inSort(md); - namespaceNameDict.insert(name,mn); - namespaceNameList.inSort(mn); - } - } -#endif else if (name.length()>0) // global variable { Debug::print(Debug::Variables,0, @@ -873,15 +786,15 @@ void buildVarList(Entry *root) md->setDocumentation(root->doc); md->setBriefDescription(root->brief); md->addSectionsToDefinition(root->anchors); - QString def; + QCString def; // see if the function is inside a namespace NamespaceDef *nd = 0; - if (root->parent->section == Entry::NAMESPACE_SEC ) + if (scope.length()>0) { - nd = namespaceDict[root->parent->name]; + nd = namespaceDict[scope]; } - if (nd) + if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { nd->insertMember(md); md->setNamespace(nd); @@ -901,8 +814,8 @@ void buildVarList(Entry *root) } // determine the definition of the global variable - if (nd) // variable is inside a namespace, so put the scope - // before the name + if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') + // variable is inside a namespace, so put the scope before the name { if (root->type.length()>0) { @@ -961,20 +874,20 @@ void buildMemberList(Entry *root) { Debug::print(Debug::Functions,0, "FUNCTION_SEC:\n" - " `%s' `%s'::`%s' `%s' relates=`%s' file=`%s' #targs=%d\n", + " `%s' `%s'::`%s' `%s' relates=`%s' file=`%s' #targs=%d docs=`%s'\n", root->type.data(), root->parent->name.data(), root->name.data(), root->args.data(), root->relates.data(), root->fileName.data(), - root->tArgList ? (int)root->tArgList->count() : -1 + root->tArgList ? (int)root->tArgList->count() : -1, + root->doc.data() ); bool isFriend=root->type.find("friend ")!=-1; - //if (isFriend && root->relates.length()==0) - // root->relates=root->parent->name.copy(); - if (root->name.length()>0 /* && !isFriend */) + + if (root->name.length()>0) { ClassDef *cd=0; @@ -983,11 +896,12 @@ void buildMemberList(Entry *root) //printf("root->parent=`%s' cd=%p root->type.find(re,0)=%d\n", // root->parent->name.data(),getClass(root->parent->name), // root->type.find(re,0)); + QCString scope=stripAnnonymousScope(root->parent->name.copy()); int i; if (root->parent && root->parent->name.length()>0 && (root->parent->section & Entry::COMPOUND_MASK) && - (cd=getClass(root->parent->name)) && + (cd=getClass(scope)) && // do some fuzzy things to exclude function pointers (root->type.isNull() || root->type.find(re,0)==-1 || root->type.find(")(")!=-1 || root->type.find("operator")!=-1 @@ -1001,7 +915,7 @@ void buildMemberList(Entry *root) root->type=root->type.left(i+l); } - QString name=removeRedundantWhiteSpace(root->name); + QCString name=removeRedundantWhiteSpace(root->name); if (name.left(2)=="::") name=name.right(name.length()-2); MemberDef::MemberType mtype; @@ -1009,7 +923,16 @@ void buildMemberList(Entry *root) else if (root->sig) mtype=MemberDef::Signal; else if (root->slot) mtype=MemberDef::Slot; else mtype=MemberDef::Function; - // new member of function, signal or slot. + + //if (Config::includeSourceFlag && !root->body.isEmpty()) + //{ + // printf("Function: %s\n-----------------\n%s\n------------------\n", + // root->name.data(),root->body.data()); + //} + + // new member function, signal or slot. + //printf("new member: %s class template args=`%s'\n", + // root->args.data(),argListToString(cd->templateArguments()).data()); MemberDef *md=new MemberDef(root->type,name,root->args,root->exception, root->protection,root->virt,root->stat,root->relates.length()>0, mtype,root->tArgList,root->argList); @@ -1018,8 +941,10 @@ void buildMemberList(Entry *root) md->setDefLine(root->startLine); md->setDocumentation(root->doc); md->setBriefDescription(root->brief); + md->setBody(root->body); + //md->setScopeTemplateArguments(cd->templateArguments()); md->addSectionsToDefinition(root->anchors); - QString def; + QCString def; if (root->relates.length()>0 || isFriend) { if (root->type.length()>0) @@ -1047,7 +972,6 @@ void buildMemberList(Entry *root) } else { - QString scope=root->parent->name.copy(); if (root->type.length()>0) { if (root->argList) @@ -1110,7 +1034,9 @@ void buildMemberList(Entry *root) !(root->parent->section & Entry::COMPOUND_MASK) && root->name.find("::")==-1 && root->relates.length()==0 && - root->type.left(7)!="extern ") + root->type.left(7)!="extern " && + root->type.left(8)!="typedef " + ) // no member => unrelated function { /* check the uniqueness of the function name in the file. @@ -1153,7 +1079,7 @@ void buildMemberList(Entry *root) // root->type.data(),root->name.data(),root->args.data()); // new global function - QString name=removeRedundantWhiteSpace(root->name); + QCString name=removeRedundantWhiteSpace(root->name); MemberDef *md=new MemberDef(root->type,name,root->args,root->exception, root->protection,root->virt,root->stat,FALSE, MemberDef::Function,root->tArgList,root->argList); @@ -1162,8 +1088,9 @@ void buildMemberList(Entry *root) md->setDocumentation(root->doc); md->setBriefDescription(root->brief); md->setPrototype(root->proto); + md->setBody(root->body); md->addSectionsToDefinition(root->anchors); - QString def; + QCString def; if (root->type.length()>0) { if (root->argList) @@ -1205,7 +1132,8 @@ void buildMemberList(Entry *root) { nd = namespaceDict[root->parent->name]; } - if (nd) + + if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { nd->insertMember(md); md->setNamespace(nd); @@ -1386,22 +1314,23 @@ void computeClassRelations(Entry *root) if (!cd->visited) { cd->visited=TRUE; // mark class as used (in case the are multiple classes - // with the same name!) + // with the same name!) if (root->extends->count()>0) // there are base classes { - QString scopePrefix; + QCString scopePrefix; Entry *p=root->parent; + bool found=FALSE; // For nested classes the base class could also be nested! // To find the correct scope, we try to prepend the scope to the base // name, starting with the largest, most inner scope. - while (p->section&Entry::COMPOUND_MASK) + while (p->section&Entry::COMPOUND_MASK && !found) { scopePrefix=p->name+"::"; QList *baseList=root->extends; BaseInfo *bi=baseList->first(); - while (bi) // for each base class + while (bi && !found) // for each base class { - QString cName=scopePrefix+bi->name; + QCString cName=scopePrefix+bi->name; //printf("Base class %s\n",cName.data()); ClassDef *baseClass=getClass(cName); if (baseClass) // base class is documented @@ -1411,6 +1340,7 @@ void computeClassRelations(Entry *root) cd->insertBaseClass(baseClass,bi->prot,bi->virt); // add this class as super class to the base class baseClass->insertSuperClass(cd,bi->prot,bi->virt); + found=TRUE; } //else // base class not documented //{ @@ -1421,71 +1351,75 @@ void computeClassRelations(Entry *root) } p=p->parent; } - // The base class could ofcouse also be a non-nested class - QList *baseList=root->extends; - BaseInfo *bi=baseList->first(); - while (bi) // for each base class + if (!found) { - ClassDef *baseClass=getClass(bi->name); - //printf("baseClass %s of %s found (%s and %s)\n", - // bi->name.data(), - // root->name.data(), - // (bi->prot==Private)?"private":((bi->prot==Protected)?"protected":"public"), - // (bi->virt==Normal)?"normal":"virtual" - // ); - int i; - QString templSpec,baseClassName=bi->name.copy(); - if (!baseClass && (i=bi->name.find('<'))!=-1) - // base class has template specifiers - { - // TODO: here we should try to find the correct template specialization - // but for now, we only look for the unspecializated base class. - baseClassName=bi->name.left(i); - baseClass=getClass(baseClassName); - templSpec=bi->name.right(bi->name.length()-i); - } - if (baseClass) // base class is documented - { - // add base class to this class - cd->insertBaseClass(baseClass,bi->prot,bi->virt,templSpec); - // add this class as super class to the base class - baseClass->insertSuperClass(cd,bi->prot,bi->virt,templSpec); - } - else // base class not documented + // The base class could ofcouse also be a non-nested class + QList *baseList=root->extends; + BaseInfo *bi=baseList->first(); + while (bi) // for each base class { - NamespaceDef *nd=cd->getNamespace(); - //printf("Found undocumented base class `%s' namespace scope=`%s'\n", - // bi->name.data(),nd ? nd->name().data() : ""); - if (nd && (baseClass=getClass(nd->name()+"::"+baseClassName))) - // class is defined inside namespace + ClassDef *baseClass=getClass(bi->name); + //printf("baseClass %s of %s found (%s and %s)\n", + // bi->name.data(), + // root->name.data(), + // (bi->prot==Private)?"private":((bi->prot==Protected)?"protected":"public"), + // (bi->virt==Normal)?"normal":"virtual" + // ); + int i; + QCString templSpec,baseClassName=bi->name.copy(); + if (!baseClass && (i=bi->name.find('<'))!=-1) + // base class has template specifiers { - // add base class to this class - cd->insertBaseClass(baseClass,bi->prot,bi->virt,templSpec); - // add this class as super class to the base class - baseClass->insertSuperClass(cd,bi->prot,bi->virt,templSpec); + // TODO: here we should try to find the correct template specialization + // but for now, we only look for the unspecializated base class. + baseClassName=bi->name.left(i); + baseClass=getClass(baseClassName); + templSpec=bi->name.right(bi->name.length()-i); } - else // undocumented base class + if (baseClass) // base class is documented { - baseClass=new ClassDef(bi->name,ClassDef::Class); // add base class to this class cd->insertBaseClass(baseClass,bi->prot,bi->virt,templSpec); // add this class as super class to the base class baseClass->insertSuperClass(cd,bi->prot,bi->virt,templSpec); - // the undocumented base was found in this file - baseClass->insertUsedFile(root->fileName); - // add class to the list - classList.inSort(baseClass); - //printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data()); - //classDict.insert(resolveDefines(bi->name),baseClass); - classDict.insert(bi->name,baseClass); } + else // base class not documented + { + NamespaceDef *nd=cd->getNamespace(); + //printf("Found undocumented base class `%s' namespace scope=`%s'\n", + // bi->name.data(),nd ? nd->name().data() : ""); + if (nd && (baseClass=getClass(nd->name()+"::"+baseClassName))) + // class is defined inside namespace + { + // add base class to this class + cd->insertBaseClass(baseClass,bi->prot,bi->virt,templSpec); + // add this class as super class to the base class + baseClass->insertSuperClass(cd,bi->prot,bi->virt,templSpec); + } + else // undocumented base class + { + //printf(">>> Undocumented base class = %s\n",bi->name.data()); + baseClass=new ClassDef(baseClassName,ClassDef::Class); + // add base class to this class + cd->insertBaseClass(baseClass,bi->prot,bi->virt,templSpec); + // add this class as super class to the base class + baseClass->insertSuperClass(cd,bi->prot,bi->virt,templSpec); + // the undocumented base was found in this file + baseClass->insertUsedFile(root->fileName); + // add class to the list + classList.inSort(baseClass); + //printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data()); + //classDict.insert(resolveDefines(bi->name),baseClass); + classDict.insert(bi->name,baseClass); + } + } + bi=baseList->next(); } - bi=baseList->next(); } } // else // class has no base classes // { -// QString resName=resolveDefines(root->name); +// QCString resName=resolveDefines(root->name); // int i; // // Check if this class is a template instance of another class. // // If this is the case, we act as if this class `inherits' from the @@ -1570,7 +1504,7 @@ void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, { //printf("addMemberDocs: `%s'::`%s' `%s' funcDecl=`%s'\n", // root->parent->name.data(),md->name().data(),md->argsString(),funcDecl); - QString fDecl=funcDecl; + QCString fDecl=funcDecl; // strip extern specifier if (fDecl.left(7)=="extern ") fDecl=fDecl.right(fDecl.length()-7); md->setDefinition(fDecl); @@ -1580,10 +1514,13 @@ void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, cd ? cd->name().data() : 0, nd ? nd->name().data() : 0 ) - ) mergeArguments(md->argumentList(),root->argList); + ) + { + mergeArguments(md->argumentList(),root->argList); + } if (over_load) // the \overload keyword was used { - QString doc=getOverloadDocs(); + QCString doc=getOverloadDocs(); if (!root->doc.isNull()) { doc+="

    "; @@ -1596,7 +1533,7 @@ void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, // documentation outside a compound overrides the documentation inside it if ( /* !md->isStatic() && !root->stat && do not replace doc of a static */ ( - !md->documentation() || /* no docs yet */ + md->documentation().isEmpty() || /* no docs yet */ (root->parent->name.isNull() && /* or overwrite prototype docs */ !root->proto && md->isPrototype() /* with member definition docs */ ) @@ -1610,13 +1547,18 @@ void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, // outside it if ( /* !md->isStatic() && !root->stat && do not replace doc of static */ ( - !md->briefDescription() || /* no docs yet */ - !root->parent->name.isNull() /* member of a class */ + md->briefDescription().isEmpty() || /* no docs yet */ + !root->parent->name.isNull() /* member of a class */ ) && root->brief.length()>0 ) { md->setBriefDescription(root->brief); } + + if (md->bodyCode().isEmpty() && !root->body.isEmpty()) /* no body yet */ + { + md->setBody(root->body); + } } md->setDefFile(root->fileName); md->setDefLine(root->startLine); @@ -1630,13 +1572,13 @@ void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, // function declaration `decl' to the corresponding member definition. bool findUnrelatedFunction(Entry *root, - const QString &namespaceName, + const QCString &namespaceName, const char *name, const char *, const char *decl) { MemberName *mn=0; - QString n=name; + QCString n=name; if (n.find("::")!=-1) return FALSE; // skip undefined class members //printf("findUnrelatedFunction(%s)\n",name); if (n.length()>0 && (mn=functionNameDict[n])) // function name defined @@ -1646,7 +1588,7 @@ bool findUnrelatedFunction(Entry *root, while (md) { NamespaceDef *nd=md->getNamespace(); - QString nsName = nd ? nd->name().data() : ""; + QCString nsName = nd ? nd->name().data() : ""; if (namespaceName.length()==0 || nsName==namespaceName) { @@ -1698,6 +1640,89 @@ bool findUnrelatedFunction(Entry *root, return TRUE; } +void substituteTemplateArgNames(ArgumentList *src, + const QCString &s, + ArgumentList *tempArgs, + ArgumentList *dst) +{ + ArgumentListIterator ali(*src); + Argument *a=0; + for (ali.toFirst();(a=ali.current());++ali) // for each member argument + { + QCString type=a->type.copy(); + bool isReplaced=FALSE; + QRegExp re(idMask); + int i,p=0,l,c=0; + while ((i=re.match(s,p,&l))!=-1) // for each template name found at the + // member definition + { + Argument *ta = tempArgs->at(c); + if (ta) // get matching template argument of the class + { + QCString dstName=s.mid(i,l); + QCString srcName=ta->type.copy(); + int bi; + if ((bi=srcName.findRev(' '))!=-1) // search for separator + { + // strip the type specifier (usuall class or typename) + srcName=srcName.right(srcName.length()-bi-1); + } + + //if (srcName.left(6)=="class ") srcName=srcName.right(srcName.length()-6); + //if (srcName.left(9)=="typename ") srcName=srcName.right(srcName.length()-9); + //printf("Template Name = `%s' -> `%s'\n",srcName.data(),dstName.data()); + if (srcName!=dstName) /* we need to substitute */ + { + int ti,tp=0; + QCString result; + int sl=srcName.length(); + while ((ti=type.find(srcName,tp))!=-1) + { + result+=type.mid(tp,ti-tp); + if ( + (ti==0 || !isId(type.at(ti-1))) && + (ti+sl==(int)type.length() || !isId(type.at(ti+sl))) + ) /* idenitifier -> replace */ + { + result+=dstName; + } + else /* substring of an identifier */ + { + result+=srcName; + } + tp=ti+sl; + } + result+=type.right(type.length()-tp); + type=result; + isReplaced = TRUE; + } + } + p=i+l; + c++; + } + Argument *na = new Argument(*a); + if (isReplaced) + { + //printf("Template Arg: `%s' -> `%s'\n",na->type.data(),type.data()); + na->type=type; + } + else + { + //printf("Template Arg `%s' not changed\n",a->type.data()); + } + dst->append(na); + } + //printf("substituteTemplateArgNames(src=`%s',tempNameStr=`%s',tempArgs=`%s',dest=`%s')\n", + // argListToString(src).data(), + // s.data(), + // argListToString(tempArgs).data(), + // argListToString(dst).data() + // ); + dst->constSpecifier = src->constSpecifier; + dst->volatileSpecifier = src->volatileSpecifier; + dst->pureSpecifier = src->pureSpecifier; + +} //---------------------------------------------------------------------- // This function tries to find a member (in a documented class/file/namespace) @@ -1710,23 +1735,28 @@ bool findUnrelatedFunction(Entry *root, // The boolean overloaded is used to specify whether or not a standard // overload documentation line should be generated. -void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, +void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, bool isFunc) { Debug::print(Debug::FindMembers,0, - "findMember(root=%p,funcDecl=`%s',related=`%s',overload=%d,isFunc=%d)\n", - root,funcDecl.data(),related.data(),overloaded,isFunc + "findMember(root=%p,funcDecl=`%s',related=`%s',overload=%d,isFunc=%d\n====\ndoc=%s\n====\n)\n", + root,funcDecl.data(),related.data(),overloaded,isFunc,root->doc.data() ); + if (Config::includeSourceFlag && !root->body.isEmpty()) + { + //printf("Function: %s\n-----------------\n%s\n------------------\n", + //root->name.data(),root->body.data()); + } - QString scopeName; - QString className; - QString namespaceName; - QString classTempList; - QString funcType; - QString funcName; - QString funcArgs; - QString funcTempList; - QString exceptions; + QCString scopeName; + QCString className; + QCString namespaceName; + QCString classTempList; + QCString funcType; + QCString funcName; + QCString funcArgs; + QCString funcTempList; + QCString exceptions; bool isRelated=FALSE; bool isFriend=FALSE; @@ -1764,7 +1794,8 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, // if a related class name is specified and the class name could // not be derived from the function declaration, then use the // related field. - //printf("scopeName=`%s' className=`%s'\n",scopeName.data(),className.data()); + //printf("scopeName=`%s' classTempList=`%s' className=`%s'\n", + // scopeName.data(),classTempList.data(),className.data()); if (/*scopeName.isEmpty() &&*/ !related.isEmpty() && !isRelated) { isRelated=TRUE; @@ -1805,6 +1836,41 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, } } + // see if (part of) the scope name is a namespace name + extractNamespaceName(scopeName,className,namespaceName); + + QCString tempScopeName=scopeName.copy(); + int ti; + int spi = namespaceName.isEmpty() ? 0 : namespaceName.length()+2; + if ((ti=tempScopeName.find("::",spi))!=-1 && !classTempList.isEmpty()) + { + // insert template parameters after the first scope name + tempScopeName=tempScopeName.left(ti)+classTempList+ + tempScopeName.right(tempScopeName.length()-ti); + } + else + { + tempScopeName+=classTempList; + } + + + if (root->tArgList==0 && !classTempList.isEmpty()) + { + // no template specifiers found during parsing (because \fn was used), + // but there are template names in the scope, so we build the template + // specifiers from that. + root->tArgList = new ArgumentList; + QRegExp re(idMask); + int i,p=0,l; + while ((i=re.match(classTempList,p,&l))!=-1) // for each template name found + { + Argument *a = new Argument; + a->type = "class "+classTempList.mid(i,l); + root->tArgList->append(a); + p=i+l; + } + } + //printf("scopeName=`%s' className=`%s'\n",scopeName.data(),className.data()); // rebuild the function declaration (needed to get the scope right). if (scopeName.length()>0 && !isRelated && !isFriend) @@ -1813,22 +1879,22 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, { if (isFunc) // a function -> we use argList for the arguments { - funcDecl=funcType+" "+scopeName+classTempList+"::"+funcName+funcTempList; + funcDecl=funcType+" "+tempScopeName+"::"+funcName+funcTempList; } else { - funcDecl=funcType+" "+scopeName+classTempList+"::"+funcName+funcArgs; + funcDecl=funcType+" "+tempScopeName+"::"+funcName+funcArgs; } } else { if (isFunc) // a function => we use argList for the arguments { - funcDecl=scopeName+classTempList+"::"+funcName+funcTempList; + funcDecl=tempScopeName+"::"+funcName+funcTempList; } else // variable => add `argument' list { - funcDecl=scopeName+classTempList+"::"+funcName+funcArgs; + funcDecl=tempScopeName+"::"+funcName+funcArgs; } } } @@ -1858,12 +1924,10 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, } } - QString fullFuncDecl=funcDecl.copy(); + QCString fullFuncDecl=funcDecl.copy(); if (isFunc) fullFuncDecl+=argListToString(root->argList); //printf("scopeName=`%s' className=`%s'\n",scopeName.data(),className.data()); - // see if (part of) the scope name is a namespace name - extractNamespaceName(scopeName,className,namespaceName); //printf("scopeName=`%s' className=`%s'\n",scopeName.data(),className.data()); // destructor => do backward class name substitution if needed @@ -1902,11 +1966,11 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, if (className.length()>0) // class name is valid { int count=0; - MemberDef *md=mn->first(); + MemberDef *md=mn->first(); // for each member with that name while (md) { ClassDef *cd=md->memberClass(); - //printf("Member %s member className=%s this className=%s\n",md->name().data(),cd->name().data(),className.data()); + //printf("Member %s (member scopeName=%s) (this scopeName=%s) classTempList=%s\n",md->name().data(),cd->name().data(),scopeName.data(),classTempList.data()); ClassDef *tcd=0; if (classTempList.length()>0) // try to find the correct specialization { @@ -1917,15 +1981,60 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, { tcd=getClass(scopeName); } - //printf("tcd=%p\n",tcd); - if (cd && tcd==cd) + if (cd && tcd==cd) // member's classes match { - //printf("Class %s\n",cd->name().data()); + int ci; + ArgumentList *classTemplArgs = cd->templateArguments(); + if ((ci=cd->name().find("::"))!=-1) // nested class + { + ClassDef *parentClass = getClass(cd->name().left(ci)); + if (parentClass) + classTemplArgs = parentClass->templateArguments(); + } + //printf("cd->name=%s classTemplArgs=%s\n",cd->name().data(), + // argListToString(classTemplArgs).data()); + ArgumentList *argList = 0; + bool substDone=FALSE; + if (!classTempList.isEmpty() && + classTemplArgs && + md->argumentList() + ) + { + /* the function definition has template arguments + * and the class also has template arguments, so + * we must substitute the template names if they are + * different before doing the match + */ + argList = new ArgumentList; + argList->setAutoDelete(TRUE); + substituteTemplateArgNames( + md->argumentList(), /* source argument list */ + classTempList, /* template names source */ + classTemplArgs, /* template names dest */ + argList /* dest argument list */ + ); + substDone=TRUE; + } + else /* no template arguments, compare argument lists directly */ + { + argList = md->argumentList(); + } bool matching= md->isVariable() || md->isTypedef() || // needed for function pointers (md->argumentList()==0 && root->argList->count()==0) || - matchArguments(md->argumentList(), root->argList, - className,namespaceName); + matchArguments(argList, root->argList,className,namespaceName); + + if (substDone) // found a new argument list + { + //printf("root->tArgList=`%s'\n",argListToString(root->tArgList).data()); + if (matching) // replace member's argument list + { + md->setScopeTemplateArguments(root->tArgList); + md->setArgumentList(argList); + } + else // no match -> delete argument list + delete argList; + } if (matching) { addMemberDocs(root,md,funcDecl,overloaded); @@ -1975,7 +2084,7 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, ASSERT(md); ClassDef *cd=md->memberClass(); ASSERT(cd); - QString className=cd->name().copy(); + QCString className=cd->name().copy(); md=mn->next(); bool unique=TRUE; while (md) @@ -1997,7 +2106,7 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, mtype,root->tArgList,root->argList); md->setMemberClass(cd); md->setDefinition(funcDecl); - QString doc=getOverloadDocs(); + QCString doc=getOverloadDocs(); doc+="

    "; doc+=root->doc; md->setDocumentation(doc); @@ -2007,6 +2116,7 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, md->setDefLine(root->startLine); md->setPrototype(root->proto); md->addSectionsToDefinition(root->anchors); + md->setBody(root->body); mn->inSort(md); cd->insertMember(md); cd->insertUsedFile(root->fileName); @@ -2071,6 +2181,7 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, md->setDefFile(root->fileName); md->setDefLine(root->startLine); md->setPrototype(root->proto); + md->setBody(root->body); md->addSectionsToDefinition(root->anchors); mn->inSort(md); cd->insertMember(md); @@ -2118,8 +2229,8 @@ void findMemberDocumentation(Entry *root) int i,l; QRegExp re("([a-zA-Z0-9: ]*\\*+[ \\*]*"); Debug::print(Debug::FindMembers,0, - "root->type=`%s' root->name=`%s' root->args=`%s'\n", - root->type.data(),root->name.data(),root->args.data() + "root->type=`%s' root->name=`%s' root->args=`%s' section=%x\n", + root->type.data(),root->name.data(),root->args.data(),root->section ); bool isFunc=TRUE; if ((i=re.match(root->type,0,&l))!=-1) // func variable/typedef to func ptr @@ -2151,8 +2262,12 @@ void findMemberDocumentation(Entry *root) //printf("Overloaded member %s found\n",root->name.data()); findMember(root,root->name,root->relates,TRUE,isFunc); } - else if (root->section==Entry::FUNCTION_SEC && - (root->doc.length()>0 || root->brief.length()>0 || extractAllFlag)) + else if + (root->section==Entry::FUNCTION_SEC && + (!root->doc.isEmpty() || !root->brief.isEmpty() || + !root->body.isEmpty() /*|| Config::extractAllFlag*/ + ) + ) { //printf("Documentation for member `%s' found args=`%s' excp=`%s'\n", // root->name.data(),root->args.data(),root->exception.data()); @@ -2179,6 +2294,10 @@ void findMemberDocumentation(Entry *root) //if (root->relates.length()>0) printf(" Relates %s\n",root->relates.data()); findMember(root,root->name,root->relates,FALSE,FALSE); } + else + { + // skip section + } EntryListIterator eli(*root->sublist); Entry *e; for (;(e=eli.current());++eli) @@ -2195,31 +2314,31 @@ void findEnums(Entry *root) if (root->section==Entry::ENUM_SEC) // non anonymous enumeration { - MemberDef *md=0; - ClassDef *cd=0; - FileDef *fd=0; - NamespaceDef *nd=0; + MemberDef *md=0; + ClassDef *cd=0; + FileDef *fd=0; + NamespaceDef *nd=0; MemberNameDict *mnd=0; MemberNameList *mnl=0; bool isGlobal; //printf("Found enum with name `%s'\n",root->name.data()); int i; - QString name; + QCString name; if ((i=root->name.findRev("::"))!=-1) // scope is specified { - QString scope=root->name.left(i); // extract scope + QCString scope=root->name.left(i); // extract scope name=root->name.right(root->name.length()-i-2); // extract name - cd=getClass(scope); - if (!cd) nd=namespaceDict[scope]; + if ((cd=getClass(scope))==0) nd=namespaceDict[scope]; } else // no scope, check the scope in which the docs where found { - if (( root->parent->section & Entry::COMPOUND_MASK ) + if (( root->parent->section & Entry::SCOPE_MASK ) && root->parent->name.length()>0 ) // found enum docs inside a compound { - cd=getClass(root->parent->name); + QCString scope=root->parent->name; + if ((cd=getClass(scope))==0) nd=namespaceDict[scope]; } name=root->name.copy(); } @@ -2231,7 +2350,7 @@ void findEnums(Entry *root) mnl=&memberNameList; isGlobal=FALSE; } - else if (nd) // found enum inside namespace + else if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') // found enum inside namespace { mnd=&functionNameDict; mnl=&functionNameList; @@ -2254,7 +2373,7 @@ void findEnums(Entry *root) md->setDefFile(root->fileName); md->setDefLine(root->startLine); md->addSectionsToDefinition(root->anchors); - if (nd) + if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { md->setDefinition(nd->name()+"::"+name); nd->insertMember(md); @@ -2299,12 +2418,12 @@ void findEnums(Entry *root) // get list of members with the same name as the field { MemberDef *fmd=fmn->first(); - while (fmd) // search for the class with the right name + while (fmd) // search for the scope with the right name { - if (nd) + if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { NamespaceDef *fnd=fmd->getNamespace(); - if (fnd==nd) + if (fnd==nd) // enum value is inside a namespace { md->insertEnumField(fmd); fmd->setEnumScope(md); @@ -2313,7 +2432,7 @@ void findEnums(Entry *root) else if (isGlobal) { FileDef *ffd=fmd->getFileDef(); - if (ffd==fd) + if (ffd==fd) // enum value has file scope { md->insertEnumField(fmd); fmd->setEnumScope(md); @@ -2322,7 +2441,7 @@ void findEnums(Entry *root) else { ClassDef *fcd=fmd->memberClass(); - if (fcd==cd) + if (fcd==cd) // enum value is inside a class { md->insertEnumField(fmd); // add field def to list fmd->setEnumScope(md); // cross ref with enum name @@ -2358,10 +2477,10 @@ void findEnumDocumentation(Entry *root) //printf("Found docs for enum with name `%s'\n",root->name.data()); int i; ClassDef *cd=0; - QString name; + QCString name; if ((i=root->name.findRev("::"))!=-1) // scope is specified { - QString scope=root->name.left(i); // extract scope + QCString scope=root->name.left(i); // extract scope name=root->name.right(root->name.length()-i-2); // extract name cd=getClass(scope); //printf("Scope=`%s' Name=`%s'\n",scope.data(),name.data()); @@ -2382,7 +2501,7 @@ void findEnumDocumentation(Entry *root) if (cd) { //printf("Enum: scope=`%s' name=`%s'\n",cd->name(),name.data()); - QString className=cd->name().copy(); + QCString className=cd->name().copy(); MemberName *mn=memberNameDict[name]; if (mn) { @@ -2519,29 +2638,30 @@ void computeMemberRelations() while (mn) // for each member name { MemberNameIterator mdi(*mn); - for ( ; mdi.current() ; ++mdi) // for each function with a specific name + for ( ; mdi.current() ; ++mdi) // for each member with a specific arg list { MemberDef *md=mdi.current(); MemberNameIterator bmdi(*mn); - for ( ; bmdi.current() ; ++bmdi) // for each other function with that name + for ( ; bmdi.current() ; ++bmdi) // for each other member with that signature { MemberDef *bmd=bmdi.current(); - if (md!=bmd && bmd->memberClass() && md->memberClass() && - isBaseClass(bmd->memberClass(),md->memberClass())) + ClassDef *bmcd = bmd->memberClass(); + ClassDef *mcd = md->memberClass(); + //printf("Check relation between `%s'::`%s' and `%s'::`%s'\n", + // mcd->name().data(),md->name().data(), + // bmcd->name().data(),bmd->name().data() + // ); + if (md!=bmd && bmcd && mcd && isBaseClass(bmcd,mcd)) { - //printf("Checking Base: %s\nWith normal : %s\n",bmd->definition(),md->definition()); - if (/*matchArguments(bmd->argsString(),md->argsString())*/ - matchArguments(bmd->argumentList(),md->argumentList()) - ) + //printf(" Base argList=`%s'\n Super argList=`%s'\n", + // argListToString(bmd->argumentList()).data(), + // argListToString(md->argumentList()).data() + // ); + if ( matchArguments(bmd->argumentList(),md->argumentList()) ) { - //printf("Base: %s\nNorm: %s\n",bmd->definition(),md->definition()); - ClassDef *bmcd = bmd->memberClass(); - ClassDef *mcd = md->memberClass(); + //printf(" match found!\n"); if (mcd && bmcd && - (bmcd->protection()!=Private || extractPrivateFlag) && - (bmcd->hasDocumentation() || !hideClassFlag) && - (mcd->protection()!=Private || extractPrivateFlag) && - (mcd->hasDocumentation() || !hideClassFlag) + mcd->isVisibleExt() && bmcd->isVisibleExt() ) { md->setReimplements(bmd); @@ -2564,7 +2684,7 @@ void mergeMembers(ClassDef *cd,BaseClassList *bcl) //if (mcd->flag==TRUE) //{ // err("Error: Cyclic inhertance dependency found for class %s\n",mcd->name()); - // return; + // return; //} //mcd->flag=TRUE; @@ -2618,6 +2738,7 @@ void mergeMembers(ClassDef *cd,BaseClassList *bcl) found = /*matchArguments(srcMd->argsString(),dstMd->argsString());*/ matchArguments(srcMd->argumentList(),dstMd->argumentList()); + ambigue=!found; } else // member is in a non base class => multiple inheritance // using the same base class. @@ -2627,7 +2748,7 @@ void mergeMembers(ClassDef *cd,BaseClassList *bcl) // dstMd->name().data(), // dstMi->scopePath.left(dstMi->scopePath.find("::")+2).data()); - QString scope=dstMi->scopePath.left(dstMi->scopePath.find("::")+2); + QCString scope=dstMi->scopePath.left(dstMi->scopePath.find("::")+2); if (scope!=dstMi->ambiguityResolutionScope.left(scope.length())) dstMi->ambiguityResolutionScope.prepend(scope); ambigue=TRUE; @@ -2648,7 +2769,7 @@ void mergeMembers(ClassDef *cd,BaseClassList *bcl) // dstMd->name().data(), // dstMi->scopePath.left(dstMi->scopePath.find("::")+2).data()); - QString scope=dstMi->scopePath.left(dstMi->scopePath.find("::")+2); + QCString scope=dstMi->scopePath.left(dstMi->scopePath.find("::")+2); if (scope!=dstMi->ambiguityResolutionScope.left(scope.length())) dstMi->ambiguityResolutionScope.prepend(scope); ambigue=TRUE; @@ -2660,7 +2781,6 @@ void mergeMembers(ClassDef *cd,BaseClassList *bcl) Specifier virt=srcMi->virt; if (srcMi->virt==Normal && bcd->virt!=Normal) virt=bcd->virt; MemberInfo *newMi = new MemberInfo(srcMd,bcd->prot,virt); - //if (srcMi->memberDef->memberClass()!=bClass) newMi->scopePath=bClass->name()+"::"+srcMi->scopePath; if (ambigue) { @@ -2669,7 +2789,7 @@ void mergeMembers(ClassDef *cd,BaseClassList *bcl) // srcMd->name().data(), // bClass->name().data()); - QString scope=bClass->name().copy(); scope+="::"; + QCString scope=bClass->name().copy(); scope+="::"; if (scope!=srcMi->ambiguityResolutionScope.left(scope.length())) newMi->ambiguityResolutionScope= scope+srcMi->ambiguityResolutionScope; @@ -2764,7 +2884,8 @@ void generateFileDocs() void generateClassDocs() { // write the installdox script if necessary - if (generateHtml && (tagFileList.count()>0 || searchEngineFlag)) + if (Config::generateHtml && + (Config::tagFileList.count()>0 || Config::searchEngineFlag)) writeInstallScript(); msg("Generating index page...\n"); @@ -2797,8 +2918,8 @@ void generateClassDocs() if (!cd->isReference() && //!cd->name().isEmpty() && //cd->name().at(0)!='@' && - //(cd->protection()!=Private || extractPrivateFlag) && - //(cd->hasDocumentation() || !hideClassFlag) + //(cd->protection()!=Private || Config::extractPrivateFlag) && + //(cd->hasDocumentation() || !Config::hideClassFlag) cd->isVisible() ) // skip external references and anonymous compounds @@ -2807,7 +2928,7 @@ void generateClassDocs() cd->writeDocumentation(*outputList); cd->writeMemberList(*outputList); - if (verbatimHeaderFlag) cd->writeIncludeFile(*outputList); + if (Config::verbatimHeaderFlag) cd->writeIncludeFile(*outputList); } } } @@ -2912,31 +3033,33 @@ void buildPageList(Entry *root) } else { - QString baseName=root->name.copy(); + QCString baseName=root->name.copy(); if (baseName.right(4)==".tex") baseName=baseName.left(baseName.length()-4); else if (baseName.right(5)==".html") baseName=baseName.left(baseName.length()-5); pi=new PageInfo(baseName, root->doc, root->args.stripWhiteSpace()); - setFileNameForSections(root->anchors,root->name); + QCString pageName; + if (Config::caseSensitiveNames) + pageName=pi->name.copy(); + else + pageName=pi->name.lower(); + setFileNameForSections(root->anchors,pageName); + pageList.append(pi); pageDict.insert(baseName,pi); if (pi->title.length()>0) { - QString pageName; - if (caseSensitiveNames) - pageName=pi->name.copy(); - else - pageName=pi->name.lower(); //outputList->writeTitle(pi->name,pi->title); // a page name is a label as well! SectionInfo *si=new SectionInfo( pi->name,pi->title,SectionInfo::Section); si->fileName=pageName+".html"; + //printf(" SectionInfo: sec=%p sec->fileName=%s\n",si,si->fileName.data()); //printf("Adding section info %s\n",pi->name.data()); - sectionDict.insert(pi->name,si); + sectionDict.insert(pageName,si); } } } @@ -2979,8 +3102,8 @@ void generatePageDocs() { msg("Generating docs for page %s...\n",pi->name.data()); outputList->disable(OutputGenerator::Man); - QString pageName; - if (caseSensitiveNames) + QCString pageName; + if (Config::caseSensitiveNames) pageName=pi->name.copy(); else pageName=pi->name.lower(); @@ -3047,7 +3170,7 @@ void generateExampleDocs() while (pi) { msg("Generating docs for example %s...\n",pi->name.data()); - QString n=convertSlashes(pi->name,TRUE)+"-example"; + QCString n=convertSlashes(pi->name,TRUE)+"-example"; startFile(*outputList,n,"Example Documentation"); //outputList->writeTitle(pi->name,pi->name); parseExample(*outputList,pi->doc+"\n\\include "+pi->name,pi->name); @@ -3081,37 +3204,64 @@ void generateNamespaceDocs() NamespaceDef *nd; for (;(nd=nli.current());++nli) { - msg("Generating docs for namespace %s\n",nd->name().data()); - nd->writeDocumentation(*outputList); + if ((nd->getReference() || nd->hasDocumentation()) && + !nd->name().isEmpty() && nd->name().at(0)!='@') + { + msg("Generating docs for namespace %s\n",nd->name().data()); + nd->writeDocumentation(*outputList); + } } } +#if defined(_WIN32) +static QCString fixSlashes(QCString &s) +{ + QCString result; + uint i; + for (i=0;iError: $DOXYSEARCH not found. Check cgi script!\"" << endl + << " echo \"

    Error: $DOXYSEARCH not found. Check cgi script!

    \"" << endl << "fi" << endl; f.close(); struct stat stat_struct; stat(fileName,&stat_struct); -#if !defined(_WIN32) chmod(fileName,stat_struct.st_mode|S_IXUSR|S_IXGRP|S_IXOTH); -#endif } else { err("Error: Cannot open file %s for writing\n",fileName.data()); } +#else /* Windows platform */ + // create cgi program + fileName = Config::cgiName.copy(); + if (fileName.right(4)==".cgi") + fileName=fileName.left(fileName.length()-4); + fileName+=".c"; + fileName.prepend(Config::htmlOutputDir+"/"); + QFile f(fileName); + if (f.open(IO_WriteOnly)) + { + QTextStream t(&f); + t << "#include " << endl; + t << "#include " << endl; + t << "#include " << endl; + t << endl; + t << "const char *DOXYSEARCH = \"" << + fixSlashes(Config::binAbsPath) << "\\\\doxysearch.exe\";" << endl; + t << "const char *DOXYPATH = \"" << + fixSlashes(Config::docAbsPath) << "\";" << endl; + t << endl; + t << "int main(void)" << endl; + t << "{" << endl; + t << " char buf[1024];" << endl; + t << " sprintf(buf,\"%s %s\",DOXYSEARCH,DOXYPATH);" << endl; + t << " if (system(buf))" << endl; + t << " {" << endl; + t << " printf(\"Content-Type: text/html\\n\\n\");" << endl; + t << " printf(\"

    Error: failed to execute %s

    \\n\",DOXYSEARCH);" << endl; + t << " exit(1);" << endl; + t << " }" << endl; + t << " return 0;" << endl; + t << "}" << endl; + f.close(); + } + else + { + err("Error: Cannot open file %s for writing\n",fileName.data()); + } +#endif /* !defined(_WIN32) */ // create config file - fileName = htmlOutputDir+"/search.cfg"; + fileName = Config::htmlOutputDir+"/search.cfg"; f.setName(fileName); if (f.open(IO_WriteOnly)) { QTextStream t(&f); - t << docURL << endl << cgiURL << "/" << cgiName << endl; + t << Config::docURL << endl << Config::cgiURL << "/" << Config::cgiName << endl; f.close(); } else @@ -3194,7 +3381,7 @@ void generateConfigFile(const char *configFile,bool shortList) //---------------------------------------------------------------------------- // read and parse a tag file -bool readLineFromFile(QFile &f,QString &s) +bool readLineFromFile(QFile &f,QCString &s) { char c=0; s.resize(0); @@ -3226,7 +3413,12 @@ bool patternMatch(QFileInfo *fi,QStrList *patList) char *pattern=patList->first(); while (pattern && !found) { - found = found || QDir::match(pattern,fi->fileName()); +#if defined(_WIN32) // windows + QRegExp re(pattern,FALSE,TRUE); // case insensitive match +#else // unix + QRegExp re(pattern,TRUE,TRUE); // case sensitive match +#endif + found = found || re.match(fi->fileName())!=-1; pattern=patList->next(); } } @@ -3245,7 +3437,7 @@ void copyAndFilterFile(const char *fileName,BufStr &dest) QFileInfo fi(fileName); if (!fi.exists()) return; - if (inputFilter.isEmpty()) + if (Config::inputFilter.isEmpty()) { QFile f(fileName); if (!f.open(IO_ReadOnly)) @@ -3266,11 +3458,11 @@ void copyAndFilterFile(const char *fileName,BufStr &dest) { int c; // char *p=dest; - QString cmd=inputFilter+" "+fileName; + QCString cmd=Config::inputFilter+" "+fileName; FILE *f=popen(cmd,"r"); if (!f) { - err("Error: could not execute filter %s\n",inputFilter.data()); + err("Error: could not execute filter %s\n",Config::inputFilter.data()); return; } while ((c=fgetc(f))!=EOF) dest.addChar(c),size++; @@ -3295,17 +3487,17 @@ void copyAndFilterFile(const char *fileName,BufStr &dest) void readFiles(BufStr &output) { - QString *s=inputFiles.first(); + QCString *s=inputFiles.first(); // char *p=output.data(); while (s) { - QString fileName=*s; + QCString fileName=*s; //int fileSize=fi->fileInfo()->size(); int fileNameSize=fileName.length(); //int streamLength=fileSize+fileNameSize+4; - //QString fileText(streamLength); + //QCString fileText(streamLength); // add begin filename marker // *p++=0x06; @@ -3320,7 +3512,7 @@ void readFiles(BufStr &output) output.addChar(0x06); // *p++='\n'; // to make ^ work while scanning the first line of a file! output.addChar('\n'); - if (preprocessingFlag) + if (Config::preprocessingFlag) { msg("Preprocessing %s...\n",s->data()); preprocessFile(fileName,output); @@ -3376,7 +3568,7 @@ int readDir(QFileInfo *fi, patternMatch(cfi,patList) && !patternMatch(cfi,exclPatList)) { totalSize+=cfi->size()+cfi->absFilePath().length()+4; - QString name=cfi->fileName(); + QCString name=convertToQCString(cfi->fileName()); if (fnDict) { FileDef *fd=new FileDef(cfi->dirPath()+"/",name); @@ -3393,15 +3585,15 @@ int readDir(QFileInfo *fi, fnDict->insert(name,fn); } } - QString *rs=0; + QCString *rs=0; if (resultList || resultDict) { - rs=new QString(cfi->absFilePath()); + rs=new QCString(cfi->absFilePath()); } if (resultList) resultList->append(rs); if (resultDict) resultDict->insert(cfi->absFilePath(),rs); } - else if (recursiveFlag && cfi->isDir() && cfi->fileName()!="." && + else if (Config::recursiveFlag && cfi->isDir() && cfi->fileName()!="." && cfi->fileName()!="..") { cfi->setFile(cfi->absFilePath()); @@ -3417,9 +3609,9 @@ int readDir(QFileInfo *fi, //---------------------------------------------------------------------------- // read the file with name `name' into a string. -QString readExampleFile(const char *name) +QCString readExampleFile(const char *name) { - QString example; + QCString example; QFileInfo fi(name); if (fi.exists()) { @@ -3477,7 +3669,7 @@ int readFileOrDirectory(const char *s, { totalSize+=fi.size()+fi.absFilePath().length()+4; //readFile(&fi,fiList,input); //fiList->inSort(new FileInfo(fi)); - QString name=fi.fileName(); + QCString name=convertToQCString(fi.fileName()); if (fnDict) { FileDef *fd=new FileDef(fi.dirPath(TRUE)+"/",name); @@ -3494,10 +3686,10 @@ int readFileOrDirectory(const char *s, fnDict->insert(name,fn); } } - QString *rs=0; + QCString *rs=0; if (resultList || resultDict) { - rs=new QString(fi.absFilePath()); + rs=new QCString(fi.absFilePath()); } if (resultList) resultList->append(rs); if (resultDict) resultDict->insert(fi.absFilePath(),rs); @@ -3514,11 +3706,11 @@ int readFileOrDirectory(const char *s, void readFormulaRepository() { - QFile f(htmlOutputDir+"/formula.repository"); + QFile f(Config::htmlOutputDir+"/formula.repository"); if (f.open(IO_ReadOnly)) // open repository { QTextStream t(&f); - QString line; + QCString line; while (!t.eof()) { line=t.readLine(); @@ -3530,8 +3722,8 @@ void readFormulaRepository() } else { - QString formName = line.left(se); - QString formText = line.right(line.length()-se-1); + QCString formName = line.left(se); + QCString formText = line.right(line.length()-se-1); Formula *f=new Formula(formText); formulaList.append(f); formulaDict.insert(formText,f); @@ -3627,7 +3819,7 @@ int main(int argc,char **argv) } QFileInfo configFileInfo1("Doxyfile"),configFileInfo2("doxyfile"); - QString config; + QCString config; if (optind>=argc) { if (configFileInfo1.exists()) @@ -3646,23 +3838,24 @@ int main(int argc,char **argv) config=fileToString(argv[1]); parseConfig(config); + checkConfig(); /************************************************************************** * Initialize output generators * **************************************************************************/ outputList = new OutputList(TRUE); - if (generateHtml) + if (Config::generateHtml) { outputList->add(new HtmlGenerator); HtmlGenerator::init(); } - if (generateLatex) + if (Config::generateLatex) { outputList->add(new LatexGenerator); LatexGenerator::init(); } - if (generateMan) + if (Config::generateMan) { outputList->add(new ManGenerator); ManGenerator::init(); @@ -3674,42 +3867,43 @@ int main(int argc,char **argv) // gather names of all files in the include path msg("Searching for include files...\n"); - s=includePath.first(); + s=Config::includePath.first(); while (s) { - readFileOrDirectory(s,0,&includeNameDict,0,&filePatternList, - &excludePatternList,0,0); - s=includePath.next(); + readFileOrDirectory(s,0,&includeNameDict,0,&Config::filePatternList, + &Config::excludePatternList,0,0); + s=Config::includePath.next(); } msg("Searching for example files...\n"); - s=examplePath.first(); + s=Config::examplePath.first(); while (s) { - readFileOrDirectory(s,0,&exampleNameDict,0,&filePatternList, - &excludePatternList,0,0); - s=examplePath.next(); + readFileOrDirectory(s,0,&exampleNameDict,0,&Config::filePatternList, + &Config::excludePatternList,0,0); + s=Config::examplePath.next(); } msg("Searching for files to exclude\n"); - s=excludeSources.first(); + s=Config::excludeSources.first(); while (s) { - readFileOrDirectory(s,0,0,0,&filePatternList, + readFileOrDirectory(s,0,0,0,&Config::filePatternList, 0,0,&excludeNameDict); - s=excludeSources.next(); + s=Config::excludeSources.next(); } msg("Reading input files...\n"); int inputSize=0; - s=inputSources.first(); + s=Config::inputSources.first(); while (s) { inputSize+=readFileOrDirectory(s,&inputNameList, &inputNameDict,&excludeNameDict, - &filePatternList,&excludePatternList, + &Config::filePatternList, + &Config::excludePatternList, &inputFiles,0); - s=inputSources.next(); + s=Config::inputSources.next(); } //msg("Input size %d bytes\n",inputSize); @@ -3732,19 +3926,21 @@ int main(int argc,char **argv) msg("Reading tag files\n"); - s=tagFileList.first(); + s=Config::tagFileList.first(); while (s) { readTagFile(s); - s=tagFileList.next(); + s=Config::tagFileList.next(); } - QFile *tag =new QFile(genTagFile); - if (genTagFile.length()>0) + QFile *tag =new QFile(Config::genTagFile); + if (Config::genTagFile.length()>0) { if (!tag->open(IO_WriteOnly)) { - err("Error: cannot open tag file %s for writing\n",genTagFile.data()); + err("Error: cannot open tag file %s for writing\n", + Config::genTagFile.data() + ); exit(1); } tagFile.setDevice(tag); @@ -3756,7 +3952,7 @@ int main(int argc,char **argv) // Notice: the order of the function calls below is very important! - if (generateHtml) + if (Config::generateHtml) { msg("Reading formula repository...\n"); readFormulaRepository(); @@ -3801,7 +3997,6 @@ int main(int argc,char **argv) msg("Searching for friends...\n"); findFriends(); - msg("Searching for documented variables...\n"); buildVarList(root); @@ -3910,31 +4105,31 @@ int main(int argc,char **argv) outputList->writeStyleInfo(0); // write first part outputList->disableAllBut(OutputGenerator::Latex); parseText(*outputList, - theTranslator->trGeneratedAt(dateToString(TRUE),projectName) + theTranslator->trGeneratedAt(dateToString(TRUE),Config::projectName) ); outputList->writeStyleInfo(1); // write second part parseText(*outputList,theTranslator->trWrittenBy()); outputList->writeStyleInfo(2); // write third part parseText(*outputList, - theTranslator->trGeneratedAt(dateToString(TRUE),projectName) + theTranslator->trGeneratedAt(dateToString(TRUE),Config::projectName) ); outputList->writeStyleInfo(3); // write fourth part parseText(*outputList,theTranslator->trWrittenBy()); outputList->writeStyleInfo(4); // write last part outputList->enableAll(); - if (formulaList.count()>0 && generateHtml) + if (formulaList.count()>0 && Config::generateHtml) { msg("Generating bitmaps for formulas in HTML...\n"); - formulaList.generateBitmaps(htmlOutputDir); + formulaList.generateBitmaps(Config::htmlOutputDir); } - if (searchEngineFlag || tagFileList.count()>0) + if (Config::searchEngineFlag || Config::tagFileList.count()>0) { msg("\nNow copy the file\n\n %s\n\nto the directory where the CGI binaries are " - "located and don't forget to run\n\n",(htmlOutputDir+"/"+cgiName).data()); + "located and don't forget to run\n\n",(Config::htmlOutputDir+"/"+Config::cgiName).data()); msg(" %s/installdox\n\nto replace any dummy links.\n\n", - htmlOutputDir.data()); + Config::htmlOutputDir.data()); } delete tag; diff --git a/src/doxygen.h b/src/doxygen.h index 005ac7e..17c8cd8 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -18,6 +18,7 @@ #ifndef DOXYGEN_H #define DOXYGEN_H +#include "qtbc.h" #include "groupdef.h" #include "filedef.h" #include "classdef.h" @@ -34,9 +35,9 @@ struct PageInfo { PageInfo(const char *n,const char *d,const char *t) { name=n; doc=d; title=t; } - QString name; - QString doc; - QString title; + QCString name; + QCString doc; + QCString title; }; class PageList : public QList @@ -47,10 +48,10 @@ class PageList : public QList } }; -class BufStr : public QString +class BufStr : public QCString { public: - BufStr(int size) : QString(size), offset(0), spareRoom(10240) {} + BufStr(int size) : QCString(size), offset(0), spareRoom(10240) {} void addChar(char c) { if (offset>=size()) resize(size()+spareRoom); @@ -73,11 +74,11 @@ class BufStr : public QString const int spareRoom; // 10Kb extra room to avoid frequent resizing }; -typedef QList StringList; +typedef QList StringList; typedef QDict MemberDict; typedef QDict ClassDict; typedef QDict FileDict; -typedef QDict StringDict; +typedef QDict StringDict; typedef QDict PageDict; typedef QDict GroupDict; diff --git a/src/doxygen.pro b/src/doxygen.pro index 21e2ea5..e6dd3c0 100644 --- a/src/doxygen.pro +++ b/src/doxygen.pro @@ -14,7 +14,7 @@ # TMake project file for doxygen TEMPLATE = doxygen.t -CONFIG = console qt warn_on release #debug +CONFIG = console qt warn_on release #debug HEADERS = doxygen.h scanner.h classdef.h classlist.h memberdef.h \ membername.h index.h memberlist.h definition.h \ entry.h logos.h instdox.h message.h code.h \ diff --git a/src/doxysearch.cpp b/src/doxysearch.cpp index cd59d02..027b185 100644 --- a/src/doxysearch.cpp +++ b/src/doxysearch.cpp @@ -259,7 +259,15 @@ void printSearchPage(bool open=FALSE) int readInt(FILE *f) { - return (fgetc(f)<<24)+(fgetc(f)<<16)+(fgetc(f)<<8)+fgetc(f); + unsigned char c_24 = fgetc(f); + unsigned char c_16 = fgetc(f); + unsigned char c_08 = fgetc(f); + unsigned char c_00 = fgetc(f); + return ((unsigned int)c_24<<24)+ + ((unsigned int)c_16<<16)+ + ((unsigned int)c_08<<8)+ + c_00; + //return (fgetc(f)<<24)+(fgetc(f)<<16)+(fgetc(f)<<8)+fgetc(f); } //---------------------------------------------------------------------------- @@ -755,10 +763,10 @@ void fileToBuf(const char *name, char **buf) { FILE *f; struct stat file_stats; - if ((f=fopen(name,"r"))==NULL) return; + if ((f=fopen(name,"rb"))==NULL) return; if (stat(name,&file_stats)==-1) { - message("Error: could not fstat header file %s\n",name); + message("Error: could not fstat file %s\n",name); exit(1); } unsigned int len=file_stats.st_size; @@ -769,7 +777,7 @@ void fileToBuf(const char *name, char **buf) } if (fread(*buf,1,len,f)!=len) { - message("Error: could not read header file %s\n",name); + message("Error: could not read file %s\n",name); exit(1); } (*buf)[len]='\0'; @@ -808,12 +816,20 @@ void getConfig(const char *s) char headerFile[MAXSTRLEN]; strcpy(headerFile,s); +#if defined(_WIN32) + strcat(headerFile,"\\header.html"); +#else strcat(headerFile,"/header.html"); +#endif fileToBuf(headerFile,&headerBuf); char footerFile[MAXSTRLEN]; strcpy(footerFile,s); +#if defined(_WIN32) + strcat(footerFile,"\\footer.html"); +#else strcat(footerFile,"/footer.html"); +#endif fileToBuf(footerFile,&footerBuf); } @@ -908,16 +924,24 @@ int main(int argc,char **argv) { char configFile[MAXSTRLEN]; strcpy(configFile,argv[argIndex]); +#if defined(_WIN32) + strcat(configFile,"\\search.cfg"); +#else strcat(configFile,"/search.cfg"); +#endif char indexFile[MAXSTRLEN]; strcpy(indexFile,argv[argIndex]); +#if defined(_WIN32) + strcat(indexFile,"\\search.idx"); +#else strcat(indexFile,"/search.idx"); +#endif FileInfo *fi=fileList.add(); FILE *g; - if ((fi->f=fopen(indexFile,"r"))==NULL) + if ((fi->f=fopen(indexFile,"rb"))==NULL) { message("Error: could not open index file %s\n",indexFile); exit(1); diff --git a/src/doxytag.l b/src/doxytag.l index 0c70dc6..4e2debd 100644 --- a/src/doxytag.l +++ b/src/doxytag.l @@ -23,7 +23,7 @@ #include #include -#include +#include "qtbc.h" #include #include #include @@ -38,16 +38,16 @@ struct MemberDef { - QString name; - QString anchor; - QString args; + QCString name; + QCString anchor; + QCString args; }; struct ClassDef { - QString name; + QCString name; QStrList bases; - QString fileName; + QCString fileName; bool isFile; QList memberList; }; @@ -61,19 +61,19 @@ static bool genTag; static bool genIndex; static QStrList bases; -static QString inputString; +static QCString inputString; static int inputPosition; -static QString yyFileName; +static QCString yyFileName; static int yyLineNr; -static QString classFile; -static QString memberRef; -static QString memberName; -static QString memberArgs; -static QString className; +static QCString classFile; +static QCString memberRef; +static QCString memberName; +static QCString memberArgs; +static QCString className; //static bool newClass; -static QString docBaseLink; -static QString docAnchor; -static QString docRefName; +static QCString docBaseLink; +static QCString docAnchor; +static QCString docRefName; static bool nameBug; static SearchIndex searchIndex; @@ -152,9 +152,9 @@ static void addReference() } } -QString unhtmlify(const char *str) +QCString unhtmlify(const char *str) { - QString result; + QCString result; const char *p=str; char c; while ((c=*p)!='\0') @@ -236,7 +236,7 @@ QString unhtmlify(const char *str) } [^\<]+ [a-z_A-Z0-9~:]+ { - QString s=yytext; + QCString s=yytext; if (s.find("::")!=-1) { docRefName=yytext; @@ -401,7 +401,7 @@ QString unhtmlify(const char *str) */ -void parse(QString &s) +void parse(QCString &s) { bases.clear(); nameBug = FALSE; @@ -425,7 +425,7 @@ void parseFile(QFileInfo &fi) className.resize(0); memberName.resize(0); //printf("Parsing file %s...\n",fi.fileName().data()); - QString input(fi.size()+1); + QCString input(fi.size()+1); docBaseLink=fi.fileName(); docRefName=fi.fileName().copy(); searchIndex.addReference(docRefName,docBaseLink); @@ -503,8 +503,8 @@ const char *getArg(int argc,char **argv,int &optind,const char c) int main(int argc,char **argv) { - QString tagName; - QString indexName; + QCString tagName; + QCString indexName; int optind=1; const char *arg; @@ -554,7 +554,7 @@ int main(int argc,char **argv) } if (genIndex) { - printf("Writing search index\n"); + //printf("Writing search index\n"); if (!searchIndex.saveIndex(indexName)) { fprintf(stderr,"Error: Could not write search index\n"); @@ -562,7 +562,7 @@ int main(int argc,char **argv) QFileInfo fi(indexName); if (fi.exists()) { - QString dir=fi.dir().absPath(); + QCString dir=convertToQCString(fi.dir().absPath()); fi.setFile(dir+"/search.gif"); if (!fi.exists()) writeSearchButton(dir); fi.setFile(dir+"/doxygen.gif"); diff --git a/src/entry.cpp b/src/entry.cpp index 51724ce..4e2ca93 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -16,31 +16,32 @@ #include "entry.h" -static int newCount=0; +int Entry::num=0; Entry::Entry() { - num=newCount++; + num++; //printf("New Entry %d\n",num); parent=0; sublist = new QList; sublist->setAutoDelete(TRUE); extends = new QList; extends->setAutoDelete(TRUE); - groups = new QList; + groups = new QList; groups->setAutoDelete(TRUE); - anchors = new QList; + anchors = new QList; anchors->setAutoDelete(TRUE); argList = new ArgumentList; argList->setAutoDelete(TRUE); //printf("Entry::Entry() tArgList=0\n"); tArgList = 0; + mGrpId = -1; reset(); } Entry::Entry(const Entry &e) { - num=newCount++; + num++; //printf("Copy New Entry %d\n",num); section = e.section; protection = e.protection; @@ -62,13 +63,14 @@ Entry::Entry(const Entry &e) inside = e.inside.copy(); fileName = e.fileName.copy(); startLine = e.startLine; + mGrpId = e.mGrpId; sublist = new QList; sublist->setAutoDelete(TRUE); extends = new QList; extends->setAutoDelete(TRUE); - groups = new QList; + groups = new QList; groups->setAutoDelete(TRUE); - anchors = new QList; + anchors = new QList; anchors->setAutoDelete(TRUE); argList = new ArgumentList; argList->setAutoDelete(TRUE); @@ -92,17 +94,17 @@ Entry::Entry(const Entry &e) } // deep copy group list - QListIterator sli(*e.groups); - QString *s; + QListIterator sli(*e.groups); + QCString *s; for (;(s=sli.current());++sli) { - groups->append(new QString(*s)); + groups->append(new QCString(*s)); } - QListIterator sli2(*e.anchors); + QListIterator sli2(*e.anchors); for (;(s=sli2.current());++sli2) { - anchors->append(new QString(*s)); + anchors->append(new QCString(*s)); } // deep copy argument list @@ -140,8 +142,8 @@ Entry::~Entry() delete groups; delete anchors; delete argList; - //printf("Entry::~Entry() tArgList=%p\n",tArgList); delete tArgList; + num--; } void Entry::addSubEntry(Entry *current) @@ -171,6 +173,7 @@ void Entry::reset() args.resize(0); exception.resize(0); program.resize(0); + body.resize(0); includeFile.resize(0); includeName.resize(0); doc.resize(0); @@ -178,6 +181,7 @@ void Entry::reset() brief.resize(0); inside.resize(0); fileName.resize(0); + mGrpId = -1; section = EMPTY_SEC; sig = FALSE; virt = Normal; @@ -202,6 +206,7 @@ int Entry::getSize() size+=args.length()+1; size+=exception.length()+1; size+=program.length()+1; + size+=body.length()+1; size+=includeFile.length()+1; size+=includeName.length()+1; size+=doc.length()+1; @@ -216,7 +221,7 @@ int Entry::getSize() size+=bi->name.length()+1+sizeof(bi->prot)+sizeof(bi->virt); bi=extends->next(); } - QString *s=groups->first(); + QCString *s=groups->first(); while (s) { size+=sizeof(QLNode); diff --git a/src/entry.h b/src/entry.h index a302955..94cf52b 100644 --- a/src/entry.h +++ b/src/entry.h @@ -17,7 +17,7 @@ #ifndef ENTRY_H #define ENTRY_H -#include +#include "qtbc.h" #include enum Protection { Public, Protected, Private } ; @@ -26,7 +26,7 @@ enum Specifier { Normal, Virtual, Pure } ; struct BaseInfo { BaseInfo(const char *n,Protection p,Specifier v) : name(n),prot(p),virt(v) {} - QString name; // the name of the base class + QCString name; // the name of the base class Protection prot; // inheritance type Specifier virt; // virtualness }; @@ -51,9 +51,9 @@ struct Argument return *this; } - QString type; // argument type - QString name; // argument name (if any) - QString defval; // argument default value (if any) + QCString type; // argument type + QCString name; // argument name (if any) + QCString defval; // argument default value (if any) }; class ArgumentList : public QList @@ -115,35 +115,37 @@ class Entry void addSubEntry (Entry* e) ; void reset(); - int section; // entry type; + int section; // entry type (see Sections); Protection protection; // class protection bool sig; // a Qt signal ? bool slot; // a Qt slot ? bool stat; // static ? bool proto; // prototype ? - Specifier virt; // virtualness of the entry - Entry *parent; // parent node in the tree - QString type; // member type - QString name; // member name - QString args; // member argument string + Specifier virt; // virtualness of the entry + Entry *parent; // parent node in the tree + QCString type; // member type + QCString name; // member name + QCString args; // member argument string ArgumentList *argList; // member arguments as a list ArgumentList *tArgList; // template argument list - ArgumentList *tNameList; // template name list - QString program; // the program text - QString includeFile; // include file (2 arg of \class, must be unique) - QString includeName; // include name (3 arg of \class) - QString doc; // documentation block (partly parsed) - QString relates; // related class (doc block) - QString brief; // brief description (doc block) - QString inside; // name of the class in which documents are found - QString exception; // throw specification + QCString program; // the program text + QCString body; // the function body + QCString includeFile; // include file (2 arg of \class, must be unique) + QCString includeName; // include name (3 arg of \class) + QCString doc; // documentation block (partly parsed) + QCString relates; // related class (doc block) + QCString brief; // brief description (doc block) + QCString inside; // name of the class in which documents are found + QCString exception; // throw specification + int mGrpId; // member group id + QCString mGrpHeader; // member group header QList *sublist; // entries that are children of this one QList *extends; // list of base classes - QList *groups; // list of groups this entry belongs to - QList *anchors; // list of anchors defined in this entry - QString fileName; // file this entry was extracted from + QList *groups; // list of groups this entry belongs to + QList *anchors; // list of anchors defined in this entry + QCString fileName; // file this entry was extracted from int startLine; // start line of entry in the source - int num; + static int num; // counts the total number of entries private: Entry &operator=(const Entry &); } ; diff --git a/src/example.h b/src/example.h index eef33ce..b43733f 100644 --- a/src/example.h +++ b/src/example.h @@ -17,16 +17,16 @@ #ifndef EXAMPLE_H #define EXAMPLE_H -#include +#include "qtbc.h" class ClassDef; class MemberName; struct Example { - QString anchor; - QString name; - QString file; + QCString anchor; + QCString name; + QCString file; }; class ExampleList : public QList diff --git a/src/filedef.cpp b/src/filedef.cpp index 7921bf7..5f62357 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -14,6 +14,7 @@ * */ +#include "qtbc.h" #include "memberlist.h" #include "classlist.h" #include "define.h" @@ -66,14 +67,14 @@ void FileDef::writeDocumentation(OutputList &ol) { //funcList->countDecMembers(); - QString pageTitle=name()+" File Reference"; + QCString pageTitle=name()+" File Reference"; startFile(ol,diskname,pageTitle); startTitle(ol); parseText(ol,theTranslator->trFileReference(name())); endTitle(ol,name()); //ol.newParagraph(); - if (genTagFile.length()>0) tagFile << "&" << name() << ":\n"; + if (Config::genTagFile.length()>0) tagFile << "&" << name() << ":\n"; //brief=brief.stripWhiteSpace(); //int bl=brief.length(); @@ -97,17 +98,53 @@ void FileDef::writeDocumentation(OutputList &ol) ol.writeSynopsis(); ol.startMemberSections(); + + if (namespaceList->count()>0) + { + NamespaceDef *nd=namespaceList->first(); + bool found=FALSE; + while (nd) + { + if (nd->isVisibleExt()) + { + if (!found) + { + ol.startMemberHeader(); + parseText(ol,theTranslator->trNamespaces()); + ol.endMemberHeader(); + ol.startMemberList(); + found=TRUE; + } + ol.startMemberItem(); + ol.writeString("namespace "); + ol.insertMemberAlign(); + if (nd->hasDocumentation()) + { + ol.writeObjectLink(nd->getReference(), + nd->getOutputFileBase(), + 0, + nd->name() + ); + } + else + { + ol.startBold(); + ol.docify(nd->name()); + ol.endBold(); + } + ol.endMemberItem(); + } + nd=namespaceList->next(); + } + if (found) ol.endMemberList(); + } if (classList->count()>0) { ClassDef *cd=classList->first(); bool found=FALSE; while (cd) { - if (//cd->name()[0]!='@' && - //(cd->protection()!=Private || extractPrivateFlag) && - //(cd->hasDocumentation() || !hideClassFlag)) - cd->isVisibleExt() - ) + if ( cd->isVisibleExt() ) { if (!found) { @@ -247,7 +284,7 @@ void FileDef::writeDocumentation(OutputList &ol) ol.startGroupHeader(); parseText(ol,theTranslator->trAuthor()); ol.endGroupHeader(); - parseText(ol,theTranslator->trGeneratedAutomatically(projectName)); + parseText(ol,theTranslator->trGeneratedAutomatically(Config::projectName)); ol.enableAll(); endFile(ol); } diff --git a/src/filedef.h b/src/filedef.h index ca95e20..b5c9585 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -17,8 +17,8 @@ #ifndef FILEDEF_H #define FILEDEF_H -#include #include "index.h" +#include #include "config.h" #include "definition.h" @@ -53,9 +53,9 @@ class FileDef : public Definition ~FileDef(); /*! Returns the unique file name (this may include part of the path). */ - QString name() const + QCString name() const { - if (fullPathNameFlag) + if (Config::fullPathNameFlag) return filename; else return Definition::name(); @@ -63,10 +63,10 @@ class FileDef : public Definition /*! Returns nameString with all slashes replaced by underscores. */ //const char *diskName() const { return diskname; } - QString getOutputFileBase() const { return diskname; } + QCString getOutputFileBase() const { return diskname; } /*! Returns the absolute path including the file name. */ - QString absFilePath() const { return filepath; } + QCString absFilePath() const { return filepath; } /*! Returns the name of the verbatim copy of this file (if any). */ const char *includeName() const { return incName; } @@ -87,7 +87,7 @@ class FileDef : public Definition //void setDocumentation(const char *d) { doc=d; } /*! Returns the absolute path of this file. */ - QString getPath() const { return path; } + QCString getPath() const { return path; } /*! Returns true iff any documentation for this file is found. */ //bool hasDocumentation() @@ -117,15 +117,15 @@ class FileDef : public Definition FileList *includeList; NamespaceList *namespaceList; DefineList *defineList; - //QString n; - //QString doc; - //QString brief; - QString reference; - QString path; - QString filepath; - QString diskname; - QString filename; - QString incName; + //QCString n; + //QCString doc; + //QCString brief; + QCString reference; + QCString path; + QCString filepath; + QCString diskname; + QCString filename; + QCString incName; //FileType ftype; }; diff --git a/src/filename.cpp b/src/filename.cpp index 60367dc..a345969 100644 --- a/src/filename.cpp +++ b/src/filename.cpp @@ -26,9 +26,9 @@ FileName::~FileName() { } -//static QString convertSlashes(const char *s) +//static QCString convertSlashes(const char *s) //{ -// QString result=s; +// QCString result=s; // int i,l=result.length(); // for (i=0;iisReference()) count++; fd=next(); } @@ -66,8 +66,8 @@ void FileName::generateDiskNames() //printf("i=%d fd->path=`%s' fd->name=`%s'\n",i,fd->path.data(),fd->name().data()); if (i==(int)fd->path.length()) { - warning("Warning: Input file found multiple times!\n" - " The generated documentation for this file may not be correct!\n"); + warning("Warning: Input file %s found multiple times!\n" + " The generated documentation for this file may not be correct!\n",fd->absFilePath().data()); found=TRUE; } else if (fd->path[i]!=c) diff --git a/src/filename.h b/src/filename.h index 2932d18..cb39ce5 100644 --- a/src/filename.h +++ b/src/filename.h @@ -17,6 +17,7 @@ #ifndef FILENAME_H #define FILENAME_H +#include "qtbc.h" #include #include "filedef.h" @@ -30,7 +31,7 @@ class FileName : public QList int compareItems(GCI item1,GCI item2); private: - QString name; + QCString name; }; class FileNameIterator : public QListIterator diff --git a/src/formula.cpp b/src/formula.cpp index 53e8b38..0a961ca 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -17,6 +17,7 @@ #include #include +#include "qtbc.h" #include #include #include @@ -49,12 +50,12 @@ void FormulaList::generateBitmaps(const char *path) QDir d(path); // store the original directory if (!d.exists()) { err("Error: Output dir %s does not exist!\n",path); exit(1); } - QString oldDir = QDir::currentDirPath().copy(); + QCString oldDir = convertToQCString(QDir::currentDirPath()); // goto the html output directory (i.e. path) QDir::setCurrent(d.absPath()); QDir thisDir; // generate a latex file containing one formula per page. - QString texName="_formulas.tex"; + QCString texName="_formulas.tex"; QList pagesToGenerate; pagesToGenerate.setAutoDelete(TRUE); FormulaListIterator fli(*this); @@ -70,7 +71,7 @@ void FormulaList::generateBitmaps(const char *path) int page=0; for (fli.toFirst();(formula=fli.current());++fli) { - QString resultName; + QCString resultName; resultName.sprintf("form-%d.gif",formula->getId()); // only formulas for which no image exists are generated QFileInfo fi(resultName); @@ -99,7 +100,7 @@ void FormulaList::generateBitmaps(const char *path) int pageNum=*pagePtr; msg("Generating image form-%d.gif for formula\n",pageNum); char dviCmd[256]; - QString formBase; + QCString formBase; formBase.sprintf("_form%d",pageNum); // run dvips to convert the page with number pageIndex to an // encapsulated postscript. @@ -110,7 +111,7 @@ void FormulaList::generateBitmaps(const char *path) QFileInfo fi(formBase+".eps"); if (fi.exists()) { - QString eps = fileToString(formBase+".eps"); + QCString eps = fileToString(formBase+".eps"); int i=eps.find("%%BoundingBox:"); if (i!=-1) { @@ -162,7 +163,7 @@ void FormulaList::generateBitmaps(const char *path) if (f.open(IO_ReadOnly)) { QTextStream t(&f); - QString s; + QCString s; if (!t.eof()) s=t.readLine(); if (s.length()<2 || s.left(2)!="P6") @@ -233,7 +234,7 @@ void FormulaList::generateBitmaps(const char *path) } } // save the result as a gif - QString resultName; + QCString resultName; resultName.sprintf("form-%d.gif",pageNum); // the option parameter 1 is used here as a temporary hack // to select the right color palette! diff --git a/src/formula.h b/src/formula.h index 977ccfe..9edd583 100644 --- a/src/formula.h +++ b/src/formula.h @@ -17,7 +17,7 @@ #ifndef FORMULA_H #define FORMULA_H -#include +#include "qtbc.h" #include #include @@ -27,11 +27,11 @@ class Formula Formula(const char *text); ~Formula(); int getId(); - QString getFormulaText() const { return form; } + QCString getFormulaText() const { return form; } private: int number; - QString form; + QCString form; }; class FormulaList : public QList diff --git a/src/groupdef.cpp b/src/groupdef.cpp index 924199e..e1e28ab 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -15,6 +15,7 @@ */ #include +#include "qtbc.h" #include "groupdef.h" #include "classdef.h" #include "filedef.h" @@ -118,7 +119,7 @@ void GroupDef::writeDocumentation(OutputList &ol) ClassDef *cd=classList->first(); while (cd) { - QString type; + QCString type; switch (cd->compoundType()) { case ClassDef::Class: type="class"; break; diff --git a/src/groupdef.h b/src/groupdef.h index a8bc562..ab54ea6 100644 --- a/src/groupdef.h +++ b/src/groupdef.h @@ -17,7 +17,7 @@ #ifndef GROUPDEF_H #define GROUPDEF_H -#include +#include "qtbc.h" #include #include "definition.h" @@ -36,7 +36,7 @@ class GroupDef : public Definition GroupDef(const char *name,const char *title); ~GroupDef(); //const char *groupFile() const { return fileName; } - QString getOutputFileBase() const { return fileName; } + QCString getOutputFileBase() const { return fileName; } const char *groupTitle() const { return title; } void addFile(const FileDef *def); void addClass(const ClassDef *def); @@ -45,8 +45,8 @@ class GroupDef : public Definition int countMembers() const; private: - QString title; // title of the group - QString fileName; // base name of the generated file + QCString title; // title of the group + QCString fileName; // base name of the generated file FileList *fileList; // list of all files in the group ClassList *classList; // list of all classes in the group NamespaceList *namespaceList; // list of all namespace in the group diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 8c5b50a..1a44646 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -14,8 +14,10 @@ * */ -#include #include + +#include "qtbc.h" +#include #include "message.h" #include "htmlgen.h" #include "config.h" @@ -26,9 +28,9 @@ HtmlGenerator::HtmlGenerator() : OutputGenerator() { - if (headerFile.length()>0) header=fileToString(headerFile); - if (footerFile.length()>0) footer=fileToString(footerFile); - dir=htmlOutputDir; + if (Config::headerFile.length()>0) header=fileToString(Config::headerFile); + if (Config::footerFile.length()>0) footer=fileToString(Config::footerFile); + dir=Config::htmlOutputDir; } HtmlGenerator::~HtmlGenerator() @@ -42,18 +44,18 @@ void HtmlGenerator::append(const OutputGenerator *g) void HtmlGenerator::init() { - QDir d(htmlOutputDir); - if (!d.exists() && !d.mkdir(htmlOutputDir)) + QDir d(Config::htmlOutputDir); + if (!d.exists() && !d.mkdir(Config::htmlOutputDir)) { - err("Could not create output directory %s\n",htmlOutputDir.data()); + err("Could not create output directory %s\n",Config::htmlOutputDir.data()); exit(1); } - writeLogo(htmlOutputDir); + writeLogo(Config::htmlOutputDir); } void HtmlGenerator::startFile(const char *name,const char *title,bool external) { - QString fileName=name; + QCString fileName=name; lastTitle=title; if (fileName.right(5)!=".html") fileName+=".html"; startPlainFile(fileName); @@ -156,7 +158,9 @@ void HtmlGenerator::writeStyleInfo(int part) if (part==0) { startPlainFile("doxygen.css"); - t << "H1 { border-width: thin; border: solid; text-align: center }" << endl + t + //<< "H1 { border-width: thin; border: solid; text-align: center }" << endl + << "H1 { text-align: center }" << endl << "A.el { text-decoration: none; font-weight: bold }" << endl << "DL.el { margin-left: -1cm }" << endl << "DIV.fragment { width: 100%; border: none; background-color: #eeeeee }" << endl @@ -274,7 +278,7 @@ void HtmlGenerator::writeSection(const char *lab,const char *title,bool sub) void HtmlGenerator::writeSectionRef(const char *name,const char *lab, const char *title) { - QString refName=name; + QCString refName=name; if (refName.right(5)!=".html") refName+=".html"; t << ""; docify(title); @@ -284,7 +288,7 @@ void HtmlGenerator::writeSectionRef(const char *name,const char *lab, void HtmlGenerator::writeSectionRefItem(const char *name,const char *lab, const char *title) { - QString refName=name; + QCString refName=name; if (refName.right(5)!=".html") refName+=".html"; t << ""; docify(title); @@ -356,7 +360,7 @@ void HtmlGenerator::endClassDiagram(ClassDiagram &d, void HtmlGenerator::startColorFont(uchar red,uchar green,uchar blue) { - QString colorString; + QCString colorString; colorString.sprintf("%02x%02x%02x",red,green,blue); t << ""; } @@ -370,12 +374,12 @@ void HtmlGenerator::writeFormula(const char *n,const char *text) { if (text && text[0]=='\\') t << "

    " << endl; t << "" << endl; - if (text && text[0]=='\\') t << "

    " << endl; + if (text && text[0]=='\\') t << "
  • " << endl; } void HtmlGenerator::startMemberList() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { //t << endl << "

    " << endl; } @@ -387,7 +391,7 @@ void HtmlGenerator::startMemberList() void HtmlGenerator::endMemberList() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { //t << "
    " << endl; } @@ -399,7 +403,7 @@ void HtmlGenerator::endMemberList() void HtmlGenerator::startMemberItem() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { t << ""; } @@ -411,15 +415,15 @@ void HtmlGenerator::startMemberItem() void HtmlGenerator::insertMemberAlign() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { - t << ""; + t << " "; } } void HtmlGenerator::endMemberItem() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { t << ""; } @@ -428,7 +432,7 @@ void HtmlGenerator::endMemberItem() void HtmlGenerator::startMemberDescription() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { t << ""; } @@ -440,7 +444,7 @@ void HtmlGenerator::startMemberDescription() void HtmlGenerator::endMemberDescription() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { t << "

    " << endl; } @@ -452,7 +456,7 @@ void HtmlGenerator::endMemberDescription() void HtmlGenerator::startMemberSections() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { t << "" << endl; } @@ -460,7 +464,7 @@ void HtmlGenerator::startMemberSections() void HtmlGenerator::endMemberSections() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { t << "
    " << endl; } @@ -468,7 +472,7 @@ void HtmlGenerator::endMemberSections() void HtmlGenerator::startMemberHeader() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { t << "

    "; } @@ -480,7 +484,7 @@ void HtmlGenerator::startMemberHeader() void HtmlGenerator::endMemberHeader() { - if (htmlAlignMemberFlag) + if (Config::htmlAlignMemberFlag) { t << "

    " << endl; } @@ -490,3 +494,13 @@ void HtmlGenerator::endMemberHeader() } } +void HtmlGenerator::startMemberSubtitle() +{ + if (Config::htmlAlignMemberFlag) t << ""; +} + +void HtmlGenerator::endMemberSubtitle() +{ + if (Config::htmlAlignMemberFlag) t << "

    " << endl; +} + diff --git a/src/htmlgen.h b/src/htmlgen.h index 556a334..5eb4484 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -17,6 +17,7 @@ #ifndef HTMLGEN_H #define HTMLGEN_H +#include "qtbc.h" #include "outputgen.h" class QFile; @@ -85,6 +86,8 @@ class HtmlGenerator : public OutputGenerator void endMemberSections(); void startMemberHeader(); void endMemberHeader(); + void startMemberSubtitle(); + void endMemberSubtitle(); void startMemberList(); void endMemberList(); void startMemberItem(); @@ -169,9 +172,9 @@ class HtmlGenerator : public OutputGenerator //static void docifyStatic(QTextStream &t,const char *str); private: - QString header; - QString footer; - QString lastTitle; + QCString header; + QCString footer; + QCString lastTitle; HtmlGenerator &operator=(const HtmlGenerator &g); HtmlGenerator(const HtmlGenerator &g); diff --git a/src/image.cpp b/src/image.cpp index 853d4ea..78f92c1 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -15,10 +15,10 @@ * */ +#include "qtbc.h" #include "image.h" #include "gifenc.h" #include -#include const int charSetWidth=80; const int charHeight=12; @@ -140,111 +140,6 @@ unsigned char fontRaw[charSetWidth*charHeight] = { 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0xac, 0x00, 0x00 }; - -#if 0 -const int charSetWidth=68; -const int charHeight=12; -const int numChars=80; - -unsigned short charPos[numChars] = - { 0, 7, 14, 21, 28, 35, 42, 49, - 56, 63, 70, 73, 76, 83, 90, 97, - 104,116,125,133,142,151,159,167, - 176,185,188,195,203,210,221,230, - 240,248,258,266,274,281,289,298, - 309,318,327,336,339,343,346,352, - 359,362,369,376,383,390,397,401, - 407,414,417,420,426,429,438,445, - 452,459,465,470,476,479,486,493, - 502,508,515,521,525,528,532,539 - }; - -unsigned char charWidth[numChars] = - { - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 3, 3, 7, 7, 7, 7, - 12, 9, 8, 9, 9, 8, 8, 9, - 9, 3, 7, 8, 7,11, 9,10, - 8,10, 8, 8, 7, 8, 9,11, - 9, 9, 9, 3, 4, 3, 6, 7, - 3, 7, 7, 7, 7, 7, 4, 6, - 7, 3, 3, 6, 3, 9, 7, 7, - 7, 6, 5, 6, 3, 7, 7, 9, - 6, 7, 6, 4, 3, 4, 7, 5 - }; - -unsigned char fontRaw[charSetWidth*charHeight] = { - 0x38, 0x20, 0xe1, 0xc0, 0x8f, 0x8e, 0x3e, 0x38, 0x70, 0x00, 0x00, 0x00, - 0x1c, 0x0f, 0x80, 0x83, 0xe0, 0xf1, 0xf0, 0xfc, 0xfc, 0x3c, 0x41, 0x20, - 0x48, 0x48, 0x10, 0x12, 0x08, 0x78, 0x7c, 0x1e, 0x1f, 0x0f, 0x3f, 0xa1, - 0x20, 0x91, 0x12, 0x09, 0x04, 0xfe, 0x71, 0x80, 0x00, 0x80, 0x20, 0x00, - 0x08, 0x01, 0x80, 0x81, 0x24, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0xc0, 0x00, 0x44, 0xe1, 0x12, 0x21, - 0x88, 0x11, 0x02, 0x44, 0x88, 0x00, 0x00, 0x00, 0x22, 0x30, 0x41, 0x42, - 0x11, 0x09, 0x08, 0x80, 0x80, 0x42, 0x41, 0x20, 0x48, 0x88, 0x18, 0x33, - 0x08, 0x84, 0x42, 0x21, 0x10, 0x90, 0x84, 0x21, 0x20, 0x91, 0x11, 0x11, - 0x04, 0x02, 0x50, 0x88, 0x01, 0x00, 0x20, 0x00, 0x08, 0x02, 0x00, 0x80, - 0x04, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x22, 0x20, 0x00, 0x44, 0x20, 0x10, 0x22, 0x88, 0x10, 0x04, 0x44, - 0x88, 0x00, 0x00, 0x00, 0x22, 0x26, 0xa1, 0x42, 0x12, 0x01, 0x04, 0x80, - 0x80, 0x80, 0x41, 0x20, 0x49, 0x08, 0x18, 0x32, 0x89, 0x02, 0x42, 0x40, - 0x90, 0x90, 0x04, 0x21, 0x11, 0x11, 0x11, 0x10, 0x88, 0x04, 0x48, 0x94, - 0x01, 0x8e, 0x2c, 0x38, 0x68, 0xe7, 0x34, 0xb1, 0x24, 0x92, 0x91, 0x61, - 0xc5, 0x86, 0x94, 0xce, 0x89, 0x14, 0x46, 0x14, 0x4f, 0x22, 0x20, 0x00, - 0x44, 0x20, 0x20, 0xc2, 0x8f, 0x16, 0x04, 0x38, 0x89, 0x20, 0xc0, 0x18, - 0x04, 0x49, 0x22, 0x22, 0x12, 0x01, 0x04, 0x80, 0x80, 0x80, 0x41, 0x20, - 0x4a, 0x08, 0x14, 0x52, 0x89, 0x02, 0x42, 0x40, 0x90, 0x8c, 0x04, 0x21, - 0x11, 0x09, 0x20, 0xa0, 0x88, 0x08, 0x48, 0xa2, 0x00, 0x11, 0x32, 0x44, - 0x99, 0x12, 0x4c, 0xc9, 0x25, 0x13, 0x69, 0x92, 0x26, 0x49, 0x99, 0x24, - 0x89, 0x14, 0x45, 0x24, 0x41, 0x22, 0x20, 0x00, 0x44, 0x20, 0x40, 0x24, - 0x80, 0x99, 0x08, 0x44, 0x78, 0x03, 0x0f, 0x86, 0x04, 0x51, 0x22, 0x23, - 0xe2, 0x01, 0x04, 0xfc, 0xf8, 0x8e, 0x7f, 0x20, 0x4e, 0x08, 0x14, 0x52, - 0x49, 0x02, 0x7c, 0x40, 0x9f, 0x03, 0x04, 0x21, 0x11, 0x0a, 0xa0, 0x40, - 0x50, 0x10, 0x44, 0x80, 0x00, 0x01, 0x22, 0x40, 0x89, 0x12, 0x44, 0x89, - 0x26, 0x12, 0x49, 0x12, 0x24, 0x48, 0x91, 0x04, 0x89, 0x12, 0x48, 0xc4, - 0x42, 0x22, 0x26, 0x40, 0x44, 0x20, 0x80, 0x28, 0x80, 0x91, 0x08, 0x44, - 0x08, 0x0c, 0x00, 0x01, 0x88, 0x51, 0x23, 0xe2, 0x12, 0x01, 0x04, 0x80, - 0x80, 0x82, 0x41, 0x20, 0x49, 0x08, 0x12, 0x92, 0x29, 0x02, 0x40, 0x44, - 0x91, 0x00, 0x84, 0x21, 0x0a, 0x0a, 0xa0, 0xa0, 0x20, 0x20, 0x44, 0x80, - 0x00, 0x0f, 0x22, 0x40, 0x89, 0xf2, 0x44, 0x89, 0x26, 0x12, 0x49, 0x12, - 0x24, 0x48, 0x90, 0xc4, 0x88, 0xa2, 0x48, 0xc4, 0x84, 0x42, 0x19, 0x80, - 0x44, 0x21, 0x02, 0x2f, 0xc8, 0x91, 0x08, 0x44, 0x08, 0x03, 0x0f, 0x86, - 0x08, 0x53, 0x44, 0x12, 0x12, 0x01, 0x04, 0x80, 0x80, 0x82, 0x41, 0x24, - 0x48, 0x88, 0x12, 0x92, 0x29, 0x02, 0x40, 0x42, 0x90, 0x90, 0x84, 0x21, - 0x0a, 0x04, 0x41, 0x10, 0x20, 0x40, 0x44, 0x80, 0x00, 0x11, 0x22, 0x40, - 0x89, 0x02, 0x44, 0x89, 0x25, 0x12, 0x49, 0x12, 0x24, 0x48, 0x90, 0x24, - 0x88, 0xa2, 0xa9, 0x22, 0x84, 0x22, 0x20, 0x00, 0x44, 0x21, 0x02, 0x20, - 0x88, 0x91, 0x10, 0x44, 0x88, 0x00, 0xc0, 0x18, 0x00, 0x4d, 0x84, 0x12, - 0x11, 0x09, 0x08, 0x80, 0x80, 0x46, 0x41, 0x24, 0x48, 0x48, 0x11, 0x12, - 0x18, 0x84, 0x40, 0x21, 0x10, 0x90, 0x84, 0x21, 0x04, 0x04, 0x41, 0x10, - 0x20, 0x80, 0x42, 0x80, 0x00, 0x11, 0x32, 0x44, 0x99, 0x12, 0x4c, 0x89, - 0x24, 0x92, 0x49, 0x12, 0x26, 0x49, 0x91, 0x24, 0x98, 0x41, 0x12, 0x12, - 0x88, 0x22, 0x20, 0x00, 0x38, 0x21, 0xf1, 0xc0, 0x87, 0x0e, 0x10, 0x38, - 0x71, 0x20, 0x00, 0x00, 0x08, 0x20, 0x04, 0x13, 0xe0, 0xf1, 0xf0, 0xfc, - 0x80, 0x3a, 0x41, 0x23, 0x88, 0x2f, 0x91, 0x12, 0x08, 0x78, 0x40, 0x1e, - 0x90, 0x8f, 0x04, 0x1e, 0x04, 0x04, 0x42, 0x08, 0x20, 0xfe, 0x42, 0x80, - 0x00, 0x0e, 0xac, 0x38, 0x68, 0xe2, 0x34, 0x89, 0x24, 0x52, 0x49, 0x11, - 0xc5, 0x86, 0x90, 0xc6, 0x68, 0x41, 0x12, 0x11, 0x0f, 0x22, 0x20, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, - 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x22, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x40, 0x80, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, - 0x20, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x22, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x40, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x1a, 0xc0, 0x00 -}; -#endif - static Color palette[] = { { 0xff, 0xff, 0xff }, diff --git a/src/index.cpp b/src/index.cpp index dcd457f..d8bd56c 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -34,7 +34,7 @@ //---------------------------------------------------------------------------- // strips w from s iff s starts with w -bool stripWord(QString &s,QString w) +bool stripWord(QCString &s,QCString w) { bool success=FALSE; if (s.left(w.length())==w) @@ -47,12 +47,12 @@ bool stripWord(QString &s,QString w) //---------------------------------------------------------------------------- // some quasi intelligent brief description abbreviator :^) -QString abbreviate(const char *s,const char *name) +QCString abbreviate(const char *s,const char *name) { - QString result=s; - QString start1=(QString)"The "+name+" class "; - QString start2=(QString)"The "+name+" widget "; - QString start3=(QString)"The "+name+" file "; + QCString result=s; + QCString start1=(QCString)"The "+name+" class "; + QCString start2=(QCString)"The "+name+" widget "; + QCString start3=(QCString)"The "+name+" file "; result=result.simplifyWhiteSpace(); // strip trailing . if (result.length()>0 && result.at(result.length()-1)=='.') @@ -236,7 +236,7 @@ void writeHierarchicalIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"hierarchy","Hierarchical Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trClassHierarchy()); + parseText(ol,Config::projectName+" "+theTranslator->trClassHierarchy()); endTitle(ol,0); parseText(ol,theTranslator->trClassHierarchyDescription()); ol.newParagraph(); @@ -272,10 +272,10 @@ void writeFileIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"files","File Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trFileList()); + parseText(ol,Config::projectName+" "+theTranslator->trFileList()); endTitle(ol,0); ol.newParagraph(); - parseText(ol,theTranslator->trFileListDescription(extractAllFlag)); + parseText(ol,theTranslator->trFileListDescription(Config::extractAllFlag)); ol.newParagraph(); ol.startIndexList(); @@ -289,13 +289,13 @@ void writeFileIndex(OutputList &ol) { //ol.writeIndexItem(fd->getReference(),fd->diskName(), // fd->name()); - QString path; - if (fullPathNameFlag) + QCString path; + if (Config::fullPathNameFlag) { path=fd->getPath().copy(); // strip part of the path - if (path.left(stripFromPath.length())==stripFromPath) - path=path.right(path.length()-stripFromPath.length()); + if (path.left(Config::stripFromPath.length())==Config::stripFromPath) + path=path.right(path.length()-Config::stripFromPath.length()); } ol.writeStartAnnoItem("file", @@ -337,7 +337,7 @@ int countNamespaces() NamespaceDef *nd; for (;(nd=nli.current());++nli) { - if (!nd->getReference() && nd->hasDocumentation()) count++; + if (nd->isVisible()) count++; } return count; } @@ -350,17 +350,17 @@ void writeNamespaceIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"namespaces","Namespace Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trNamespaceList()); + parseText(ol,Config::projectName+" "+theTranslator->trNamespaceList()); endTitle(ol,0); ol.newParagraph(); - parseText(ol,theTranslator->trNamespaceListDescription(extractAllFlag)); + parseText(ol,theTranslator->trNamespaceListDescription(Config::extractAllFlag)); ol.newParagraph(); ol.startIndexList(); NamespaceDef *nd=namespaceList.first(); while (nd) { - if (!nd->getReference() && nd->hasDocumentation()) + if (nd->isVisible()) { ol.writeStartAnnoItem("namespace",nd->getOutputFileBase(),0,nd->name()); ol.docify(" ("); @@ -419,12 +419,12 @@ void writeAnnotatedClassList(OutputList &ol) { if (!cd->isReference() && //!cd->name().isEmpty() && cd->name()[0]!='@' && - //(cd->protection()!=Private || extractPrivateFlag) && + //(cd->protection()!=Private || Config::extractPrivateFlag) && //(cd->hasDocumentation() || !hideClassFlag) cd->isVisible() ) { - QString type; + QCString type; switch (cd->compoundType()) { case ClassDef::Class: type="class"; break; @@ -465,7 +465,7 @@ void writeAnnotatedIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"annotated","Annotated Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trCompoundList()); + parseText(ol,Config::projectName+" "+theTranslator->trCompoundList()); endTitle(ol,0); parseText(ol,theTranslator->trCompoundListDescription()); writeAnnotatedClassList(ol); @@ -487,7 +487,7 @@ void writeMemberList(OutputList &ol) while (md && !found) { ClassDef *cd; - if ((md->isFriend() || md->protection()!=Private || extractPrivateFlag) && + if ((md->isFriend() || md->protection()!=Private || Config::extractPrivateFlag) && !md->isReference() && md->hasDocumentation() && md->name()[0]!='@' && (cd=md->memberClass()) && cd->isVisible() @@ -506,12 +506,12 @@ void writeMemberList(OutputList &ol) ol.writeString("\n"); int count=0; - md=mn->first(); - QString prevName; + md=mn->last(); + QCString prevName; while (md) { ClassDef *cd=md->memberClass(); - if (cd && (md->isFriend() || md->protection()!=Private || extractPrivateFlag) && + if (cd && (md->isFriend() || md->protection()!=Private || Config::extractPrivateFlag) && !md->isReference() && md->hasDocumentation() && prevName!=cd->name() && cd->isVisible() @@ -526,7 +526,7 @@ void writeMemberList(OutputList &ol) count++; prevName=cd->name(); } - md=mn->next(); + md=mn->prev(); } } mn=memberNameList.next(); @@ -548,11 +548,11 @@ int countClassMembers() ClassDef *cd; while (md && !found) { - if ((md->isFriend() || md->protection()!=Private || extractPrivateFlag) && + if ((md->isFriend() || md->protection()!=Private || Config::extractPrivateFlag) && !md->isReference() && !md->isRelated() && md->hasDocumentation() && md->name()[0]!='@' && (cd=md->memberClass()) && cd->isVisible()) otherMd=md; - if ((md->isFriend() || md->protection()!=Private || extractPrivateFlag) && + if ((md->isFriend() || md->protection()!=Private || Config::extractPrivateFlag) && !md->isReference() && md->isRelated() && md->hasDocumentation() && md->name()[0]!='@' && (cd=md->memberClass()) && cd->isVisible()) found=TRUE; @@ -574,9 +574,9 @@ void writeMemberIndex(OutputList &ol) ol.disable(OutputGenerator::Latex); startFile(ol,"functions","Compound Member Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trCompoundMembers()); + parseText(ol,Config::projectName+" "+theTranslator->trCompoundMembers()); endTitle(ol,0); - parseText(ol,theTranslator->trCompoundMembersDescription(extractAllFlag)); + parseText(ol,theTranslator->trCompoundMembersDescription(Config::extractAllFlag)); writeMemberList(ol); endFile(ol); ol.enable(OutputGenerator::Latex); @@ -615,8 +615,8 @@ void writeFileMemberList(OutputList &ol) ol.writeString("\n"); int count=0; - md=mn->first(); - QString prevName; + md=mn->last(); + QCString prevName; while (md) { FileDef *fd=md->getFileDef() ? md->getFileDef() : md->getFileDec(); @@ -633,7 +633,7 @@ void writeFileMemberList(OutputList &ol) ol.docify(": "); else ol.docify(", "); - QString baseName=fd->name().copy(); + QCString baseName=fd->name().copy(); //int s; //if ((s=baseName.findRev("/"))!=-1) // baseName=baseName.right(baseName.length()-s-1); @@ -642,7 +642,7 @@ void writeFileMemberList(OutputList &ol) count++; prevName=fd->name(); } - md=mn->next(); + md=mn->prev(); } } mn=functionNameList.next(); @@ -663,11 +663,9 @@ void writeNamespaceMemberList(OutputList &ol) while (md && !found) { NamespaceDef *nd=md->getNamespace(); - if (nd && nd->hasDocumentation() && - !md->isReference() && - md->hasDocumentation() && - !md->name().isEmpty() && - md->name()[0]!='@') found=TRUE; + if (nd && nd->isVisible() && + !md->isReference() && md->hasDocumentation() && + !md->name().isEmpty() && md->name().at(0)!='@') found=TRUE; else md=mn->next(); } @@ -679,16 +677,16 @@ void writeNamespaceMemberList(OutputList &ol) ol.writeString("\n"); int count=0; - md=mn->first(); - QString prevName; + md=mn->last(); + QCString prevName; while (md) { NamespaceDef *nd=md->getNamespace(); - if (nd && nd->hasDocumentation() && - !md->isReference() && - md->hasDocumentation() && - !md->name().isEmpty() && md->name()[0]!='@' - ) + if (nd && nd->isVisible() && + !md->isReference() && md->hasDocumentation() && + !md->name().isEmpty() && md->name().at(0)!='@' && + prevName!=nd->name() + ) { if (count==0) ol.docify(": "); @@ -697,8 +695,9 @@ void writeNamespaceMemberList(OutputList &ol) ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(), md->anchor(),nd->name()); count++; + prevName=nd->name(); } - md=mn->next(); + md=mn->prev(); } } mn=functionNameList.next(); @@ -718,10 +717,11 @@ int countNamespaceMembers() bool found=FALSE; while (md && !found) { - if (md->getNamespace() && + NamespaceDef *nd=md->getNamespace(); + if (nd && nd->isVisible() && !md->isReference() && md->hasDocumentation() && - !md->name().isEmpty() && md->name()[0]!='@' - ) + !md->name().isEmpty() && md->name().at(0)!='@' + ) found=TRUE; else md=mn->next(); @@ -771,9 +771,9 @@ void writeFileMemberIndex(OutputList &ol) ol.disable(OutputGenerator::Latex); startFile(ol,"globals","File Member Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trFileMembers()); + parseText(ol,Config::projectName+" "+theTranslator->trFileMembers()); endTitle(ol,0); - parseText(ol,theTranslator->trFileMembersDescription(extractAllFlag)); + parseText(ol,theTranslator->trFileMembersDescription(Config::extractAllFlag)); writeFileMemberList(ol); endFile(ol); ol.enable(OutputGenerator::Latex); @@ -789,9 +789,9 @@ void writeNamespaceMemberIndex(OutputList &ol) ol.disable(OutputGenerator::Latex); startFile(ol,"namespacemembers","Namespace Member Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trNamespaceMembers()); + parseText(ol,Config::projectName+" "+theTranslator->trNamespaceMembers()); endTitle(ol,0); - parseText(ol,theTranslator->trNamespaceMemberDescription(extractAllFlag)); + parseText(ol,theTranslator->trNamespaceMemberDescription(Config::extractAllFlag)); writeNamespaceMemberList(ol); endFile(ol); ol.enable(OutputGenerator::Latex); @@ -809,13 +809,13 @@ void writeHeaderFileList(OutputList &ol) while (fd) { ol.writeListItem(); - QString path; - if (fullPathNameFlag) + QCString path; + if (Config::fullPathNameFlag) { path=fd->getPath().copy(); // strip part of the path - if (path.left(stripFromPath.length())==stripFromPath) - path=path.right(path.length()-stripFromPath.length()); + if (path.left(Config::stripFromPath.length())==Config::stripFromPath) + path=path.right(path.length()-Config::stripFromPath.length()); } if (!path.isEmpty()) ol.docify(path); ol.writeObjectLink(0,fd->includeName(),0,fd->name()); @@ -835,7 +835,7 @@ void writeHeaderIndex(OutputList &ol) ol.disable(OutputGenerator::Latex); startFile(ol,"headers","Header File Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trHeaderFiles()); + parseText(ol,Config::projectName+" "+theTranslator->trHeaderFiles()); endTitle(ol,0); parseText(ol,theTranslator->trHeaderFilesDescription()); writeHeaderFileList(ol); @@ -852,7 +852,7 @@ void writeExampleIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"examples","Example Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trExamples()); + parseText(ol,Config::projectName+" "+theTranslator->trExamples()); endTitle(ol,0); parseText(ol,theTranslator->trExamplesDescription()); ol.startIndexList(); @@ -860,7 +860,7 @@ void writeExampleIndex(OutputList &ol) while (pi) { ol.writeListItem(); - QString n=convertSlashes(pi->name,TRUE)+"-example"; + QCString n=convertSlashes(pi->name,TRUE)+"-example"; if (!pi->title.isEmpty()) { ol.writeObjectLink(0,n,0,pi->title); @@ -885,16 +885,16 @@ void writePageIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"pages","Page Index"); startTitle(ol); - ol.docify(projectName+" "+theTranslator->trRelatedPages()); + ol.docify(Config::projectName+" "+theTranslator->trRelatedPages()); endTitle(ol,0); parseText(ol,theTranslator->trRelatedPagesDescription()); ol.startIndexList(); PageInfo *pi=pageList.first(); while (pi) { - QString pageName,pageTitle; + QCString pageName,pageTitle; - if (caseSensitiveNames) + if (Config::caseSensitiveNames) pageName=pi->name.copy(); else pageName=pi->name.lower(); @@ -960,7 +960,7 @@ void writeGroupIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"modules","Module Index"); startTitle(ol); - parseText(ol,projectName+" "+theTranslator->trModules()); + parseText(ol,Config::projectName+" "+theTranslator->trModules()); endTitle(ol,0); parseText(ol,theTranslator->trModulesDescription()); writeGroupList(ol); @@ -975,27 +975,27 @@ void writeIndex(OutputList &ol) bool texEnabled = ol.isEnabled(OutputGenerator::Latex); bool htmEnabled = ol.isEnabled(OutputGenerator::Html); - QString projPrefix; - if (!projectName.isEmpty()) + QCString projPrefix; + if (!Config::projectName.isEmpty()) { - projPrefix=projectName+" "; + projPrefix=Config::projectName+" "; } // write HTML index ol.disable(OutputGenerator::Man); ol.disable(OutputGenerator::Latex); ol.startFile("index","Main Index",FALSE); - if (!noIndexFlag) writeQuickLinks(ol,TRUE); + if (!Config::noIndexFlag) writeQuickLinks(ol,TRUE); ol.startTitleHead(); parseText(ol,projPrefix+theTranslator->trDocumentation()); ol.endTitleHead(0); ol.newParagraph(); - if (!projectNumber.isEmpty()) + if (!Config::projectNumber.isEmpty()) { ol.startProjectNumber(); - parseDoc(ol,0,0,projectNumber); + parseDoc(ol,0,0,Config::projectNumber); ol.endProjectNumber(); } - if (noIndexFlag) writeQuickLinks(ol,FALSE); + if (Config::noIndexFlag) writeQuickLinks(ol,FALSE); endFile(ol); ol.disable(OutputGenerator::Html); @@ -1004,10 +1004,10 @@ void writeIndex(OutputList &ol) ol.startFile("refman",0,FALSE); ol.startIndexSection(isTitlePageStart); parseText(ol,projPrefix+theTranslator->trReferenceManual()); - if (!projectNumber.isEmpty()) + if (!Config::projectNumber.isEmpty()) { ol.startProjectNumber(); - parseDoc(ol,0,0,projectNumber); + parseDoc(ol,0,0,Config::projectNumber); ol.endProjectNumber(); } ol.endIndexSection(isTitlePageStart); diff --git a/src/index.h b/src/index.h index 0091f6a..a472a7a 100644 --- a/src/index.h +++ b/src/index.h @@ -17,8 +17,9 @@ #ifndef INDEX_H #define INDEX_H +#include "qtbc.h" #include -#include +//#include enum IndexSections { diff --git a/src/instdox.cpp b/src/instdox.cpp index ad22c89..4faa2e6 100644 --- a/src/instdox.cpp +++ b/src/instdox.cpp @@ -16,7 +16,8 @@ #include #include -#include + +#include "qtbc.h" #include #include #include @@ -28,19 +29,19 @@ void writeInstallScript() { - QString fileName=htmlOutputDir+"/installdox"; + QCString fileName=Config::htmlOutputDir+"/installdox"; QFile f(fileName); if (f.open(IO_WriteOnly)) { QTextStream t(&f); - t << "#!" << perlPath << endl << endl << "%subst = ( "; + t << "#!" << Config::perlPath << endl << endl << "%subst = ( "; - char *s=tagFileList.first(); + char *s=Config::tagFileList.first(); while (s) { QFileInfo fi(s); t << "\"" << fi.fileName() << "\", \"\""; - s=tagFileList.next(); + s=Config::tagFileList.next(); if (s) t << ", "; } diff --git a/src/language.cpp b/src/language.cpp index f5e2dde..cee63a8 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -20,7 +20,9 @@ #include "translator_cz.h" #include "translator_fr.h" #include "translator_it.h" -#include +#include "translator_de.h" +#include "translator_jp.h" +#include "translator_es.h" #define L_EQUAL(a) !stricmp(langName,a) @@ -52,6 +54,18 @@ bool setTranslator(const char *langName) { theTranslator=new TranslatorItalian; } + else if (L_EQUAL("german")) + { + theTranslator=new TranslatorGerman; + } + else if (L_EQUAL("japanese")) + { + theTranslator=new TranslatorJapanese; + } + else if (L_EQUAL("spanish")) + { + theTranslator=new TranslatorSpanish; + } else // use the default language (i.e. english) { theTranslator=new Translator; diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 2f2f62b..2f49efa 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -15,6 +15,8 @@ */ #include + +#include "qtbc.h" #include #include "latexgen.h" #include "config.h" @@ -24,9 +26,9 @@ #include "diagram.h" #include "language.h" -//static QString escapeLabelName(const QString &s) +//static QCString escapeLabelName(const QCString &s) //{ -// QString result; +// QCString result; // uint i; // for (i=0;ilatexBabelPackage() << "}\n"; } - const char *s=extraPackageList.first(); + const char *s=Config::extraPackageList.first(); while (s) { t << "\\usepackage{" << s << "}\n"; - s=extraPackageList.next(); + s=Config::extraPackageList.next(); } t << "\\makeindex\n" "\\setcounter{tocdepth}{1}\n" @@ -169,23 +171,23 @@ void LatexGenerator::startIndexSection(IndexSections is) t << "}\n\\author{"; break; case isModuleIndex: - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Module Index}\n" break; case isNamespaceIndex: - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Namespace Index}\" break; case isClassHierarchyIndex: - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Hierarchical Index}\n" break; case isCompoundIndex: - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Annotated Compound Index}\n" break; case isFileIndex: - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Annotated File Index}\n" break; case isModuleDocumentation: @@ -196,7 +198,7 @@ void LatexGenerator::startIndexSection(IndexSections is) { if (gd->hasDocumentation() || gd->countMembers()>0) { - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Module Documentation}\n"; found=TRUE; } @@ -212,7 +214,7 @@ void LatexGenerator::startIndexSection(IndexSections is) { if (nd->hasDocumentation()) { - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; // Namespace Documentation}\n": found=TRUE; } @@ -228,7 +230,7 @@ void LatexGenerator::startIndexSection(IndexSections is) { if (!cd->isReference() && cd->isVisible()) { - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Compound Documentation}\n"; found=TRUE; } @@ -249,7 +251,7 @@ void LatexGenerator::startIndexSection(IndexSections is) { if (isFirst) { - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //File Documentation}\n"; isFirst=FALSE; break; @@ -263,13 +265,13 @@ void LatexGenerator::startIndexSection(IndexSections is) break; case isExampleDocumentation: { - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Example Documentation}\n"; } break; case isPageDocumentation: { - if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Page Documentation}\n"; } break; @@ -289,9 +291,9 @@ void LatexGenerator::endIndexSection(IndexSections is) "\\date{" << dateToString(TRUE) << "}\n" "\\maketitle\n" "\\pagenumbering{roman}\n"; - if (!compactLatexFlag) t << "\\clearemptydoublepage\n"; + if (!Config::compactLatexFlag) t << "\\clearemptydoublepage\n"; t << "\\tableofcontents\n"; - if (!compactLatexFlag) t << "\\clearemptydoublepage\n"; + if (!Config::compactLatexFlag) t << "\\clearemptydoublepage\n"; t << "\\pagenumbering{arabic}\n"; break; case isModuleIndex: @@ -326,7 +328,7 @@ void LatexGenerator::endIndexSection(IndexSections is) { if (gd->hasDocumentation() || gd->countMembers()>0) { - if (compactLatexFlag) t << "\\input"; else t << "\\include"; + if (Config::compactLatexFlag) t << "\\input"; else t << "\\include"; t << "{" << gd->getOutputFileBase() << "}\n"; } gd=groupList.next(); @@ -350,7 +352,7 @@ void LatexGenerator::endIndexSection(IndexSections is) { if (nd->hasDocumentation() || nd->countMembers()>0) { - if (compactLatexFlag) t << "\\input"; else t << "\\include"; + if (Config::compactLatexFlag) t << "\\input"; else t << "\\include"; t << "{" << nd->getOutputFileBase() << "}\n"; } nd=namespaceList.next(); @@ -382,7 +384,7 @@ void LatexGenerator::endIndexSection(IndexSections is) // ) if (!cd->isReference() && cd->isVisible()) { - if (compactLatexFlag) t << "\\input"; else t << "\\include"; + if (Config::compactLatexFlag) t << "\\input"; else t << "\\include"; t << "{" << cd->getOutputFileBase() << "}\n"; } cd=classList.next(); @@ -407,7 +409,7 @@ void LatexGenerator::endIndexSection(IndexSections is) } else { - if (compactLatexFlag) t << "\\input" ; else t << "\\include"; + if (Config::compactLatexFlag) t << "\\input" ; else t << "\\include"; t << "{" << fd->getOutputFileBase() << "}\n"; } } @@ -428,7 +430,7 @@ void LatexGenerator::endIndexSection(IndexSections is) } while (pi) { - if (compactLatexFlag) t << "\\input" ; else t << "\\include"; + if (Config::compactLatexFlag) t << "\\input" ; else t << "\\include"; t << "{" << convertSlashes(pi->name,TRUE) << "-example}\n"; pi=exampleList.next(); } @@ -440,8 +442,8 @@ void LatexGenerator::endIndexSection(IndexSections is) PageInfo *pi=pageList.first(); if (pi) { - QString pageName; - if (caseSensitiveNames) + QCString pageName; + if (Config::caseSensitiveNames) pageName=pi->name.copy(); else pageName=pi->name.lower(); @@ -450,9 +452,9 @@ void LatexGenerator::endIndexSection(IndexSections is) } while (pi) { - if (compactLatexFlag) t << "\\input" ; else t << "\\include"; - QString pageName; - if (caseSensitiveNames) + if (Config::compactLatexFlag) t << "\\input" ; else t << "\\include"; + QCString pageName; + if (Config::caseSensitiveNames) pageName=pi->name.copy(); else pageName=pi->name.lower(); @@ -473,7 +475,7 @@ void LatexGenerator::writeStyleInfo(int part) { case 0: { - QString pname=projectName.stripWhiteSpace(); + QCString pname=Config::projectName.stripWhiteSpace(); startPlainFile("doxygen.sty"); t << "\\NeedsTeXFormat{LaTeX2e}\n"; t << "\\ProvidesPackage{doxygen}\n"; @@ -484,7 +486,7 @@ void LatexGenerator::writeStyleInfo(int part) t << "\\addtolength{\\headwidth}{\\marginparwidth}\n"; t << "\\newcommand{\\clearemptydoublepage}{\\newpage{\\pagestyle{empty}"; t << "\\cleardoublepage}}\n"; - if (!compactLatexFlag) + if (!Config::compactLatexFlag) t << "\\renewcommand{\\chaptermark}[1]{\\markboth{#1}{}}\n"; t << "\\renewcommand{\\sectionmark}[1]{\\markright{\\thesection\\ #1}}\n"; t << "\\lhead[\\fancyplain{}{\\bfseries\\thepage}]\n"; @@ -501,7 +503,7 @@ void LatexGenerator::writeStyleInfo(int part) case 2: { t << " Dimitri van Heesch \\copyright 1997-1999}]{}\n"; - //QString dtString=dateToString(FALSE); + //QCString dtString=dateToString(FALSE); t << "\\lfoot[]{\\fancyplain{}{\\bfseries\\scriptsize "; } break; @@ -646,7 +648,7 @@ void LatexGenerator::writeObjectLink(const char *, const char *, void LatexGenerator::writePageRef(const char *clname, const char *anchor) { - t << " {\\rm (p. \\pageref{"; + t << " {\\rm (p.~\\pageref{"; if (clname) t << clname; if (anchor) t << "_" << anchor; t << "})}"; @@ -662,12 +664,12 @@ void LatexGenerator::writeCodeLink(const char *,const char *, void LatexGenerator::startTitle() { - if (compactLatexFlag) t << "\\subsection{"; else t << "\\section{"; + if (Config::compactLatexFlag) t << "\\subsection{"; else t << "\\section{"; } void LatexGenerator::startGroupHeader() { - if (compactLatexFlag) t << "\\subsubsection*{"; else t << "\\subsection*{"; + if (Config::compactLatexFlag) t << "\\subsubsection*{"; else t << "\\subsection*{"; } void LatexGenerator::endGroupHeader() @@ -700,7 +702,7 @@ void LatexGenerator::startMemberDoc(const char *clname, } t << "}" << endl; // - if (compactLatexFlag) t << "\\subsubsection{"; else t << "\\subsection{"; + if (Config::compactLatexFlag) t << "\\subsubsection{"; else t << "\\subsection{"; t << "\\setlength{\\rightskip}{0pt plus 5cm}"; } @@ -762,7 +764,7 @@ void LatexGenerator::writeSectionRefAnchor(const char *,const char *lab, startBold(); docify(title); endBold(); - t << " (p. \\pageref{" << lab << "})" << endl; + t << " (p.~\\pageref{" << lab << "})" << endl; } //void LatexGenerator::docify(const char *str) @@ -808,78 +810,101 @@ void LatexGenerator::docify(const char *str) else { t << "$\\backslash$"; } break; - // the Latin-1 characters - case 161: t << "!`"; break; - case 181: t << "$\\mu$"; break; - case 191: t << "?`"; break; - case 192: t << "\\`{A}"; break; - case 193: t << "\\'{A}"; break; - case 194: t << "\\^{A}"; break; - case 195: t << "\\~{A}"; break; - case 196: t << "\\\"{A}"; break; - case 197: t << "\\AA "; break; - case 198: t << "\\AE "; break; - case 199: t << "\\c{C}"; break; - case 200: t << "\\`{E}"; break; - case 201: t << "\\'{E}"; break; - case 202: t << "\\^{E}"; break; - case 203: t << "\\\"{E}"; break; - case 204: t << "\\`{I}"; break; - case 205: t << "\\'{I}"; break; - case 206: t << "\\^{I}"; break; - case 207: t << "\\\"{I}"; break; - case 208: t << "D "; break; // anyone know the real code? - case 209: t << "\\~{N}"; break; - case 210: t << "\\`{O}"; break; - case 211: t << "\\'{O}"; break; - case 212: t << "\\^{O}"; break; - case 213: t << "\\~{O}"; break; - case 214: t << "\\\"{O}"; break; - case 215: t << "$\\times$"; break; - case 216: t << "\\O"; break; - case 217: t << "\\`{U}"; break; - case 218: t << "\\'{U}"; break; - case 219: t << "\\^{U}"; break; - case 220: t << "\\\"{U}"; break; - case 221: t << "\\'{Y}"; break; - case 223: t << "\"s "; break; // assumes german package - case 224: t << "\\`{a}"; break; - case 225: t << "\\'{a}"; break; - case 226: t << "\\^{a}"; break; - case 227: t << "\\~{a}"; break; - case 228: t << "\\\"{a}"; break; - case 229: t << "\\aa "; break; - case 230: t << "\\ae "; break; - case 231: t << "\\c{c}"; break; - case 232: t << "\\`{e}"; break; - case 233: t << "\\'{e}"; break; - case 234: t << "\\^{e}"; break; - case 235: t << "\\\"{e}"; break; - case 236: t << "\\`{\\i}"; break; - case 237: t << "\\'{\\i}"; break; - case 238: t << "\\^{\\i}"; break; - case 239: t << "\\\"{\\i}"; break; - case 241: t << "\\~{n}"; break; - case 242: t << "\\`{o}"; break; - case 243: t << "\\'{o}"; break; - case 244: t << "\\^{o}"; break; - case 245: t << "\\~{o}"; break; - case 246: t << "\\\"{o}"; break; - case 248: t << "\\o "; break; - case 249: t << "\\`{u}"; break; - case 250: t << "\\'{u}"; break; - case 251: t << "\\^{u}"; break; - case 252: t << "\\\"{u}"; break; - case 253: t << "\\'{y}"; break; - case 255: t << "\\\"{y}"; break; default: - if ((isupper(c) && islower(pc)) - // || - // (pc!=':' && c==':') || - // (pc==':' && c!=':') - ) t << "\\-"; - t << (char)c; + if (theTranslator->latexBabelPackage()=="a4j") + { // language is japanese + if (c>=128) // wide character + { + t << (char)c; + if (*p) + { + c = *p++; + t << (char)c; + } + else // ascii char => see if we can insert hypenation hint + { + if (isupper(c) && islower(pc)) t << "\\-"; + t << (char)c; + } + } + } + else // language is other than japanese + { + switch(c) + { + // the Latin-1 characters + case 161: t << "!`"; break; + case 181: t << "$\\mu$"; break; + case 191: t << "?`"; break; + case 192: t << "\\`{A}"; break; + case 193: t << "\\'{A}"; break; + case 194: t << "\\^{A}"; break; + case 195: t << "\\~{A}"; break; + case 196: t << "\\\"{A}"; break; + case 197: t << "\\AA "; break; + case 198: t << "\\AE "; break; + case 199: t << "\\c{C}"; break; + case 200: t << "\\`{E}"; break; + case 201: t << "\\'{E}"; break; + case 202: t << "\\^{E}"; break; + case 203: t << "\\\"{E}"; break; + case 204: t << "\\`{I}"; break; + case 205: t << "\\'{I}"; break; + case 206: t << "\\^{I}"; break; + case 207: t << "\\\"{I}"; break; + case 208: t << "D "; break; // anyone know the real code? + case 209: t << "\\~{N}"; break; + case 210: t << "\\`{O}"; break; + case 211: t << "\\'{O}"; break; + case 212: t << "\\^{O}"; break; + case 213: t << "\\~{O}"; break; + case 214: t << "\\\"{O}"; break; + case 215: t << "$\\times$"; break; + case 216: t << "\\O"; break; + case 217: t << "\\`{U}"; break; + case 218: t << "\\'{U}"; break; + case 219: t << "\\^{U}"; break; + case 220: t << "\\\"{U}"; break; + case 221: t << "\\'{Y}"; break; + case 223: t << "\"s "; break; // assumes german package + case 224: t << "\\`{a}"; break; + case 225: t << "\\'{a}"; break; + case 226: t << "\\^{a}"; break; + case 227: t << "\\~{a}"; break; + case 228: t << "\\\"{a}"; break; + case 229: t << "\\aa "; break; + case 230: t << "\\ae "; break; + case 231: t << "\\c{c}"; break; + case 232: t << "\\`{e}"; break; + case 233: t << "\\'{e}"; break; + case 234: t << "\\^{e}"; break; + case 235: t << "\\\"{e}"; break; + case 236: t << "\\`{\\i}"; break; + case 237: t << "\\'{\\i}"; break; + case 238: t << "\\^{\\i}"; break; + case 239: t << "\\\"{\\i}"; break; + case 241: t << "\\~{n}"; break; + case 242: t << "\\`{o}"; break; + case 243: t << "\\'{o}"; break; + case 244: t << "\\^{o}"; break; + case 245: t << "\\~{o}"; break; + case 246: t << "\\\"{o}"; break; + case 248: t << "\\o "; break; + case 249: t << "\\`{u}"; break; + case 250: t << "\\'{u}"; break; + case 251: t << "\\^{u}"; break; + case 252: t << "\\\"{u}"; break; + case 253: t << "\\'{y}"; break; + case 255: t << "\\\"{y}"; break; + default: // normal ascii char + { + // see if we can insert an hyphenation hint + if (isupper(c) && islower(pc)) t << "\\-"; + t << (char)c; + } + } + } } pc = c; } @@ -916,7 +941,7 @@ void LatexGenerator::writeChar(char c) void LatexGenerator::startClassDiagram() { - if (compactLatexFlag) t << "\\subsubsection*"; else t << "\\subsection*"; + if (Config::compactLatexFlag) t << "\\subsubsection*"; else t << "\\subsection*"; t << "{"; } diff --git a/src/latexgen.h b/src/latexgen.h index 5cabe66..cfd8230 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -83,6 +83,8 @@ class LatexGenerator : public OutputGenerator void endMemberSections() {} void startMemberHeader() { startGroupHeader(); } void endMemberHeader() { endGroupHeader(); } + void startMemberSubtitle() {} + void endMemberSubtitle() {} void startMemberList() { t << "\\begin{CompactItemize}" << endl; } void endMemberList() { t << "\\end{CompactItemize}" << endl; } void startMemberItem() { t << "\\item " << endl; } diff --git a/src/logos.cpp b/src/logos.cpp index 090309a..ac6e782 100644 --- a/src/logos.cpp +++ b/src/logos.cpp @@ -14,10 +14,11 @@ * */ -#include -#include #include +#include "qtbc.h" +#include + unsigned char logo_data[] = { 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x76, 0x00, 0x35, 0x00, 0xf7, 0x00, 0x00, 0x31, 0x7b, 0x6b, 0x31, 0x7b, 0x73, 0x31, 0x84, 0x7b, 0x31, 0x84, @@ -492,7 +493,7 @@ unsigned int search_len = 2010; void writeLogo(const char *dir) { - QString fileName=(QString)dir+"/doxygen.gif"; + QCString fileName=(QCString)dir+"/doxygen.gif"; QFile f(fileName); if (f.open(IO_WriteOnly)) f.writeBlock((char *)logo_data,logo_len); @@ -505,7 +506,7 @@ void writeLogo(const char *dir) void writeSearchButton(const char *dir) { - QString fileName=(QString)dir+"/search.gif"; + QCString fileName=(QCString)dir+"/search.gif"; QFile f(fileName); if (f.open(IO_WriteOnly)) f.writeBlock((char *)search_data,search_len); diff --git a/src/mangen.cpp b/src/mangen.cpp index d1bc4c6..056bc90 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -14,8 +14,10 @@ * */ -#include #include + +#include "qtbc.h" +#include #include "message.h" #include "mangen.h" #include "config.h" @@ -24,7 +26,7 @@ ManGenerator::ManGenerator() : OutputGenerator() { - dir=manOutputDir+"/man3"; + dir=Config::manOutputDir+"/man3"; firstCol=TRUE; paragraph=FALSE; col=0; @@ -37,7 +39,7 @@ ManGenerator::~ManGenerator() void ManGenerator::append(const OutputGenerator *g) { - QString r=g->getContents(); + QCString r=g->getContents(); if (upperCase) t << r.upper(); else @@ -52,23 +54,23 @@ void ManGenerator::append(const OutputGenerator *g) void ManGenerator::init() { - QDir d(manOutputDir); - if (!d.exists() && !d.mkdir(manOutputDir)) + QDir d(Config::manOutputDir); + if (!d.exists() && !d.mkdir(Config::manOutputDir)) { - err("Could not create output directory %s\n",manOutputDir.data()); + err("Could not create output directory %s\n",Config::manOutputDir.data()); exit(1); } - d.setPath(manOutputDir+"/man3"); - if (!d.exists() && !d.mkdir(manOutputDir+"/man3")) + d.setPath(Config::manOutputDir+"/man3"); + if (!d.exists() && !d.mkdir(Config::manOutputDir+"/man3")) { - err("Could not create output directory %s/man3\n",manOutputDir.data()); + err("Could not create output directory %s/man3\n",Config::manOutputDir.data()); exit(1); } } void ManGenerator::startFile(const char *name,const char *,bool) { - QString fileName=name; + QCString fileName=name; if (fileName.left(6)=="class_") { fileName=fileName.right(fileName.length()-6); @@ -78,7 +80,8 @@ void ManGenerator::startFile(const char *name,const char *,bool) { fileName=fileName.left(i); } - if (fileName.right(2)!=manExtension) fileName+=manExtension; + if (convertToQCString(fileName.right(2))!=Config::manExtension) + fileName+=Config::manExtension; startPlainFile(fileName); firstCol=TRUE; } @@ -95,10 +98,10 @@ void ManGenerator::writeDoxyAnchor(const char *, const char *,const char *) void ManGenerator::endTitleHead(const char *name) { t << ".TH " << name << " 3 \"" << dateToString(FALSE) << "\" \""; - if (projectName.isEmpty()) + if (Config::projectName.isEmpty()) t << "Doxygen"; else - t << projectName; + t << Config::projectName; t << "\" \\\" -*- nroff -*-" << endl; t << ".ad l" << endl; t << ".nh" << endl; diff --git a/src/mangen.h b/src/mangen.h index bcc9034..03a6a39 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -82,6 +82,8 @@ class ManGenerator : public OutputGenerator void startMemberHeader(); void endMemberHeader(); void insertMemberAlign() {} + void startMemberSubtitle() {} + void endMemberSubtitle() {} void writeListItem(); void startMemberList() { t << "\n.in +1c"; firstCol=FALSE; } void endMemberList() { t << "\n.in -1c"; firstCol=FALSE; } diff --git a/src/memberdef.cpp b/src/memberdef.cpp index bd440c3..1321692 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -58,6 +58,7 @@ MemberDef::MemberDef(const char *t,const char *na,const char *a,const char *e, enumFields=0; enumScope=0; enumDeclList=0; + scopeTAL=0; type=substituteClassNames(t); args=substituteClassNames(a); if (type.isNull()) decl=name()+args; else decl=type+" "+name()+args; @@ -107,7 +108,6 @@ MemberDef::MemberDef(const char *t,const char *na,const char *a,const char *e, { argList=0; } - } MemberDef::~MemberDef() @@ -180,7 +180,7 @@ void MemberDef::writeExample(OutputList &ol) } #endif -QString MemberDef::getOutputFileBase() const +QCString MemberDef::getOutputFileBase() const { if (classDef) { @@ -202,3 +202,50 @@ QString MemberDef::getOutputFileBase() const " container!\n",name().data()); return "dummy"; } + +void MemberDef::setScopeTemplateArguments(ArgumentList *tal) +{ + // copy function arguments (if any) + if (tal) + { + scopeTAL = new ArgumentList; + scopeTAL->setAutoDelete(TRUE); + ArgumentListIterator tali(*tal); + Argument *a; + for (;(a=tali.current());++tali) + { + scopeTAL->append(new Argument(*a)); + } + scopeTAL->constSpecifier = tal->constSpecifier; + scopeTAL->volatileSpecifier = tal->volatileSpecifier; + scopeTAL->pureSpecifier = tal->pureSpecifier; + } +} + +QCString MemberDef::getScopeTemplateNameString() +{ + QCString result; + if (!scopeTAL || scopeTAL->count()==0) return result; + result="<"; + Argument *a=scopeTAL->first(); + while (a) + { + if (a->name.length()>0) // add template argument name + { + result+=a->name; + } + else // extract name from type + { + int i=a->type.length()-1; + while (i>=0 && isId(a->type.at(i))) i--; + if (i>0) + { + result+=a->type.right(a->type.length()-i-1); + } + } + a=scopeTAL->next(); + if (a) result+=", "; + } + result+=">"; + return result; +} diff --git a/src/memberdef.h b/src/memberdef.h index 67a9aa9..4c1893f 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -17,7 +17,7 @@ #ifndef MEMBERDEF_H #define MEMBERDEF_H -#include +#include "qtbc.h" #include #include @@ -55,13 +55,14 @@ class MemberDef : public Definition const ArgumentList *al); ~MemberDef(); - QString getOutputFileBase() const; + QCString getOutputFileBase() const; const char *declaration() const { return decl; } const char *definition() const { return def; } const char *typeString() const { return type; } const char *argsString() const { return args; } const char *excpString() const { return exception; } const char *anchor() const { return ref; } + QCString bodyCode() const { return body; } ClassDef *memberClass() { return classDef; } Protection protection() const { return prot; } Specifier virtualness() const { return virt; } @@ -74,17 +75,25 @@ class MemberDef : public Definition void setFileDec(FileDef *fd) { fileDec=fd; } void setAnchor(const char *a) { ref=a; } void setProtection(Protection p) { prot=p; } + void setBody(const QCString &b) { body=b; } FileDef *getFileDef() { return fileDef; } FileDef *getFileDec() { return fileDec; } void setMemberClass(ClassDef *cd) { classDef=cd; } bool isRelated() const { return related; } bool isStatic() const { return stat; } + bool hasDocumentation() // overrides hasDocumentation in definition.h + { return !documentation().isNull() || + !briefDescription().isNull() || + !body.isEmpty() || + Config::extractAllFlag; + } + bool detailsAreVisible() const - { return !documentation().isEmpty() || + { return !documentation().isEmpty() || !body.isEmpty() || (mtype==Enumeration && docEnumValues) || (mtype==EnumValue && !briefDescription().isEmpty()) || (!briefDescription().isEmpty() && - !briefMemDescFlag && repeatBriefFlag); + !Config::briefMemDescFlag && Config::repeatBriefFlag); } // relation to other members @@ -138,7 +147,14 @@ class MemberDef : public Definition // argument related members ArgumentList *argumentList() const { return argList; } + void setArgumentList(ArgumentList *al) + { if (argList) delete argList; + argList = al; + } ArgumentList *templateArguments() const { return tArgList; } + void setScopeTemplateArguments(ArgumentList *t); + ArgumentList *scopeTemplateArguments() const { return scopeTAL; } + QCString getScopeTemplateNameString(); // namespace related members NamespaceDef *getNamespace() { return nspace; } @@ -158,20 +174,21 @@ class MemberDef : public Definition MemberList *enumFields; // enumeration fields OutputList *enumDeclList; // stored piece of documentation for enumeration. NamespaceDef *nspace; // the namespace this member is in. - QString type; // return type - QString args; // function arguments/variable array specifiers - QString exception; // exceptions that can be thrown - QString decl; // member declaration in class - QString declFile; // file where the declaration was found + QCString type; // return type + QCString args; // function arguments/variable array specifiers + QCString exception; // exceptions that can be thrown + QCString body; // function body code + QCString decl; // member declaration in class + QCString declFile; // file where the declaration was found int declLine; // line where the declaration was found - QString def; // member definition in code (fully qualified name) - QString defFile; // file where the definition was found + QCString def; // member definition in code (fully qualified name) + QCString defFile; // file where the definition was found int defLine; // line where the definition was found - QString ref; // HTML anchor name + QCString ref; // HTML anchor name Specifier virt; // normal/virtual/pure virtual Protection prot; // protection type [Public/Protected/Private] bool related; // is this a member that is only related to a class - QString external; // anchor of a member if extracted from a tag file + QCString external; // anchor of a member if extracted from a tag file bool stat; // is it a static function? MemberType mtype; // returns the kind of member bool eUsed; // is the enumerate already placed in a list @@ -179,6 +196,7 @@ class MemberDef : public Definition bool docEnumValues; // is an enum with documented enum values. ArgumentList *argList; // argument list of this member ArgumentList *tArgList; // template argument list of function template + ArgumentList *scopeTAL; // template argument list of class template // disable copying of member defs MemberDef(const MemberDef &); diff --git a/src/memberlist.cpp b/src/memberlist.cpp index e9fa8b0..99ad00a 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -40,10 +40,10 @@ void MemberList::countDecMembers() MemberDef *md=first(); while (md) { - if ((!hideMemberFlag || md->hasDocumentation()) && - (!hideMemberFlag || !md->documentation().isEmpty() || - briefMemDescFlag || repeatBriefFlag - ) || extractAllFlag || + if ((!Config::hideMemberFlag || md->hasDocumentation()) && + (!Config::hideMemberFlag || !md->documentation().isEmpty() || + Config::briefMemDescFlag || Config::repeatBriefFlag + ) || Config::extractAllFlag || (md->isEnumerate() && md->hasDocumentedEnumValues() ) @@ -59,7 +59,7 @@ void MemberList::countDecMembers() case MemberDef::EnumValue: enumValCnt++; break; case MemberDef::Typedef: typeCnt++; break; case MemberDef::Prototype: protoCnt++; break; - case MemberDef::Define: if (extractAllFlag || md->argsString() || md->hasDocumentation() ) + case MemberDef::Define: if (Config::extractAllFlag || md->argsString() || md->hasDocumentation() ) defCnt++; break; case MemberDef::Friend: friendCnt++; break; @@ -73,18 +73,11 @@ void MemberList::countDecMembers() void MemberList::countDocMembers() { - varCnt=funcCnt=enumCnt=enumValCnt=typeCnt=protoCnt=defCnt=friendCnt; + varCnt=funcCnt=enumCnt=enumValCnt=typeCnt=protoCnt=defCnt=friendCnt=0; MemberDef *md=first(); while (md) { - //if (extractAllFlag || /*md->hasDocumentation()*/ - // !md->documentation().isEmpty() || - // (!md->briefDescription().isEmpty() && - // !briefMemDescFlag && - // repeatBriefFlag - // ) - // ) - if (extractAllFlag || md->detailsAreVisible()) + if (Config::extractAllFlag || md->detailsAreVisible()) { QRegExp r("@[0-9]+"); int dummy; diff --git a/src/membername.h b/src/membername.h index 4754fa7..c485dc8 100644 --- a/src/membername.h +++ b/src/membername.h @@ -29,7 +29,7 @@ class MemberName : public QList int compareItems(GCI item1,GCI item2); private: - QString name; + QCString name; }; class MemberNameIterator : public QListIterator @@ -62,8 +62,8 @@ struct MemberInfo MemberDef *memberDef; Protection prot; Specifier virt; - QString scopePath; - QString ambiguityResolutionScope; + QCString scopePath; + QCString ambiguityResolutionScope; }; class MemberNameInfo : public QList @@ -74,7 +74,7 @@ class MemberNameInfo : public QList const char *memberName() const { return name; } int compareItems(GCI item1,GCI item2); private: - QString name; + QCString name; }; class MemberNameInfoIterator : public QListIterator diff --git a/src/message.cpp b/src/message.cpp index 9f98107..c7b2a34 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -20,7 +20,7 @@ void msg(const char *fmt, ...) { - if (!quietFlag) + if (!Config::quietFlag) { va_list args; va_start(args, fmt); @@ -31,7 +31,7 @@ void msg(const char *fmt, ...) void warn(const char *fmt, ...) { - if (warningFlag) + if (Config::warningFlag) { va_list args; va_start(args, fmt); diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index bde86c6..2574563 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -14,6 +14,7 @@ * */ +#include "qtbc.h" #include "namespacedef.h" #include "outputlist.h" #include "util.h" @@ -60,14 +61,14 @@ void NamespaceDef::computeAnchors() void NamespaceDef::writeDocumentation(OutputList &ol) { - QString pageTitle=name()+" Namespace Reference"; + QCString pageTitle=name()+" Namespace Reference"; startFile(ol,fileName,pageTitle); startTitle(ol); //ol.docify(pageTitle); parseText(ol,theTranslator->trNamespaceReference(name())); endTitle(ol,name()); - if (genTagFile.length()>0) tagFile << "%" << name() << ":\n"; + if (Config::genTagFile.length()>0) tagFile << "%" << name() << ":\n"; OutputList briefOutput(&ol); if (briefDescription()) @@ -103,7 +104,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) ol.startMemberList(); found=TRUE; } - QString clName=cd->name().copy(); + QCString clName=cd->name().copy(); if (clName.left(name().length()+2)==name()+"::") { clName = clName.right(clName.length()-name().length()-2); @@ -225,7 +226,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) ol.startGroupHeader(); parseText(ol,theTranslator->trAuthor()); ol.endGroupHeader(); - parseText(ol,theTranslator->trGeneratedAutomatically(projectName)); + parseText(ol,theTranslator->trGeneratedAutomatically(Config::projectName)); ol.enableAll(); endFile(ol); } diff --git a/src/namespacedef.h b/src/namespacedef.h index f888f43..ca25700 100644 --- a/src/namespacedef.h +++ b/src/namespacedef.h @@ -17,7 +17,7 @@ #ifndef NAMESPACEDEF_H #define NAMESPACEDEF_H -#include +#include "qtbc.h" #include #include #include "definition.h" @@ -33,8 +33,8 @@ class NamespaceDef : public Definition public: NamespaceDef(const char *name,const char *ref=0); ~NamespaceDef(); - //QString namespaceFile() const { return fileName; } - QString getOutputFileBase() const { return fileName; } + //QCString namespaceFile() const { return fileName; } + QCString getOutputFileBase() const { return fileName; } void insertUsedFile(const char *fname); void writeDocumentation(OutputList &ol); void insertClass(ClassDef *cd); @@ -42,10 +42,20 @@ class NamespaceDef : public Definition void computeAnchors(); int countMembers(); const char *getReference() { return reference; } + bool isVisible() + { + return !getReference() && hasDocumentation() && + !name().isEmpty() && name().at(0)!='@'; + } + bool isVisibleExt() + { + return (getReference() || hasDocumentation()) && + !name().isEmpty() && name().at(0)!='@'; + } private: - QString reference; - QString fileName; + QCString reference; + QCString fileName; QStrList files; ClassList *classList; MemberList *memList; diff --git a/src/outputgen.cpp b/src/outputgen.cpp index ca07302..3496aad 100644 --- a/src/outputgen.cpp +++ b/src/outputgen.cpp @@ -15,8 +15,9 @@ */ #include + +#include "qtbc.h" #include "outputgen.h" -#include #include "message.h" OutputGenerator::OutputGenerator() @@ -38,7 +39,7 @@ OutputGenerator::~OutputGenerator() void OutputGenerator::startPlainFile(const char *name) { //printf("startPlainFile(%s)\n",name); - QString fileName=dir+"/"+name; + QCString fileName=dir+"/"+name; file = new QFile(fileName); if (!file) { @@ -66,9 +67,9 @@ void OutputGenerator::endPlainFile() t.setDevice(&b); } -QString OutputGenerator::getContents() const +QCString OutputGenerator::getContents() const { - QString s; + QCString s; s.resize(a.size()+1); memcpy(s.data(),a.data(),a.size()); s.at(a.size())='\0'; diff --git a/src/outputgen.h b/src/outputgen.h index 5b9f981..7411d5c 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -17,7 +17,7 @@ #ifndef OUTPUTGEN_H #define OUTPUTGEN_H -#include +#include "qtbc.h" #include #include #include @@ -88,6 +88,8 @@ class OutputGenerator virtual void endMemberSections() = 0; virtual void startMemberHeader() = 0; virtual void endMemberHeader() = 0; + virtual void startMemberSubtitle() = 0; + virtual void endMemberSubtitle() = 0; virtual void startMemberList() = 0; virtual void endMemberList() = 0; virtual void startMemberItem() = 0; @@ -168,7 +170,7 @@ class OutputGenerator b.open(IO_WriteOnly); t.setDevice(&b); } void startPlainFile(const char *name); void endPlainFile(); - QString getContents() const; + QCString getContents() const; bool isEnabled() const { return active; } protected: QTextStream fs; @@ -176,7 +178,7 @@ class OutputGenerator QBuffer b; QTextStream t; QFile *file; - QString dir; + QCString dir; bool active; private: diff --git a/src/outputlist.h b/src/outputlist.h index 6f73271..8f66f63 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -17,8 +17,8 @@ #ifndef OUTPUTLIST_H #define OUTPUTLIST_H +#include "qtbc.h" #include -#include #include "index.h" // for IndexSections #include "outputgen.h" @@ -137,6 +137,10 @@ class OutputList { forall(&OutputGenerator::startMemberHeader); } void endMemberHeader() { forall(&OutputGenerator::endMemberHeader); } + void startMemberSubtitle() + { forall(&OutputGenerator::startMemberSubtitle); } + void endMemberSubtitle() + { forall(&OutputGenerator::endMemberSubtitle); } void startMemberList() { forall(&OutputGenerator::startMemberList); } void endMemberList() diff --git a/src/pre.h b/src/pre.h index 5028929..31badb1 100644 --- a/src/pre.h +++ b/src/pre.h @@ -17,23 +17,10 @@ #ifndef PRE_H #define PRE_H +#include "qtbc.h" #include -#include #include -#if 0 -class Define -{ - public: - Define(const char *n) { name=n; } - ~Define(); - - private: - QString name; - QStrList args; -}; -#endif - void initPreprocessor(); void addSearchDir(const char *dir); void preprocessFile(const char *fileName,BufStr &output); diff --git a/src/pre.l b/src/pre.l index bc74cf1..6f5193a 100644 --- a/src/pre.l +++ b/src/pre.l @@ -25,8 +25,8 @@ #include #include +#include "qtbc.h" #include -#include #include #include #include @@ -55,7 +55,7 @@ struct FileState int lineNr; FILE *filePtr; YY_BUFFER_STATE bufState; - QString fileName; + QCString fileName; }; /* ----------------------------------------------------------------- @@ -64,30 +64,30 @@ struct FileState */ static int yyLineNr = 1; -static QString yyFileName; +static QCString yyFileName; static int ifcount = 0; static QStrList *pathList = 0; static QStack includeStack; static QDict *argDict; -static int defArgs = 0; -static QString defName; -static QString defText; -static QString defArgsStr; +static int defArgs = -1; +static QCString defName; +static QCString defText; +static QCString defArgsStr; static bool defVarArgs; static int level; static int lastCContext; static int lastCPPContext; static QArray levelGuard; -static QString guardExpr; +static QCString guardExpr; static BufStr *outputBuf; -//static DefineCache *fileDefineCache; static int roundCount; -//static const Define *expandDefine; static bool quoteArg; static DefineDict *fileDefineDict; static DefineDict *expandedDict; static int findDefArgContext; +static QCString lastGuardName; + static void incrLevel() { @@ -142,14 +142,14 @@ static FILE *findFile(const char *fileName) char *s=pathList->first(); while (s) { - QString absName=(QString)s+"/"+fileName; + QCString absName=(QCString)s+"/"+fileName; QFileInfo fi(absName); if (fi.exists()) { FILE *f; - if (!inputFilter.isEmpty()) + if (!Config::inputFilter.isEmpty()) { - QString cmd = inputFilter+" "+absName; + QCString cmd = Config::inputFilter+" "+absName; f=popen(cmd,"r"); if (!f) warn("Warning: could not execute filter %s\n",cmd.data()); } @@ -171,14 +171,14 @@ static FILE *findFile(const char *fileName) } -static int getNextChar(const QString &expr,QString *rest,uint &pos); -static int getCurrentChar(const QString &expr,QString *rest,uint pos); -static void unputChar(const QString &expr,QString *rest,uint &pos,char c); -static void expandExpression(QString &expr,QString *rest,int pos); +static int getNextChar(const QCString &expr,QCString *rest,uint &pos); +static int getCurrentChar(const QCString &expr,QCString *rest,uint pos); +static void unputChar(const QCString &expr,QCString *rest,uint &pos,char c); +static void expandExpression(QCString &expr,QCString *rest,int pos); -static QString stringize(const QString &s) +static QCString stringize(const QCString &s) { - QString result; + QCString result; uint i=0; bool inString=FALSE; bool inChar=FALSE; @@ -254,7 +254,7 @@ static QString stringize(const QString &s) * marker (@-) then this is removed (before the concatenated macro name * may be expanded again. */ -static void processConcatOperators(QString &expr) +static void processConcatOperators(QCString &expr) { QRegExp r("[ \\t\\n]*##[ \\t\\n]*"); int l,n,i=0; @@ -286,7 +286,7 @@ static void processConcatOperators(QString &expr) * The replacement string will be returned in \a result and the * length of the (unexpanded) argument list is stored in \a len. */ -static bool replaceFunctionMacro(const QString &expr,QString *rest,int pos,int &len,const Define *def,QString &result) +static bool replaceFunctionMacro(const QCString &expr,QCString *rest,int pos,int &len,const Define *def,QCString &result) { //printf("replaceFunctionMacro(expr=%s,rest=%s,pos=%d,def=%s) level=%d\n",expr.data(),rest ? rest->data() : 0,pos,def->name.data(),level); //bool replaced=FALSE; @@ -312,101 +312,113 @@ static bool replaceFunctionMacro(const QString &expr,QString *rest,int pos,int & //while (j argTable; // list of arguments + QDict argTable; // list of arguments argTable.setAutoDelete(TRUE); - QString arg; + QCString arg; int argCount=0; bool done=FALSE; + // FASE 1: read the macro arguments - while ((argCountnargs || def->varArgs) && - ((cc=getNextChar(expr,rest,j))!=EOF) && !done - ) + if (def->nargs==0) + { + while ((cc=getNextChar(expr,rest,j))!=EOF) + { + char c = (char)cc; + if (c==')') break; + } + } + else { - char c=(char)cc; - if (c=='(') // argument is a function => search for matching ) + while ((argCountnargs || def->varArgs) && + ((cc=getNextChar(expr,rest,j))!=EOF) && !done + ) { - int level=1; - arg+=c; - char term='\0'; - while ((cc=getNextChar(expr,rest,j))!=EOF) + char c=(char)cc; + if (c=='(') // argument is a function => search for matching ) { - char c=(char)cc; - if (c=='\'' || c=='\"') // skip ('s and )'s inside strings + int level=1; + arg+=c; + char term='\0'; + while ((cc=getNextChar(expr,rest,j))!=EOF) { - if (term!='\0') - { - if (c==term && expr.at(j-2)!='\\') term='\0'; - } - else - { - term=c; + char c=(char)cc; + if (c=='\'' || c=='\"') // skip ('s and )'s inside strings + { + if (term!='\0') + { + if (c==term && expr.at(j-2)!='\\') term='\0'; + } + else + { + term=c; + } + } + if (term=='\0' && c==')') + { + level--; + arg+=c; + if (level==0) break; } + else if (term=='\0' && c=='(') + { + level++; + arg+=c; + } + else + arg+=c; } - if (term=='\0' && c==')') + } + else if (c==')' || c==',') // last or next argument found + { + if (c==',' && argCount==def->nargs-1 && def->varArgs) { - level--; - arg+=c; - if (level==0) break; + arg=arg.stripWhiteSpace(); + arg+=','; } - else if (term=='\0' && c=='(') + else { - level++; - arg+=c; + QCString argKey; + argKey.sprintf("@%d",argCount++); // key name + arg=arg.stripWhiteSpace(); + // add argument to the lookup table + argTable.insert(argKey, new QCString(arg)); + arg.resize(0); + if (c==')') // end of the argument list + { + done=TRUE; + } } - else - arg+=c; - } - } - else if (c==')' || c==',') // last or next argument found - { - if (c==',' && argCount==def->nargs-1 && def->varArgs) - { - arg=arg.stripWhiteSpace(); - arg+=','; - } - else + } + else if (c=='\"') // append literal strings { - QString argKey; - argKey.sprintf("@%d",argCount++); // key name - arg=arg.stripWhiteSpace(); - // add argument to the lookup table - argTable.insert(argKey, new QString(arg)); - arg.resize(0); - if (c==')') // end of the argument list + arg+=c; + char pc=c; + bool found=FALSE; + while (!found && (cc=getNextChar(expr,rest,j))!=EOF) { - done=TRUE; + found = pc!='\\' && cc=='"'; + c=(char)cc; + pc=c; + arg+=c; } } - } - else if (c=='\"') // append literal strings - { - arg+=c; - char pc=c; - bool found=FALSE; - while (!found && (cc=getNextChar(expr,rest,j))!=EOF) + else if (c=='\'') // append literal characters { - found = pc!='\\' && cc=='"'; - c=(char)cc; - pc=c; arg+=c; - } - } - else if (c=='\'') // append literal characters - { - arg+=c; - char pc=c; - bool found=FALSE; - while (!found && (cc=getNextChar(expr,rest,j))!=EOF) + char pc=c; + bool found=FALSE; + while (!found && (cc=getNextChar(expr,rest,j))!=EOF) + { + found = pc!='\\' && cc=='\''; + c=(char)cc; + pc=c; + arg+=c; + } + } + else // append other characters { - found = pc!='\\' && cc=='\''; - c=(char)cc; - pc=c; arg+=c; } - } - else // append other characters - { - arg+=c; } } @@ -416,8 +428,8 @@ static bool replaceFunctionMacro(const QString &expr,QString *rest,int pos,int & { uint k=0; // substitution of all formal arguments - QString resExpr; - const QString d=def->definition.stripWhiteSpace(); + QCString resExpr; + const QCString d=def->definition.stripWhiteSpace(); bool inString=FALSE; while (k read the argument number { - QString key="@"; - QString *subst=0; + QCString key="@"; + QCString *subst=0; bool hash=FALSE; int l=k-1; // search for ## backward @@ -457,7 +469,7 @@ static bool replaceFunctionMacro(const QString &expr,QString *rest,int pos,int & //printf("request key %s result %s\n",key.data(),args[key]->data()); if (key.length()>1 && (subst=argTable[key])) { - QString substArg=*subst; + QCString substArg=*subst; // only if no ## operator is before or after the argument // marker we do macro expansion. if (!hash) expandExpression(substArg,0,0); @@ -506,7 +518,7 @@ static bool replaceFunctionMacro(const QString &expr,QString *rest,int pos,int & * The position of the identifier is returned (or -1 if nothing is found) * and \a l is its length. Any quoted strings are skipping during the search. */ -static int getNextId(const QString &expr,int p,int *l) +static int getNextId(const QCString &expr,int p,int *l) { int n; while (p<(int)expr.length()) @@ -541,11 +553,11 @@ static int getNextId(const QString &expr,int p,int *l) * If \a expandAll is \c TRUE then all macros in the expression are * expanded, otherwise only the first is expanded. */ -static void expandExpression(QString &expr,QString *rest,int pos) +static void expandExpression(QCString &expr,QCString *rest,int pos) { //printf("expandExpression(%s,%s)\n",expr.data(),rest ? rest->data() : 0); - QString macroName; - QString expMacro; + QCString macroName; + QCString expMacro; int i=pos,l,p,len; while ((p=getNextId(expr,i,&l))!=-1) // search for an macro name { @@ -558,7 +570,7 @@ static void expandExpression(QString &expr,QString *rest,int pos) { Define *def=isDefined(macroName); //printf("name is not an expanded macro def=%s\n",def ? def->name.data() : 0); - if (def && def->nargs==0) // simple macro + if (def && def->nargs==-1) // simple macro { // substitute the definition of the macro expMacro=def->definition.stripWhiteSpace(); @@ -566,7 +578,7 @@ static void expandExpression(QString &expr,QString *rest,int pos) len=l; //printf("simple macro expansion=`%s'->`%s'\n",macroName.data(),expMacro.data()); } - else if (def && def->nargs>0) // function macro + else if (def && def->nargs>=0) // function macro { replaced=replaceFunctionMacro(expr,rest,p+l,len,def,expMacro); len+=l; @@ -575,8 +587,8 @@ static void expandExpression(QString &expr,QString *rest,int pos) if (replaced) // expand the macro and rescan the expression { //printf("replacing `%s'->`%s'\n",expr.mid(p,len).data(),expMacro.data()); - QString resultExpr=expMacro; - QString restExpr=expr.right(expr.length()-len-p); + QCString resultExpr=expMacro; + QCString restExpr=expr.right(expr.length()-len-p); processConcatOperators(resultExpr); expandedDict->insert(macroName,def); expandExpression(resultExpr,&restExpr,0); @@ -612,13 +624,13 @@ static void expandExpression(QString &expr,QString *rest,int pos) * \par assumption: * \a s only contains pairs of @@'s. */ -QString removeIdsAndMarkers(const char *s) +QCString removeIdsAndMarkers(const char *s) { //printf("removeIdsAndMarkers(%s)\n",s); const char *p=s; char c; bool inNum=FALSE; - QString result; + QCString result; if (p) { while ((c=*p)) @@ -659,11 +671,11 @@ QString removeIdsAndMarkers(const char *s) * \par assumption: * \a s only contains pairs of @@'s */ -QString removeMarkers(const char *s) +QCString removeMarkers(const char *s) { const char *p=s; char c; - QString result; + QCString result; if (p) { while ((c=*p)) @@ -690,9 +702,9 @@ QString removeMarkers(const char *s) * If needed the function may read additional characters from the input. */ -bool computeExpression(const QString &expr) +bool computeExpression(const QCString &expr) { - QString e=expr; + QCString e=expr; expandExpression(e,0,0); e = removeIdsAndMarkers(e); if (e.length()==0) return FALSE; @@ -704,9 +716,9 @@ bool computeExpression(const QString &expr) * If needed the function may read additional characters from the input */ -QString expandMacro(const QString &name) +QCString expandMacro(const QCString &name) { - QString n=name; + QCString n=name; expandExpression(n,0,0); n=removeMarkers(n); //printf("expandMacro `%s'->`%s'\n",name.data(),n.data()); @@ -761,9 +773,9 @@ static void outputArray(const char *a,int len) if (includeStack.isEmpty()) outputBuf->addArray(a,len); } -static void readIncludeFile(const QString &inc) +static void readIncludeFile(const QCString &inc) { - if (!searchIncludeFlag) return; // do not read include files + if (!Config::searchIncludeFlag) return; // do not read include files uint i=0; // find the start of the include file name while (is) // valid include file name found { - QString incFileName=inc.mid(s,i-s).stripWhiteSpace(); + QCString incFileName=inc.mid(s,i-s).stripWhiteSpace(); FILE *f; - QString oldFileName=yyFileName.copy(); + QCString oldFileName=yyFileName.copy(); if ((f=findFile(incFileName))) // see if the include file can be found { #if SHOW_INCLUDES @@ -815,6 +827,8 @@ ID [a-z_A-Z][a-z_A-Z0-9]* B [ \t] BN [ \t\r\n] +%option noyywrap + %x Start %x Command %x SkipCommand @@ -822,7 +836,7 @@ BN [ \t\r\n] %x CopyLine %x Include %x IncludeID -%x DefineName +%x DefName %x DefineArg %x DefineText %x SkipCPPBlock @@ -871,16 +885,27 @@ BN [ \t\r\n] } */ {ID}/{BN}*"(" { + Define *def; + //printf("Search for define %s\n",yytext); if (includeStack.isEmpty() && - macroExpansionFlag && + Config::macroExpansionFlag && /* (expandDefine=fileDefineCache->findDefine(yyFileName,yytext)) */ - fileDefineDict->find(yytext) + (def=fileDefineDict->find(yytext)) ) { + //printf("Found it!\n"); roundCount=0; defArgsStr=yytext; - findDefArgContext = CopyLine; - BEGIN(FindDefineArgs); + if (def->nargs==-1) // no function macro + { + QCString result = expandMacro(defArgsStr); + outputArray(result,result.length()); + } + else // zero or more arguments + { + findDefArgContext = CopyLine; + BEGIN(FindDefineArgs); + } } else { @@ -889,14 +914,16 @@ BN [ \t\r\n] } {ID} { Define *def=0; + //printf("Search for define %s\n",yytext); if (includeStack.isEmpty() && - macroExpansionFlag && + Config::macroExpansionFlag && (def=fileDefineDict->find(yytext)) && - def->nargs==0 + def->nargs==-1 ) { - QString name=yytext; - QString result=expandMacro(name); + //printf("Found it!\n"); + QCString name=yytext; + QCString result=expandMacro(name); outputArray(result,result.length()); } else @@ -921,7 +948,7 @@ BN [ \t\r\n] roundCount--; if (roundCount==0) { - QString result=expandMacro(defArgsStr); + QCString result=expandMacro(defArgsStr); if (findDefArgContext==CopyLine) { outputArray(result,result.length()); @@ -964,15 +991,15 @@ BN [ \t\r\n] defArgsStr+=*yytext; } "include"{B}*/{ID} { - if (macroExpansionFlag) + if (Config::macroExpansionFlag) BEGIN(IncludeID); } "include"{B}*[<"] { BEGIN(Include); } "define"{B}+ { - //printf("!!!DefineName\n"); - BEGIN(DefineName); + //printf("!!!DefName\n"); + BEGIN(DefName); } "ifdef"/{B}*"(" { incrLevel(); @@ -1094,6 +1121,7 @@ BN [ \t\r\n] guardExpr+=" 1L "; else guardExpr+=" 0L "; + lastGuardName=yytext; BEGIN(Guard); } {ID} { @@ -1101,6 +1129,7 @@ BN [ \t\r\n] guardExpr+=" 1L "; else guardExpr+=" 0L "; + lastGuardName.resize(0); } \n { // should not happen, handle anyway ifcount=0; @@ -1133,11 +1162,12 @@ BN [ \t\r\n] if (!otherCaseDone()) { guardExpr.resize(0); + lastGuardName.resize(0); BEGIN(Guard); } else { - BEGIN(Start); + BEGIN(SkipCPPBlock); } } } @@ -1184,9 +1214,9 @@ BN [ \t\r\n] BEGIN(Start); } [^\">\n]+[\">] { - QString incName=yytext; + QCString incName=yytext; //int l=incName.length(); - //QString incFileName=incName.left(l-1); + //QCString incFileName=incName.left(l-1); //if (fileDefineCache->fileCached(incFileName)) //{ // printf("file already cached!\n"); @@ -1197,7 +1227,7 @@ BN [ \t\r\n] BEGIN(Start); } -{ID}/"(" { +{ID}/"(" { //printf("Define() `%s'\n",yytext); argDict = new QDict(31); argDict->setAutoDelete(TRUE); @@ -1208,33 +1238,80 @@ BN [ \t\r\n] defVarArgs = FALSE; BEGIN(DefineArg); } -{ID}/{B}* { +{ID}/{B}* { //printf("Define `%s'\n",yytext); argDict = 0; - defArgs = 0; + defArgs = -1; defArgsStr.resize(0); defText.resize(0); defName = yytext; defVarArgs = FALSE; - QString tmp=(QString)"#define "+defName+defArgsStr; + QCString tmp=(QCString)"#define "+defName+defArgsStr; outputArray(tmp.data(),tmp.length()); quoteArg=FALSE; BEGIN(DefineText); } +{ID}/{B}*"\n" { + argDict = 0; + defArgs = -1; + defName = yytext; + defArgsStr.resize(0); + defText.resize(0); + defVarArgs = FALSE; + if ( defName!=lastGuardName ) + { // define may appear in the output + QCString tmp=(QCString)"#define "+defName+defArgsStr; + outputArray(tmp.data(),tmp.length()); + quoteArg=FALSE; + BEGIN(DefineText); + } + else // define is a guard => hide + { + //printf("Found a guard %s\n",yytext); + Define *def=0; + //if (includeStack.isEmpty()) + //{ + // addDefine(); + //} + if (!Config::onlyPredefinedFlag && (def=fileDefineDict->find(defName))==0) + { + fileDefineDict->insert(defName,newDefine()); + } + else if (def)// name already exists + { + if (def->undef) // undefined name + { + def->undef = FALSE; + def->name = defName; + def->definition = defText.stripWhiteSpace(); + def->nargs = defArgs; + def->fileName = yyFileName; + def->lineNr = yyLineNr; + } + else + { + //printf("Error: define %s is defined more than once!\n",defName.data()); + } + } + outputChar('\n'); + lastGuardName.resize(0); + BEGIN(Start); + } + } ","{B}* { defArgsStr+=yytext; } "("{B}* { defArgsStr+=yytext; } ")"{B}* { defArgsStr+=yytext; - QString tmp=(QString)"#define "+defName+defArgsStr; + QCString tmp=(QCString)"#define "+defName+defArgsStr; outputArray(tmp.data(),tmp.length()); quoteArg=FALSE; BEGIN(DefineText); } {ID}("..."?) { //printf("Define addArg(%s)\n",yytext); - QString argName=yytext; + QCString argName=yytext; defVarArgs = yytext[yyleng-1]=='.'; - if (defVarArgs) + if (defVarArgs) // strip ellipsis argName=argName.left(argName.length()-3); defArgsStr+=yytext; argDict->insert(argName,new int(defArgs)); @@ -1301,14 +1378,6 @@ BN [ \t\r\n] quoteArg=TRUE; } {ID} { - //bool quote=FALSE; - //char *p=yytext; - //if (p[0]=='#') - //{ - // p++; - // quote=TRUE; - // defText+="\""; - //} if (quoteArg) { defText+="\""; @@ -1320,7 +1389,7 @@ BN [ \t\r\n] { if (!quoteArg) defText+=' '; defText+='@'; - QString numStr; + QCString numStr; numStr.setNum(*n); defText+=numStr; if (!quoteArg) defText+=' '; @@ -1348,16 +1417,14 @@ BN [ \t\r\n] outputChar('\n'); Define *def=0; //printf("Define name=`%s' text=`%s'\n",defName.data(),defText.data()); - if (includeStack.isEmpty()) addDefine(); - if (!onlyPredefinedFlag && (def=fileDefineDict->find(defName))==0) + if (includeStack.isEmpty()) + { + addDefine(); + } + if (!Config::onlyPredefinedFlag && (def=fileDefineDict->find(defName))==0) { fileDefineDict->insert(defName,newDefine()); } - //if ((def=fileDefineCache->findDefine(yyFileName,defName))==0) - //{ - // printf("define is not found\n"); - // fileDefineCache->insertDefine(yyFileName,defName,newDefine()); - //} else if (def)// name already exists { //printf("define found\n"); @@ -1377,6 +1444,7 @@ BN [ \t\r\n] } delete argDict; yyLineNr++; + lastGuardName.resize(0); BEGIN(Start); } {B}* { defText += ' '; } @@ -1411,7 +1479,7 @@ BN [ \t\r\n] { FileState *fs=includeStack.pop(); //fileDefineCache->merge(yyFileName,fs->fileName); - if (inputFilter.isEmpty()) + if (Config::inputFilter.isEmpty()) fclose(fs->filePtr); else pclose(fs->filePtr); @@ -1447,7 +1515,7 @@ BN [ \t\r\n] /*@ ---------------------------------------------------------------------------- */ -static int getNextChar(const QString &expr,QString *rest,uint &pos) +static int getNextChar(const QCString &expr,QCString *rest,uint &pos) { //printf("getNextChar(%s,%s,%d)\n",expr.data(),rest ? rest->data() : 0,pos); if (posdata() : 0,pos); if (posdata() : 0,pos,c); if (posclear(); // add predefined macros - char *defStr = predefined.first(); + char *defStr = Config::predefined.first(); while (defStr) { - QString ds = defStr; - int i; - if ((i=ds.find('='))==-1) + QCString ds = defStr; + int i_equals=ds.find('='); + int i_obrace=ds.find('('); + int i_cbrace=ds.find(')'); + + if (i_obrace==0) continue; // no define name + + if (i_obrace0) - { - Define *def = new Define; - def->name = ds; - def->definition = "1"; - def->nargs = 0; - fileDefineDict->insert(ds,def); + QRegExp reId("[a-z_A-Z][a-z_A-Z0-9]*"); // regexp matching an id + QDict argDict(17); + argDict.setAutoDelete(TRUE); + int i=i_obrace+1,p,l,count=0; + // gather the formal arguments in a dictionary + while (ii) definition+=tmp.mid(i,p-i); + int *argIndex; + if ((argIndex=argDict[tmp.mid(p,l)])!=0) + { + QCString marker; + marker.sprintf(" @%d ",*argIndex); + definition+=marker; + } + else + { + definition+=tmp.mid(p,l); + } + i=p+l; } + if (i<(int)tmp.length()) definition+=tmp.mid(i,tmp.length()-i); + + // add define definition to the dictionary of defines for this file + Define *def = new Define; + def->name = ds.left(i_obrace); + def->definition = definition; + def->nargs = count; + fileDefineDict->insert(def->name,def); + + //printf("#define `%s' `%s' #nargs=%d\n", + // def->name.data(),def->definition.data(),def->nargs); } - else + else if ((i_obrace==-1 || i_obrace>i_equals) && + (i_cbrace==-1 || i_cbrace>i_equals) && + ds.length()>0 && (int)ds.length()>i_equals + ) // predefined non-function macro definition { - if (i>0 && (int)ds.length()>i) + Define *def = new Define; + if (i_equals==-1) // simple define without argument + { + def->name = ds; + def->definition = "1"; // substitute occurrences by 1 (true) + } + else // simple define with argument { - Define *def = new Define; - def->name = ds.left(i); - def->definition = ds.right(ds.length()-i-1); - def->nargs = 0; - fileDefineDict->insert(ds.left(i),def); - } + def->name = ds.left(i_equals); + def->definition = ds.right(ds.length()-i_equals-1); + } + def->nargs = -1; + fileDefineDict->insert(def->name,def); + + //printf("#define `%s' `%s' #nargs=%d\n", + // def->name.data(),def->definition.data(),def->nargs); } - defStr=predefined.next(); + + defStr=Config::predefined.next(); } - if (inputFilter.isEmpty()) + if (Config::inputFilter.isEmpty()) { preYYin = fopen(fileName,"r"); if (!preYYin) @@ -1595,7 +1718,7 @@ void preprocessFile(const char *fileName,BufStr &output) } else { - QString cmd = inputFilter+" "+fileName; + QCString cmd = Config::inputFilter+" "+fileName; preYYin = popen(cmd,"r"); if (!preYYin) { @@ -1605,10 +1728,15 @@ void preprocessFile(const char *fileName,BufStr &output) } yyLineNr = 1; level = 0; + ifcount = 0; yyFileName = fileName; BEGIN( Start ); + + lastGuardName.resize(0); + guardExpr.resize(0); + preYYlex(); - if (inputFilter.isEmpty()) + if (Config::inputFilter.isEmpty()) fclose(preYYin); else pclose(preYYin); @@ -1629,8 +1757,7 @@ void preprocessFile(const char *fileName,BufStr &output) #endif } - extern "C" { // some bogus code to keep the compiler happy - int preYYwrap() { return 1 ; } +// int preYYwrap() { return 1 ; } void preYYdummy() { yy_flex_realloc(0,0); } } diff --git a/src/qtbc.h b/src/qtbc.h new file mode 100644 index 0000000..2049fdd --- /dev/null +++ b/src/qtbc.h @@ -0,0 +1,42 @@ +/****************************************************************************** + * + * $Id$ + * + * Copyright (C) 1997-1999 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * All output generated with Doxygen is not covered by this license. + * + */ + +#ifndef QTBC_H +#define QTBC_H + +/*! This file contains some hacks to make Doxygen work with + * Qt version 2.00 and Qt version 1.xx + */ + +#include + +#if QT_VERSION >= 200 + +#define GCI QCollection::Item + +#include +#include +inline QCString convertToQCString(const QString &s) { return s.local8Bit(); } + +#else /* QT_VERSION < 200 */ + +#include +#define QCString QString +inline QCString convertToQCString(const QCString &s) { return s; } + +#endif + +#endif diff --git a/src/scanner.h b/src/scanner.h index acebd5f..1e6bad7 100644 --- a/src/scanner.h +++ b/src/scanner.h @@ -17,9 +17,9 @@ #ifndef SCANNER_H #define SCANNER_H +#include "qtbc.h" #include #include -#include #include "entry.h" #include "code.h" @@ -28,8 +28,8 @@ class OutputList; extern void parseMain(Entry *); extern void parseDoc(OutputList &ol,const char *clName, const char *memName, - const QString &docString); -extern void parseExample(OutputList &ol,const QString &docString, + const QCString &docString); +extern void parseExample(OutputList &ol,const QCString &docString, const char *fileName); -extern void parseText(OutputList &ol,const QString &txtString); +extern void parseText(OutputList &ol,const QCString &txtString); #endif diff --git a/src/scanner.l b/src/scanner.l index 9737ff1..9c7b477 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -25,8 +25,8 @@ #include #include +#include "qtbc.h" #include -#include #include #include @@ -51,14 +51,14 @@ * statics */ static bool insideArgumentList; -static QString className; -static QString memberName; -static QString refName; +static QCString className; +static QCString memberName; +static QCString refName; static OutputList * outDoc; -static QString code; -static QString linkRef; -static QString linkText; -static QString codeBlock; +static QCString code; +static QCString linkRef; +static QCString linkText; +static QCString codeBlock; static const char * inputString; static int inputPosition; static int lastContext; @@ -78,6 +78,7 @@ static int lastGroupContext; static int lastFormulaContext; static int lastAnchorContext; static int nextDefContext; +static int overloadContext; static Protection protection; static Protection baseProt; static int bracketCount = 0 ; @@ -87,6 +88,8 @@ static int ifCount = 0 ; static Entry* current_root = 0 ; static Entry* global_root = 0 ; static Entry* current = 0 ; +static Entry* previous = 0 ; +static Entry* tempEntry = 0 ; static int yyLineNr = 0 ; static int anonCount = 0 ; static char yyFileName[2048] ; @@ -97,10 +100,10 @@ static bool removeSlashes; static Specifier virt; static Specifier baseVirt; static bool exampleDoc; -static QString exampleName; -static QString htmlUrl,htmlText; -static QString currentIncludeFile; -static QString msType,msName,msArgs; +static QCString exampleName; +static QCString htmlUrl,htmlText; +static QCString currentIncludeFile; +static QCString msType,msName,msArgs; static int includeFileOffset = 0; static int includeFileLength = 0; static bool firstLine; @@ -119,16 +122,16 @@ static bool firstSeeArg; static bool javaDocSee; static char afterDocTerminator; static int tmpDocType; -static QString sectionLabel; -static QString sectionTitle; +static QCString sectionLabel; +static QCString sectionTitle; static SectionInfo::SectionType sectionType; -static QString funcPtrType; -static QString templateStr; -static QString baseName; -static QString *specName; -static QString formulaText; -static QString sectionRef; +static QCString funcPtrType; +static QCString templateStr; +static QCString baseName; +static QCString *specName; +static QCString formulaText; +static QCString sectionRef; // state variable for reading the argument list of a function static int argRoundCount; @@ -136,7 +139,7 @@ static int argSharpCount; static int currentArgumentContext; static int lastCopyArgStringContext; static int lastCopyArgContext; -static QString *copyArgString; +static QCString *copyArgString; @@ -404,9 +407,9 @@ static void verbIncludeFile(OutputList &ol,const char *name) } -static QString stripQuotes(const char *s) +static QCString stripQuotes(const char *s) { - QString name; + QCString name; if (s==0 || *s==0) return name; name=s; if (name.at(0)=='"' && name.at(name.length()-1)=='"') @@ -416,9 +419,9 @@ static QString stripQuotes(const char *s) return name; } -static QString stripKnownExtensions(const char *text) +static QCString stripKnownExtensions(const char *text) { - QString result=text; + QCString result=text; if (result.right(4)==".tex") result=result.left(result.length()-4); else if (result.right(5)==".html") result=result.left(result.length()-5); //printf("%s stripKnowExtensions(%s)\n",result.data(),text); @@ -430,7 +433,7 @@ static void skipLine(OutputList &ol,const char *key) bool found=FALSE; while (!found) { - QString s; + QCString s; char c; while ( includeFileOffsetfileName.data()); sectionDict.insert(sectionLabel,si); - current->anchors->append(new QString(sectionLabel)); + current->anchors->append(new QCString(sectionLabel)); } else { @@ -548,10 +552,10 @@ static void addSection() // Adds a formula text to the list/dictionary of formulas if it was // not already added. Returns the label of the formula. -static QString addFormula() +static QCString addFormula() { - QString formLabel; - QString fText=formulaText.simplifyWhiteSpace(); + QCString formLabel; + QCString fText=formulaText.simplifyWhiteSpace(); Formula *f=0; if ((f=formulaDict[fText])==0) { @@ -568,8 +572,17 @@ static QString addFormula() return formLabel; } -/* ----------------------------------------------------------------- - */ +static bool nameIsOperator(QCString &name) +{ + return name.right(8)=="operator" && + (name.length()==8 || !isId(name.at(name.length()-9))); +} + +/* ----------------------------------------------------------------- */ + +static void addToBody(const char *text); +static void addToBodyCond(const char *text); +/* ----------------------------------------------------------------- */ #undef YY_INPUT #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size); @@ -641,6 +654,8 @@ TT [tT][tT] UL [uU][lL] VAR [vV][aA][rR] +%option noyywrap + %x Define %x DefineArg %x DefineEnd @@ -664,13 +679,15 @@ VAR [vV][aA][rR] %x NameSpaceDocArg1 %x SkipCurly %x SkipCurlyCpp +%x SkipCurlyEndDoc %x SkipString %x SkipInits %x SkipCPP %x SkipCPPBlock %x SkipComment %x SkipCxxComment -%x SkipBlock +%x SkipCurlyBlock +%x SkipRoundBlock %x SkipCode %x Sharp %x SkipSharp @@ -688,6 +705,7 @@ VAR [vV][aA][rR] %x ClassDocFunc %x ClassDocFuncPtr %x ClassDocFuncQual +%x ClassDocFuncSkipLine %x ClassDocFuncExc %x ClassDocDefine %x ClassDocRelates @@ -818,7 +836,7 @@ VAR [vV][aA][rR] "&"[AEIOUaeiou]"circ;" { outDoc->writeCirc(yytext[1]); } "&"[ANOano]"tilde;" { outDoc->writeTilde(yytext[1]); } "$("[a-z_A-Z]+")" { - QString envvar=&yytext[2]; + QCString envvar=&yytext[2]; envvar=envvar.left(envvar.length()-1); outDoc->docify(getenv(envvar)); } @@ -879,7 +897,7 @@ VAR [vV][aA][rR] outDoc->codify(c); } ("\\"|"@")"internal"/{BN} { - if (!internalDocsFlag) + if (!Config::internalDocsFlag) { outDoc->newParagraph(); scanString(theTranslator->trForInternalUseOnly()+"\n"); @@ -921,7 +939,7 @@ VAR [vV][aA][rR] Formula *formula=formulaNameDict[yytext]; if (formula) { - QString formName; + QCString formName; formName.sprintf("form-%d.gif",formula->getId()); outDoc->writeFormula(formName,formula->getFormulaText()); } @@ -952,7 +970,7 @@ VAR [vV][aA][rR] inParBlock=TRUE; outDoc->startDescList(); outDoc->startBold(); - outDoc->docify(((QString)yytext).stripWhiteSpace()); + outDoc->docify(((QCString)yytext).stripWhiteSpace()); outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); @@ -1137,7 +1155,7 @@ VAR [vV][aA][rR] BEGIN(DocScan); } "\\section "{ID}"\n" { - QString secName=&yytext[9]; // skip "\section " + QCString secName=&yytext[9]; // skip "\section " secName=secName.left(secName.length()-1); // remove \n //printf("SectionName %s found\n",secName.data()); SectionInfo *sec; @@ -1149,7 +1167,7 @@ VAR [vV][aA][rR] } } "\\anchor "{ID}"\n" { - QString secName=&yytext[8]; + QCString secName=&yytext[8]; secName=secName.left(secName.length()-1); SectionInfo *sec; if ((sec=sectionDict[secName])) @@ -1164,11 +1182,11 @@ VAR [vV][aA][rR] BEGIN(DocRefItem); } {ID} { - QString ref=yytext; + QCString ref=yytext; SectionInfo *sec; if ((sec=sectionDict[ref])) { - QString text; + QCString text; if (sec->title.isEmpty()) text=sec->label; else @@ -1179,6 +1197,7 @@ VAR [vV][aA][rR] } else { + //printf(" ref sec=%p sec->fileName=%s\n",sec,sec->fileName.data()); outDoc->writeSectionRef(sec->fileName,sec->label,text); } } @@ -1198,7 +1217,7 @@ VAR [vV][aA][rR] } [^\"\n]+[\n\"] { yytext[yyleng-1]='\0'; - QString text=substitute(yytext,"\\\\","\\"); + QCString text=substitute(yytext,"\\\\","\\"); SectionInfo *sec; if ((sec=sectionDict[sectionRef])) { @@ -1250,13 +1269,13 @@ VAR [vV][aA][rR] {SCOPEMASK}(("()")?) { generateRef(*outDoc,className,yytext,inSeeBlock); } -({SCOPEMASK}"::")?"operator"[^(\r\n.,]*"("[a-z_A-Z,\<\> \t\*\&]*")" { - QString oName=yytext; +({SCOPEMASK}"::")?"operator()("[a-z_A-Z,\<\> \t\*\&]*")" { + QCString oName=yytext; generateRef(*outDoc,className, removeRedundantWhiteSpace(oName),inSeeBlock); } -({SCOPEMASK}"::")?"operator()("[a-z_A-Z,\<\> \t\*\&]*")" { - QString oName=yytext; +({SCOPEMASK}"::")?"operator"[^(\r\n.,]*"("[a-z_A-Z,\<\> \t\*\&]*")" { + QCString oName=yytext; generateRef(*outDoc,className, removeRedundantWhiteSpace(oName),inSeeBlock); } @@ -1532,9 +1551,28 @@ VAR [vV][aA][rR] . { outDoc->writeChar(*yytext); } -"{" { BEGIN(SkipBlock); } -"{" { ++bracketCount ; } -"}" { if( bracketCount ) +"{" { + bracketCount=0; + BEGIN(SkipCurlyBlock); + } +"(" { + roundCount=0; + BEGIN(SkipRoundBlock); + } +"(" { + ++roundCount; + } +")" { + if (roundCount ) + --roundCount ; + else + BEGIN( NextSemi ) ; + } +"{" { + ++bracketCount ; + } +"}" { + if( bracketCount ) --bracketCount ; else BEGIN( NextSemi ) ; @@ -1653,7 +1691,7 @@ VAR [vV][aA][rR] BEGIN( ClassName ); } {B}*(("typedef"{BN}+)?)"class"{BN}+ { - isTypedef=((QString)yytext).find("typedef")!=-1; + isTypedef=((QCString)yytext).find("typedef")!=-1; current->section = Entry::CLASS_SEC ; addType( current ) ; current->type += " class" ; @@ -1663,7 +1701,7 @@ VAR [vV][aA][rR] BEGIN( ClassName ) ; } {B}*(("typedef"{BN}+)?)"struct"{BN}+ { - isTypedef=((QString)yytext).find("typedef")!=-1; + isTypedef=((QCString)yytext).find("typedef")!=-1; current->section = Entry::STRUCT_SEC ; addType( current ) ; current->type += " struct" ; @@ -1673,7 +1711,7 @@ VAR [vV][aA][rR] BEGIN( ClassName ) ; } {B}*(("typedef"{BN}+)?)"union"{BN}+ { - isTypedef=((QString)yytext).find("typedef")!=-1; + isTypedef=((QCString)yytext).find("typedef")!=-1; current->section = Entry::UNION_SEC ; addType( current ) ; current->type += " union" ; @@ -1683,7 +1721,7 @@ VAR [vV][aA][rR] BEGIN( ClassName ) ; } {B}*(("typedef"{BN}+)?)"enum"{BN}+ { - isTypedef=((QString)yytext).find("typedef")!=-1; + isTypedef=((QCString)yytext).find("typedef")!=-1; current->section = Entry::ENUM_SEC ; addType( current ) ; current->type += " enum" ; @@ -1751,7 +1789,7 @@ VAR [vV][aA][rR] "using"{BN}+ { lineCount(); BEGIN(Using); } ";" { BEGIN(FindMembers); } {SCOPENAME}{BN}*"<>" { // guided template decl - QString n=yytext; + QCString n=yytext; addType( current ); current->name=n.left(n.length()-2); } @@ -1761,7 +1799,7 @@ VAR [vV][aA][rR] addType( current ); current->name=yytext; current->name=current->name.stripWhiteSpace(); - if (current->name.right(8)=="operator") + if (nameIsOperator(current->name)) BEGIN( Operator ); else BEGIN( EndTemplate ); @@ -1813,7 +1851,7 @@ VAR [vV][aA][rR] { current->name += yytext; } - QString tmp=yytext; + QCString tmp=yytext; if (tmp.right(8)=="operator") BEGIN( Operator ); else @@ -1868,7 +1906,7 @@ VAR [vV][aA][rR] . [*&]+ { current->name += yytext ; } -";"{BN}*("/**"|"//!"|"/*!")"<" { +";"{BN}*("/**"|"//!"|"/*!"|"///")"<" { lineCount(); current->doc.resize(0); current->brief.resize(0); @@ -1876,12 +1914,12 @@ VAR [vV][aA][rR] afterDocTerminator = ';'; if (yytext[yyleng-3]=='/') BEGIN(AfterDocLine); - else if (yytext[yyleng-2]=='*') + else if (yytext[yyleng-2]=='*' && Config::autoBriefFlag) BEGIN(AfterDocBrief); else BEGIN(AfterDoc); } -","{BN}*("/**"|"//!"|"/*!")"<" { +","{BN}*("/**"|"//!"|"/*!"|"///")"<" { lineCount(); current->doc.resize(0); current->brief.resize(0); @@ -1889,12 +1927,12 @@ VAR [vV][aA][rR] afterDocTerminator = ','; if (yytext[yyleng-3]=='/') BEGIN(AfterDocLine); - else if (yytext[yyleng-2]=='*') + else if (yytext[yyleng-2]=='*' && Config::autoBriefFlag) BEGIN(AfterDocBrief); else BEGIN(AfterDoc); } -{BN}*("/**"|"//!"|"/*!")"<" { +{BN}*("/**"|"//!"|"/*!"|"///")"<" { lineCount(); current->doc.resize(0); current->brief.resize(0); @@ -1905,7 +1943,7 @@ VAR [vV][aA][rR] afterDocTerminator = 0; if (yytext[yyleng-3]=='/') BEGIN(AfterDocLine); - else if (yytext[yyleng-2]=='*') + else if (yytext[yyleng-2]=='*' && Config::autoBriefFlag) BEGIN(AfterDocBrief); else BEGIN(AfterDoc); @@ -1914,8 +1952,10 @@ VAR [vV][aA][rR] BEGIN(NextSemi); } [:;,] { - QString oldType = current->type.copy(); - QString oldDocs = current->doc.copy(); + QCString oldType = current->type.copy(); + QCString oldDocs = current->doc.copy(); + if ( *yytext != ':') + { current->type=current->type.simplifyWhiteSpace(); current->args=current->args.simplifyWhiteSpace(); current->name=current->name.stripWhiteSpace(); @@ -1931,9 +1971,12 @@ VAR [vV][aA][rR] current->sig = sig = FALSE; current->virt = Normal; current->stat = gstat; + } // skip expression or bitfield if needed if ( *yytext == ':') + { BEGIN( NextSemi ); + } else { if ( *yytext == ',' ) @@ -2004,7 +2047,7 @@ VAR [vV][aA][rR] current->slot = slot; } "," { unput(*yytext); BEGIN(FindFields); } -[^\r\n{}"/]* { current->program += yytext ; } +[^\r\n{}"'/]* { current->program += yytext ; } "//".* { current->program += yytext ; } \"[^\r\n"]*\" { current->program += yytext ; } "/*"{B}* { current->program += yytext ; @@ -2016,6 +2059,9 @@ VAR [vV][aA][rR] lastContext = Curly ; BEGIN( Comment ) ; } +"'"\\[0-7]{1,3}"'" { current->program += yytext; } +"'"\\."'" { current->program += yytext; } +"'"."'" { current->program += yytext; } "{" { current->program += yytext ; ++bracketCount ; } @@ -2026,16 +2072,15 @@ VAR [vV][aA][rR] } else { - QString &cn = current->name; - QString &rn = current_root->name; - //printf("current->name=`%s' current_root->name=`%s'\n", - // cn.data(),rn.data()); - if (cn && cn[0]!='@' && + QCString &cn = current->name; + QCString rn = stripAnnonymousScope(current_root->name); + //printf("cn=`%s' rn=`%s'\n",cn.data(),rn.data()); + if (!cn.isEmpty() && !rn.isEmpty() && (current_root->section & Entry::SCOPE_MASK)) { cn.prepend(rn+"::"); } - if (isTypedef && cn.length()==0) + if (isTypedef && cn.isEmpty()) { //printf("Typedef Name\n"); BEGIN( TypedefName ); @@ -2150,6 +2195,7 @@ VAR [vV][aA][rR] "{" { bracketCount=0; lastCurlyContext = MemberSpecSkip; + previous = current; BEGIN(SkipCurly); } "," { BEGIN(MemberSpec); } @@ -2392,8 +2438,8 @@ VAR [vV][aA][rR] current->name=current->name.simplifyWhiteSpace(); current->type=current->type.simplifyWhiteSpace(); current->args=current->args.simplifyWhiteSpace(); - QString &cn=current->name; - QString &rn=current_root->name; + QCString &cn=current->name; + QCString &rn=current_root->name; //printf("current_root->name=`%s'\n",rn.data()); //printf("Function: `%s' `%s' `%s'\n",current->type.data(),cn.data(),current->args.data()); int i; @@ -2415,7 +2461,7 @@ VAR [vV][aA][rR] if (*yytext!=';' || (current_root->section&Entry::SCOPE_MASK) ) { int tempArg=current->name.find('<'); - QString tempName; + QCString tempName; if (tempArg==-1) tempName=current->name; else @@ -2437,7 +2483,7 @@ VAR [vV][aA][rR] else // a global function prototype or function variable { //printf("Scanner.l: prototype? type=`%s' name=`%s' args=`%s'\n",current->type.data(),current->name.data(),current->args.data()); - QRegExp re("([^)])"); + QRegExp re("([^)]*)"); if (!current->type.isNull() && current->type.find(re,0)!=-1) { //printf("Scanner.l: found function variable!\n"); @@ -2450,6 +2496,7 @@ VAR [vV][aA][rR] current->proto = TRUE; } } + previous = current; current_root->addSubEntry(current); current = new Entry ; current->protection = protection; @@ -2459,46 +2506,127 @@ VAR [vV][aA][rR] current->slot = slot; lastCurlyContext = FindMembers; if( *yytext == '{' ) - BEGIN( SkipCurly ) ; + { + addToBody(yytext); + BEGIN( SkipCurly ) ; + } else if( *yytext == ':' ) - BEGIN( SkipInits ) ; + { + addToBody(yytext); + BEGIN( SkipInits ) ; + } else - BEGIN( FindMembers ) ; + BEGIN( FindMembers ) ; } "{" { + addToBody(yytext); lastCurlyContext = FindMembers; BEGIN( SkipCurly ) ; } -"{" { ++bracketCount ; } -"}" { if( bracketCount ) +"{" { + addToBody(yytext); + ++bracketCount ; + } +"}" { + addToBody(yytext); + if( bracketCount ) --bracketCount ; else - //BEGIN( FindMembers ) ; BEGIN( lastCurlyContext ) ; } -"'"\\[0-7]{1,3}"'" -"'"\\."'" -"'"."'" +"}"{BN}*("/*!"|"/**"|"//!"|"///")"<" { + if ( bracketCount ) + { + addToBody(yytext); + --bracketCount ; + } + else + { + lineCount(); + tempEntry = current; // temporarily switch to the previous entry + current = previous; + current->doc.resize(0); + current->brief.resize(0); + lastAfterDocContext = SkipCurlyEndDoc; + afterDocTerminator = '}'; + if (yytext[yyleng-3]=='/') + BEGIN(AfterDocLine); + else if (yytext[yyleng-2]=='*' && Config::autoBriefFlag) + BEGIN(AfterDocBrief); + else + BEGIN(AfterDoc); + } + } +"}" { + addToBody("}"); + current = tempEntry; + BEGIN( lastCurlyContext ); + } +"'"\\[0-7]{1,3}"'" { + addToBody(yytext); + } +"'"\\."'" { + addToBody(yytext); + } +"'"."'" { + addToBody(yytext); + } \" { + addToBody(yytext); lastStringContext=SkipCurly; BEGIN( SkipString ); } -^{B}*"#" { BEGIN( SkipCurlyCpp ); } -\n { yyLineNr++; +^{B}*"#" { + addToBody(yytext); + BEGIN( SkipCurlyCpp ); + } +\n { + yyLineNr++; + addToBody(yytext); + } +. { + addToBody(yytext); + } +\n { + addToBody(yytext); + yyLineNr++; lastCurlyContext = FindMembers; BEGIN( SkipCurly ); } -\\[\r]*"\n"[\r]* { yyLineNr++; } -"/*" -"*/" -"//" -\\. -\" { BEGIN( lastStringContext ); } -"/*" -"*/" -"//" - +\\[\r]*"\n"[\r]* { + addToBody(yytext); + yyLineNr++; + } +"/*" { + addToBody(yytext); + } +"*/" { + addToBody(yytext); + } +"//".* { + addToBody(yytext); + } +. { + addToBody(yytext); + } +\\. { + addToBodyCond(yytext); + } +\" { + addToBodyCond(yytext); + BEGIN( lastStringContext ); + } +"/*"|"*/"|"//" { + addToBodyCond(yytext); + } +\n { + yyLineNr++; + addToBodyCond(yytext); + } +. { + addToBodyCond(yytext); + } ";" { current->section = Entry::EMPTY_SEC ; current->type.resize(0) ; @@ -2507,7 +2635,7 @@ VAR [vV][aA][rR] current->argList->clear(); BEGIN( FindMembers ) ; } -{ID} { +{SCOPENAME} { current->name = yytext ; BEGIN( ClassVar ); } @@ -2522,7 +2650,7 @@ VAR [vV][aA][rR] {ID} { if (isTypedef) { - typedefDict.insert(yytext,new QString(current->name)); + typedefDict.insert(yytext,new QCString(current->name)); current->type.prepend("typedef "); } current->type += ' ' ; @@ -2638,22 +2766,34 @@ VAR [vV][aA][rR] } ("//"{B}*)?"/**"/[^/*] { removeSlashes=(yytext[1]=='/'); + lastDocContext = YY_START; if (current_root->section & Entry::SCOPE_MASK) current->inside = current_root->name+"::"; - if (YY_START==Curly) + if (!Config::autoBriefFlag) // use the Qt style { tmpDocType=-1; - current->doc+="\n\n"; - lastDocContext = Curly; + if (YY_START==Curly) + current->doc+="\n\n"; + else + current->doc.resize(0); BEGIN( Doc ); } - else - { - tmpDocType=Doc; - current->doc.resize(0); - current->brief.resize(0); - lastDocContext = YY_START; - BEGIN( JavaDoc ); + else // Use the javadoc style + { + if (YY_START==Curly) + { + tmpDocType=-1; + current->doc+="\n\n"; + lastDocContext = Curly; + BEGIN( Doc ); + } + else + { + tmpDocType=Doc; + current->doc.resize(0); + current->brief.resize(0); + BEGIN( JavaDoc ); + } } } "//!" { @@ -2679,7 +2819,7 @@ VAR [vV][aA][rR] current->args.resize(0); current->argList->clear(); bracketCount=0; - BEGIN( SkipBlock ); + BEGIN( SkipCurlyBlock ); } "@short"{B}+ { @@ -2728,24 +2868,31 @@ VAR [vV][aA][rR] current->startLine = yyLineNr; BEGIN( ClassDocFunc ); } -{B}*("\\"|"@")"def"{B}* { +{B}*("\\"|"@")"def"{B}+ { nextDefContext = YY_START==LineDoc ? DefLineDoc : ClassDoc; current->section = Entry::DEFINEDOC_SEC; current->fileName = yyFileName; current->startLine = yyLineNr; BEGIN( ClassDocDefine ); } -{B}*("\\"|"@")"overload"{B}* { +{B}*("\\"|"@")"overload"{B}* { + overloadContext = YY_START; BEGIN( ClassDocOverload ); } -{B}*"\n" { - QString orgDoc = current->doc; +{B}*/"\n" { + QCString orgDoc = current->doc; current->doc = getOverloadDocs(); current->doc += "\n\n"; current->doc += orgDoc; - yyLineNr++; - BEGIN( Doc ); + BEGIN( overloadContext ); } +{B}*/"*/" { + QCString orgDoc = current->doc; + current->doc = getOverloadDocs(); + current->doc += "\n\n"; + current->doc += orgDoc; + BEGIN( overloadContext ); + } . { unput(*yytext); current->section = Entry::OVERLOADDOC_SEC; current->fileName = yyFileName; @@ -3104,7 +3251,7 @@ VAR [vV][aA][rR] } {ID} { current->groups->append( - new QString(yytext) + new QCString(yytext) ); } \n { @@ -3177,6 +3324,9 @@ VAR [vV][aA][rR] current->section = Entry::VARIABLEDOC_SEC; newDocState(); } +"operator"{B}*"("{B}*")" { + current->name+=yytext; + } "(" { current->args+=*yytext; currentArgumentContext = ClassDocFuncQual; @@ -3194,6 +3344,9 @@ VAR [vV][aA][rR] current->name+=')'; BEGIN( ClassDocFunc ); } +"{" { + BEGIN( ClassDocFuncSkipLine); + } {B}*"const"{B}* { current->args += " const "; current->argList->constSpecifier=TRUE; @@ -3221,7 +3374,7 @@ VAR [vV][aA][rR] . { current->name += *yytext; } -"\n" { +"\n" { yyLineNr++; current->name = current->name.stripWhiteSpace(); newDocState(); @@ -3229,6 +3382,7 @@ VAR [vV][aA][rR] . { current->doc += *yytext; } . { current->brief += *yytext; } \n { yyLineNr++; current->doc += *yytext; } +[\n\r]{B}*"//"[!/] \n { yyLineNr++; BEGIN( lastDocContext ); @@ -3306,6 +3460,20 @@ VAR [vV][aA][rR] //---------------------------------------------------------------------------- +static void addToBody(const char *text) +{ + if (Config::includeSourceFlag) + previous->body+=text; +} + +static void addToBodyCond(const char *text) +{ + if (Config::includeSourceFlag && lastStringContext==SkipCurly) + previous->body+=text; +} + +//---------------------------------------------------------------------------- + void scanString(const char *s) { const char *oldInputString = inputString; @@ -3414,7 +3582,7 @@ void parseMain(Entry *rt) //---------------------------------------------------------------------------- -void parseDocument(OutputList &ol,const QString &docString) +void parseDocument(OutputList &ol,const QCString &docString) { //inParamBlock=inSeeBlock=inReturnBlock=FALSE; curTable = 0; @@ -3441,7 +3609,7 @@ void parseDocument(OutputList &ol,const QString &docString) //---------------------------------------------------------------------------- void parseDoc(OutputList &ol,const char *clName, - const char *memName,const QString &docString) + const char *memName,const QCString &docString) { initParser(); initParseCodeContext(); @@ -3461,7 +3629,7 @@ void parseDoc(OutputList &ol,const char *clName, //---------------------------------------------------------------------------- -void parseText(OutputList &ol,const QString &txtString) +void parseText(OutputList &ol,const QCString &txtString) { inputString = txtString; outDoc = new OutputList(&ol); @@ -3476,7 +3644,7 @@ void parseText(OutputList &ol,const QString &txtString) //---------------------------------------------------------------------------- -void parseExample(OutputList &ol,const QString &docString, +void parseExample(OutputList &ol,const QCString &docString, const char *fileName) { initParser(); @@ -3487,9 +3655,3 @@ void parseExample(OutputList &ol,const QString &docString, } //---------------------------------------------------------------------------- - -extern "C" { // some sillyness to keep the compiler happy -int scanYYwrap() { return 1 ; } -void bogus() { yy_flex_realloc(0,0); } -} - diff --git a/src/searchindex.cpp b/src/searchindex.cpp index 241d0a8..50d6556 100644 --- a/src/searchindex.cpp +++ b/src/searchindex.cpp @@ -14,6 +14,7 @@ * */ +#include "qtbc.h" #include "searchindex.h" #include "suffixtree.h" @@ -44,7 +45,7 @@ bool SearchIndex::addWord(const char *key,const char *word,bool special) DocRef *dr=0; if (word && key && strlen(key)>0 && (dr=refDict[key])) { - suffixTree->insertWord(((QString)word).lower(),dr->index(),special); + suffixTree->insertWord(((QCString)word).lower(),dr->index(),special); return TRUE; } else if (word) diff --git a/src/searchindex.h b/src/searchindex.h index 64071fb..f51afa6 100644 --- a/src/searchindex.h +++ b/src/searchindex.h @@ -17,8 +17,8 @@ #ifndef _SEARCHINDEX_H #define _SEARCHINDEX_H +#include "qtbc.h" #include -#include #include #include @@ -40,8 +40,8 @@ class DocRef int offset() const { return o; } private: - QString n; - QString u; + QCString n; + QCString u; int i; int o; }; diff --git a/src/section.h b/src/section.h index fc287ae..aa9a674 100644 --- a/src/section.h +++ b/src/section.h @@ -18,9 +18,9 @@ #ifndef SECTION_H #define SECTION_H +#include "qtbc.h" #include #include -#include class Definition; @@ -29,11 +29,11 @@ struct SectionInfo enum SectionType { Section, Subsection, Anchor }; SectionInfo(const char *l,const char *t,SectionType st) { label=l; title=t; type=st; definition=0; } - QString fileName; - QString label; - QString title; + QCString label; + QCString title; SectionType type; Definition *definition; + QCString fileName; }; class SectionList : public QList diff --git a/src/suffixtree.cpp b/src/suffixtree.cpp index 604531f..8b8ce88 100644 --- a/src/suffixtree.cpp +++ b/src/suffixtree.cpp @@ -15,6 +15,8 @@ */ #include + +#include "qtbc.h" #include "suffixtree.h" #define MAXWORDLEN 1024 @@ -112,7 +114,7 @@ int SuffixNode::insert(const char *word,int refId,int inName,int fullWord) SuffixNode *sn=children->first(); while (sn) { - char *lab=sn->label.data(); + const char *lab=sn->label.data(); char w=word[0],l=lab[0],i=0; while (w!=0 && l!=0 && w==l) { i++; w=word[i]; l=lab[i]; } if (w==0 && l==0) // match found @@ -320,7 +322,7 @@ SuffixTree::~SuffixTree() void SuffixTree::insertWord(const char *word,int index,bool inName) { - QString suffix=word; + QCString suffix=word; uint i; for (i=2;i #include -#include #include class SuffixNodeList; @@ -56,7 +56,7 @@ class SuffixNode private: SuffixNodeList *children; QArray references; - QString label; + QCString label; int branchOffset; int totalFreq; }; diff --git a/src/tag.l b/src/tag.l index 9a6aa02..8e02d92 100644 --- a/src/tag.l +++ b/src/tag.l @@ -20,7 +20,8 @@ * includes */ #include -#include + +#include "qtbc.h" #include #include "classdef.h" @@ -30,18 +31,19 @@ #include "doxygen.h" #include "util.h" #include "message.h" +#include "defargs.h" #define YY_NO_UNPUT #define YY_NEVER_INTERACTIVE 1 static int yyLineNr; -static QString className; -static QString fileName; -static QString namespaceName; -static QString tagName; -static QString memberName; -static QString anchorName; -static QString argString; +static QCString className; +static QCString fileName; +static QCString namespaceName; +static QCString tagName; +static QCString memberName; +static QCString anchorName; +static QCString argString; static ClassDef *cd; static FileDef *fd; static NamespaceDef *nd; @@ -105,8 +107,11 @@ static void addMember(const char *name,const char *anchor,const char *args) MemberNameDict *mnd=0; MemberNameList *mnl=0; MemberDef *md; + ArgumentList *argList = new ArgumentList; + stringToArgumentList(args,argList); md=new MemberDef(0,name,args,0,Public,Normal,FALSE,FALSE, - MemberDef::Function,0,0); + MemberDef::Function,0,argList); + delete argList; md->setReference(anchor); if (cd) // member of a class { @@ -129,7 +134,7 @@ static void addMember(const char *name,const char *anchor,const char *args) mnd=&functionNameDict; mnl=&functionNameList; } - MemberName *mn; + MemberName *mn = 0; if ((mn=(*mnd)[memberName])) { //printf("mn->inSort()\n"); @@ -156,6 +161,8 @@ ID [a-z_A-Z][a-z_A-Z0-9]* FILE [a-z_A-Z0-9\.\-\+\:\\\/]+ SCOPE ({ID}"::")*{ID} +%option noyywrap + %x Pass1 %x Pass2 %x AnchorName @@ -272,6 +279,6 @@ void parseTagFile(const char *fileName) fclose(f); } -extern "C" { // some bogus code to keep the compiler happy - int tagYYwrap() { return 1 ; } -} +//extern "C" { // some bogus code to keep the compiler happy +// int tagYYwrap() { return 1 ; } +//} diff --git a/src/translator.h b/src/translator.h index 6f69c9b..d5c4f67 100644 --- a/src/translator.h +++ b/src/translator.h @@ -17,7 +17,7 @@ #ifndef TRANSLATOR_H #define TRANSLATOR_H -#include +#include "qtbc.h" #include "classdef.h" #include "util.h" @@ -28,166 +28,164 @@ class Translator // NOTICE: // the following functions are now obsolete: these are no longer used and // will disappear in future versions. You do not have to translate them! - virtual QString trInherits() + virtual QCString trInherits() { return "Inherits"; } - virtual QString trAnd() + virtual QCString trAnd() { return "and"; } - virtual QString trInheritedBy() + virtual QCString trInheritedBy() { return "Inherited By"; } - virtual QString trReference() + virtual QCString trReference() { return "Reference"; } - virtual QString trReimplementedFrom() + virtual QCString trReimplementedFrom() { return "Reimplemented from"; } - virtual QString trReimplementedIn() + virtual QCString trReimplementedIn() { return "Reimplemented in"; } - virtual QString trIncludeFile() + virtual QCString trIncludeFile() { return "Include File"; } - virtual QString trNamespaces() - { return "Namespace List"; } // end of obsolete functions //-------------------------------------------------------------------- - virtual QString latexBabelPackage() + virtual QCString latexBabelPackage() // returns the name of the package that is included by LaTeX { return ""; } - virtual QString trRelatedFunctions() + virtual QCString trRelatedFunctions() // used in the compound documentation before a list of related functions. { return "Related Functions"; } - virtual QString trRelatedSubscript() + virtual QCString trRelatedSubscript() // subscript for the related functions. { return "(Note that these are not member functions.)"; } - virtual QString trDetailedDescription() + virtual QCString trDetailedDescription() // header that is put before the detailed description of files, classes and namespaces. { return "Detailed Description"; } - virtual QString trMemberTypedefDocumentation() + virtual QCString trMemberTypedefDocumentation() // header that is put before the list of typedefs. { return "Member Typedef Documentation"; } - virtual QString trMemberEnumerationDocumentation() + virtual QCString trMemberEnumerationDocumentation() // header that is put before the list of enumerations. { return "Member Enumeration Documentation"; } - virtual QString trMemberFunctionDocumentation() + virtual QCString trMemberFunctionDocumentation() // header that is put before the list of member functions. { return "Member Function Documentation"; } - virtual QString trMemberDataDocumentation() + virtual QCString trMemberDataDocumentation() // header that is put before the list of member attributes. { return "Member Data Documentation"; } - virtual QString trGeneratedFrom(const char *s,bool single) + virtual QCString trGeneratedFrom(const char *s,bool single) { // here s is one of " Class", " Struct" or " Union" // single is true implies a single file - QString result=(QString)"The documentation for this"+s+ + QCString result=(QCString)"The documentation for this"+s+ " was generated from the following file"; if (single) result+=":"; else result+="s:"; return result; } - virtual QString trMore() + virtual QCString trMore() // this is the text of a link put after brief descriptions. { return "More..."; } - virtual QString trListOfAllMembers() + virtual QCString trListOfAllMembers() // put in the class documentation { return "List of all members."; } - virtual QString trMemberList() + virtual QCString trMemberList() // used as the title of the "list of all members" page of a class { return "Member List"; } - virtual QString trThisIsTheListOfAllMembers() + virtual QCString trThisIsTheListOfAllMembers() // this is the first part of a sentence that is followed by a class name { return "This is the complete list of members for "; } - virtual QString trIncludingInheritedMembers() + virtual QCString trIncludingInheritedMembers() // this is the remainder of the sentence after the class name { return ", including all inherited members."; } - virtual QString trGeneratedAutomatically(const char *s) + virtual QCString trGeneratedAutomatically(const char *s) // this is put at the author sections at the bottom of man pages. // parameter s is name of the project name. - { QString result="Generated automatically by Doxygen"; - if (s) result+=(QString)" for "+s; + { QCString result="Generated automatically by Doxygen"; + if (s) result+=(QCString)" for "+s; result+=" from the source code."; return result; } - virtual QString trEnumName() + virtual QCString trEnumName() // put after an enum name in the list of all members { return "enum name"; } - virtual QString trEnumValue() + virtual QCString trEnumValue() // put after an enum value in the list of all members { return "enum value"; } - virtual QString trDefinedIn() + virtual QCString trDefinedIn() // put after an undocumented member in the list of all members { return "defined in"; } - virtual QString trVerbatimText(const char *f) + virtual QCString trVerbatimText(const char *f) // put as in introduction in the verbatim header file of a class. // parameter f is the name of the include file. - { return (QString)"This is the verbatim text of the "+f+" include file."; } + { return (QCString)"This is the verbatim text of the "+f+" include file."; } // quick reference sections - virtual QString trModules() + virtual QCString trModules() // This is put above each page as a link to the list of all groups of // compounds or files (see the \group command). { return "Modules"; } - virtual QString trClassHierarchy() + virtual QCString trClassHierarchy() // This is put above each page as a link to the class hierarchy { return "Class Hierarchy"; } - virtual QString trCompoundList() + virtual QCString trCompoundList() // This is put above each page as a link to the list of annotated classes { return "Compound List"; } - virtual QString trFileList() + virtual QCString trFileList() // This is put above each page as a link to the list of documented files { return "File List"; } - virtual QString trHeaderFiles() + virtual QCString trHeaderFiles() // This is put above each page as a link to the list of all verbatim headers { return "Header Files"; } - virtual QString trCompoundMembers() + virtual QCString trCompoundMembers() // This is put above each page as a link to all members of compounds. { return "Compound Members"; } - virtual QString trFileMembers() + virtual QCString trFileMembers() // This is put above each page as a link to all members of files. { return "File Members"; } - virtual QString trRelatedPages() + virtual QCString trRelatedPages() // This is put above each page as a link to all related pages. { return "Related Pages"; } - virtual QString trExamples() + virtual QCString trExamples() // This is put above each page as a link to all examples. { return "Examples"; } - virtual QString trSearch() + virtual QCString trSearch() // This is put above each page as a link to the search engine. { return "Search"; } - virtual QString trClassHierarchyDescription() + virtual QCString trClassHierarchyDescription() // This is an introduction to the class hierarchy. { return "This inheritance list is sorted roughly, " "but not completely, alphabetically:"; } - virtual QString trFileListDescription(bool extractAll) + virtual QCString trFileListDescription(bool extractAll) // This is an introduction to the list with all files. { - QString result="Here is a list of all "; + QCString result="Here is a list of all "; if (!extractAll) result+="documented "; result+="files with brief descriptions:"; return result; } - virtual QString trCompoundListDescription() + virtual QCString trCompoundListDescription() // This is an introduction to the annotated compound list { return "Here are the classes, structs and " "unions with brief descriptions:"; } - virtual QString trCompoundMembersDescription(bool extractAll) + virtual QCString trCompoundMembersDescription(bool extractAll) // This is an introduction to the page with all class members { - QString result="Here is a list of all "; + QCString result="Here is a list of all "; if (!extractAll) result+="documented "; result+="class members with links to "; if (extractAll) @@ -196,10 +194,10 @@ class Translator result+="the classes they belong to:"; return result; } - virtual QString trFileMembersDescription(bool extractAll) + virtual QCString trFileMembersDescription(bool extractAll) // This is an introduction to the page with all file members { - QString result="Here is a list of all "; + QCString result="Here is a list of all "; if (!extractAll) result+="documented "; result+="file members with links to "; if (extractAll) @@ -208,207 +206,207 @@ class Translator result+="the files they belong to:"; return result; } - virtual QString trHeaderFilesDescription() + virtual QCString trHeaderFilesDescription() // This is an introduction to the page with the list of all header files { return "Here are the header files that make up the API:"; } - virtual QString trExamplesDescription() + virtual QCString trExamplesDescription() // This is an introduction to the page with the list of all examples { return "Here is a list of all examples:"; } - virtual QString trRelatedPagesDescription() + virtual QCString trRelatedPagesDescription() // This is an introduction to the page with the list of related pages { return "Here is a list of all related documentation pages:"; } - virtual QString trModulesDescription() + virtual QCString trModulesDescription() // This is an introduction to the page with the list of class/file groups { return "Here is a list of all modules:"; } - virtual QString trNoDescriptionAvailable() + virtual QCString trNoDescriptionAvailable() // This sentences is used in the annotated class/file lists if no brief // description is given. { return "No description available"; } // index titles (the project name is prepended for these) - virtual QString trDocumentation() + virtual QCString trDocumentation() // This is used in HTML as the title of index.html. { return "Documentation"; } - virtual QString trModuleIndex() + virtual QCString trModuleIndex() // This is used in LaTeX as the title of the chapter with the // index of all groups. { return "Module Index"; } - virtual QString trHierarchicalIndex() + virtual QCString trHierarchicalIndex() // This is used in LaTeX as the title of the chapter with the // class hierarchy. { return "Hierarchical Index"; } - virtual QString trCompoundIndex() + virtual QCString trCompoundIndex() // This is used in LaTeX as the title of the chapter with the // annotated compound index { return "Compound Index"; } - virtual QString trFileIndex() + virtual QCString trFileIndex() // This is used in LaTeX as the title of the chapter with the // list of all files. { return "File Index"; } - virtual QString trModuleDocumentation() + virtual QCString trModuleDocumentation() // This is used in LaTeX as the title of the chapter containing // the documentation of all groups. { return "Module Documentation"; } - virtual QString trClassDocumentation() + virtual QCString trClassDocumentation() // This is used in LaTeX as the title of the chapter containing // the documentation of all classes, structs and unions. { return "Class Documentation"; } - virtual QString trFileDocumentation() + virtual QCString trFileDocumentation() // This is used in LaTeX as the title of the chapter containing // the documentation of all files. { return "File Documentation"; } - virtual QString trExampleDocumentation() + virtual QCString trExampleDocumentation() // This is used in LaTeX as the title of the chapter containing // the documentation of all examples. { return "Example Documentation"; } - virtual QString trPageDocumentation() + virtual QCString trPageDocumentation() // This is used in LaTeX as the title of the chapter containing // the documentation of all related pages. { return "Page Documentation"; } - virtual QString trReferenceManual() + virtual QCString trReferenceManual() // This is used in LaTeX as the title of the document { return "Reference Manual"; } - virtual QString trDefines() + virtual QCString trDefines() // This is used in the documentation of a file as a header before the // list of defines { return "Defines"; } - virtual QString trFuncProtos() + virtual QCString trFuncProtos() // This is used in the documentation of a file as a header before the // list of function prototypes { return "Function Prototypes"; } - virtual QString trTypedefs() + virtual QCString trTypedefs() // This is used in the documentation of a file as a header before the // list of typedefs { return "Typedefs"; } - virtual QString trEnumerations() + virtual QCString trEnumerations() // This is used in the documentation of a file as a header before the // list of enumerations { return "Enumerations"; } - virtual QString trFunctions() + virtual QCString trFunctions() // This is used in the documentation of a file as a header before the // list of (global) functions { return "Functions"; } - virtual QString trVariables() + virtual QCString trVariables() // This is used in the documentation of a file as a header before the // list of (global) variables { return "Variables"; } - virtual QString trEnumerationValues() + virtual QCString trEnumerationValues() // This is used in the documentation of a file as a header before the // list of (global) variables { return "Enumeration values"; } - virtual QString trAuthor() + virtual QCString trAuthor() // This is used in man pages as the author section. { return "Author"; } - virtual QString trDefineDocumentation() + virtual QCString trDefineDocumentation() // This is used in the documentation of a file before the list of // documentation blocks for defines { return "Define Documentation"; } - virtual QString trFunctionPrototypeDocumentation() + virtual QCString trFunctionPrototypeDocumentation() // This is used in the documentation of a file/namespace before the list // of documentation blocks for function prototypes { return "Function Prototype Documentation"; } - virtual QString trTypedefDocumentation() + virtual QCString trTypedefDocumentation() // This is used in the documentation of a file/namespace before the list // of documentation blocks for typedefs { return "Typedef Documentation"; } - virtual QString trEnumerationTypeDocumentation() + virtual QCString trEnumerationTypeDocumentation() // This is used in the documentation of a file/namespace before the list // of documentation blocks for enumeration types { return "Enumeration Type Documentation"; } - virtual QString trEnumerationValueDocumentation() + virtual QCString trEnumerationValueDocumentation() // This is used in the documentation of a file/namespace before the list // of documentation blocks for enumeration values { return "Enumeration Value Documentation"; } - virtual QString trFunctionDocumentation() + virtual QCString trFunctionDocumentation() // This is used in the documentation of a file/namespace before the list // of documentation blocks for functions { return "Function Documentation"; } - virtual QString trVariableDocumentation() + virtual QCString trVariableDocumentation() // This is used in the documentation of a file/namespace before the list // of documentation blocks for variables { return "Variable Documentation"; } - virtual QString trCompounds() + virtual QCString trCompounds() // This is used in the documentation of a file/namespace/group before // the list of links to documented compounds { return "Compounds"; } - virtual QString trFiles() + virtual QCString trFiles() // This is used in the documentation of a group before the list of // links to documented files { return "Files"; } - virtual QString trGeneratedAt(const char *date,const char *projName) + virtual QCString trGeneratedAt(const char *date,const char *projName) { - QString result=(QString)"Generated at "+date; - if (projName) result+=(QString)" for "+projName; - result+=(QString)" by"; + QCString result=(QCString)"Generated at "+date; + if (projName) result+=(QCString)" for "+projName; + result+=(QCString)" by"; return result; } - virtual QString trWrittenBy() + virtual QCString trWrittenBy() { return "written by"; } - virtual QString trClassDiagram(const char *clName) + virtual QCString trClassDiagram(const char *clName) // this text is put before a class diagram { - return (QString)"Class diagram for "+clName; + return (QCString)"Class diagram for "+clName; } - virtual QString trForInternalUseOnly() + virtual QCString trForInternalUseOnly() // this text is generated when the \internal command is used. { return "For internal use only."; } - virtual QString trReimplementedForInternalReasons() + virtual QCString trReimplementedForInternalReasons() // this text is generated when the \reimp command is used. { return "Reimplemented for internal reasons; the API is not affected."; } - virtual QString trWarning() + virtual QCString trWarning() // this text is generated when the \warning command is used. { return "Warning"; } - virtual QString trBugsAndLimitations() + virtual QCString trBugsAndLimitations() // this text is generated when the \bug command is used. { return "Bugs and limitations"; } - virtual QString trVersion() + virtual QCString trVersion() // this text is generated when the \version command is used. { return "Version"; } - virtual QString trDate() + virtual QCString trDate() // this text is generated when the \date command is used. { return "Date"; } - virtual QString trAuthors() + virtual QCString trAuthors() // this text is generated when the \author command is used. { return "Author(s)"; } - virtual QString trReturns() + virtual QCString trReturns() // this text is generated when the \return command is used. { return "Returns"; } - virtual QString trSeeAlso() + virtual QCString trSeeAlso() // this text is generated when the \sa command is used. { return "See also"; } - virtual QString trParameters() + virtual QCString trParameters() // this text is generated when the \param command is used. { return "Parameters"; } - virtual QString trExceptions() + virtual QCString trExceptions() // this text is generated when the \exception command is used. { return "Exceptions"; } - virtual QString trGeneratedBy() + virtual QCString trGeneratedBy() // this text is used in the title page of a LaTeX document. { return "Generated by"; } // new since 0.49-990307 - virtual QString trNamespaceList() + virtual QCString trNamespaceList() // used as the title of page containing all the index of all namespaces. { return "Namespace List"; } - virtual QString trNamespaceListDescription(bool extractAll) + virtual QCString trNamespaceListDescription(bool extractAll) // used as an introduction to the namespace list { - QString result="Here is a list of all "; + QCString result="Here is a list of all "; if (!extractAll) result+="documented "; result+="namespaces with brief descriptions:"; return result; } - virtual QString trFriends() + virtual QCString trFriends() // used in the class documentation as a header before the list of all // friends of a class { return "Friends"; } @@ -417,7 +415,7 @@ class Translator // new since 0.49-990405 ////////////////////////////////////////////////////////////////////////// - virtual QString trRelatedFunctionDocumentation() + virtual QCString trRelatedFunctionDocumentation() // used in the class documentation as a header before the list of all // related classes { return "Friends And Related Function Documentation"; } @@ -426,11 +424,11 @@ class Translator // new since 0.49-990425 ////////////////////////////////////////////////////////////////////////// - virtual QString trCompoundReference(const char *clName, + virtual QCString trCompoundReference(const char *clName, ClassDef::CompoundType compType) // used as the title of the HTML page of a class/struct/union { - QString result=(QString)clName+" "; + QCString result=(QCString)clName+" "; switch(compType) { case ClassDef::Class: result+=" Class"; break; @@ -440,49 +438,49 @@ class Translator result+=" Reference"; return result; } - virtual QString trFileReference(const char *fileName) + virtual QCString trFileReference(const char *fileName) // used as the title of the HTML page of a file { - QString result=fileName; + QCString result=fileName; result+=" File Reference"; return result; } - virtual QString trNamespaceReference(const char *namespaceName) + virtual QCString trNamespaceReference(const char *namespaceName) // used as the title of the HTML page of a namespace { - QString result=namespaceName; + QCString result=namespaceName; result+=" Namespace Reference"; return result; } // these are for the member sections of a class, struct or union - virtual QString trPublicMembers() + virtual QCString trPublicMembers() { return "Public Members"; } - virtual QString trPublicSlots() + virtual QCString trPublicSlots() { return "Public Slots"; } - virtual QString trSignals() + virtual QCString trSignals() { return "Signals"; } - virtual QString trStaticPublicMembers() + virtual QCString trStaticPublicMembers() { return "Static Public Members"; } - virtual QString trProtectedMembers() + virtual QCString trProtectedMembers() { return "Protected Members"; } - virtual QString trProtectedSlots() + virtual QCString trProtectedSlots() { return "Protected Slots"; } - virtual QString trStaticProtectedMembers() + virtual QCString trStaticProtectedMembers() { return "Static Protected Members"; } - virtual QString trPrivateMembers() + virtual QCString trPrivateMembers() { return "Private Members"; } - virtual QString trPrivateSlots() + virtual QCString trPrivateSlots() { return "Private Slots"; } - virtual QString trStaticPrivateMembers() + virtual QCString trStaticPrivateMembers() { return "Static Private Members"; } // end of member sections - virtual QString trWriteList(int numEntries) + virtual QCString trWriteList(int numEntries) { // this function is used to produce a comma-separated list of items. // use generateMarker(i) to indicate where item i should be put. - QString result; + QCString result; int i; // the inherits list contain `numEntries' classes for (i=0;i