Commit 5167cf20 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Release-1.2.3-20001203

parent a1995ea7
DOXYGEN Version 1.2.3-20001126 DOXYGEN Version 1.2.3-20001203
Please read the installation section of the manual for instructions. Please read the installation section of the manual for instructions.
-------- --------
Dimitri van Heesch (26 November 2000) Dimitri van Heesch (03 December 2000)
DOXYGEN Version 1.2.3-20001126 DOXYGEN Version 1.2.3-20001203
Please read INSTALL for compilation instructions. Please read INSTALL for compilation instructions.
...@@ -7,4 +7,4 @@ The latest version of doxygen can be obtained at ...@@ -7,4 +7,4 @@ The latest version of doxygen can be obtained at
Enjoy, Enjoy,
Dimitri van Heesch (26 November 2000) Dimitri van Heesch (03 December 2000)
1.2.3-20001126 1.2.3-20001203
...@@ -453,6 +453,23 @@ void configStrToVal() ...@@ -453,6 +453,23 @@ void configStrToVal()
Config::enumValuesPerLine=cols; Config::enumValuesPerLine=cols;
} }
if (treeViewWidthString.isEmpty())
{
Config::treeViewWidth=250;
}
else
{
bool ok;
int width = treeViewWidthString.toInt(&ok);
if (!ok || width<0 || width>1500)
{
warn_cont("Warning: argument of TREEVIEW_WIDTH is not a valid number in the range [0..1500]!\n"
"Using the default of 250!\n");
width = 250;
}
Config::treeViewWidth=width;
}
if (maxDotGraphWidthString.isEmpty()) if (maxDotGraphWidthString.isEmpty())
{ {
Config::maxDotGraphWidth=1024; Config::maxDotGraphWidth=1024;
......
...@@ -1313,6 +1313,16 @@ void init() ...@@ -1313,6 +1313,16 @@ void init()
"or Internet explorer 4.0+). " "or Internet explorer 4.0+). "
); );
addDependency("ftvHelpFlag","generateHtml"); addDependency("ftvHelpFlag","generateHtml");
ConfigInt::add( "treeViewWidth",
"TREEVIEW_WIDTH",
"250",
"What is the width of the treeview panel?",
"If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be \n"
"used to set the initial width (in pixels) of the frame in which the tree \n"
"is shown. \n",
0,1500
);
addDependency("treeViewWidth","generateHtml");
// TODO: integrate this option // TODO: integrate this option
// ConfigBool::add( "htmlHelpGroupsOnly", // ConfigBool::add( "htmlHelpGroupsOnly",
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# input used in their production; they are not affected by this license. # input used in their production; they are not affected by this license.
all: FORCE all: FORCE
@xcopy /s /q ..\examples ..\html\examples @xcopy /s /q /i ..\examples ..\html\examples
set DOXYGEN_DOCDIR=. set DOXYGEN_DOCDIR=.
set VERSION=$(VERSION) set VERSION=$(VERSION)
$(DOXYGEN)\bin\doxygen $(DOXYGEN)\bin\doxygen
......
...@@ -110,6 +110,7 @@ followed by the descriptions of the tags grouped by category. ...@@ -110,6 +110,7 @@ followed by the descriptions of the tags grouped by category.
<li> \refitem cfg_generate_tagfile GENERATE_TAGFILE <li> \refitem cfg_generate_tagfile GENERATE_TAGFILE
<li> \refitem cfg_generate_testlist GENERATE_TESTLIST <li> \refitem cfg_generate_testlist GENERATE_TESTLIST
<li> \refitem cfg_generate_todolist GENERATE_TODOLIST <li> \refitem cfg_generate_todolist GENERATE_TODOLIST
<li> \refitem cfg_generate_treeview GENERATE_TREEVIEW
<li> \refitem cfg_graphical_hierarchy GRAPHICAL_HIERARCHY <li> \refitem cfg_graphical_hierarchy GRAPHICAL_HIERARCHY
<li> \refitem cfg_have_dot HAVE_DOT <li> \refitem cfg_have_dot HAVE_DOT
<li> \refitem cfg_hide_scope_names HIDE_SCOPE_NAMES <li> \refitem cfg_hide_scope_names HIDE_SCOPE_NAMES
...@@ -162,6 +163,7 @@ followed by the descriptions of the tags grouped by category. ...@@ -162,6 +163,7 @@ followed by the descriptions of the tags grouped by category.
<li> \refitem cfg_strip_from_path STRIP_FROM_PATH <li> \refitem cfg_strip_from_path STRIP_FROM_PATH
<li> \refitem cfg_tab_size TAB_SIZE <li> \refitem cfg_tab_size TAB_SIZE
<li> \refitem cfg_tagfiles TAGFILES <li> \refitem cfg_tagfiles TAGFILES
<li> \refitem cfg_treeview_width TREEVIEW_WIDTH
<li> \refitem cfg_verbatim_headers VERBATIM_HEADERS <li> \refitem cfg_verbatim_headers VERBATIM_HEADERS
<li> \refitem cfg_warn_format WARN_FORMAT <li> \refitem cfg_warn_format WARN_FORMAT
<li> \refitem cfg_warn_if_undocumented WARN_IF_UNDOCUMENTED <li> \refitem cfg_warn_if_undocumented WARN_IF_UNDOCUMENTED
...@@ -737,6 +739,22 @@ followed by the descriptions of the tags grouped by category. ...@@ -737,6 +739,22 @@ followed by the descriptions of the tags grouped by category.
This tag can be used to set the number of enum values (range [1..20]) This tag can be used to set the number of enum values (range [1..20])
that doxygen will group on one line in the generated HTML documentation. that doxygen will group on one line in the generated HTML documentation.
\anchor cfg_generate_treeview
<dt>\c GENERATE_TREEVIEW <dd>
\addindex GENERATE_TREEVIEW
If the \c GENERATE_TREEVIEW tag is set to YES, a side pannel will be
generated containing a tree-like index structure (just like the one that
is generated for HTML Help). For this to work a browser that supports
JavaScript and frames is required (for instance Netscape 4.0+
or Internet explorer 4.0+).
\anchor cfg_treeview_width
<dt>\c TREEVIEW_WIDTH <dd>
\addindex TREEVIEW_WIDTH
If the treeview is enabled (see \c GENERATE_TREEVIEW) then this tag can be
used to set the initial width (in pixels) of the frame in which the tree
is shown.
</dl> </dl>
\subsection latex_output LaTeX related options \subsection latex_output LaTeX related options
\anchor cfg_generate_latex \anchor cfg_generate_latex
......
...@@ -151,7 +151,7 @@ Here is an example of a C header named \c structcmd.h that is documented ...@@ -151,7 +151,7 @@ Here is an example of a C header named \c structcmd.h that is documented
using structural commands: using structural commands:
\verbinclude structcmd.h \verbinclude structcmd.h
\htmlonly \htmlonly
Click <a href="$(DOXYGEN_DOCDIR)/examples/structcmd/html/structcmd.h.html">here</a> Click <a href="$(DOXYGEN_DOCDIR)/examples/structcmd/html/structcmd_h.html">here</a>
for the corresponding HTML documentation that is generated by doxygen. for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly \endhtmlonly
......
...@@ -169,8 +169,9 @@ Thanks go to: ...@@ -169,8 +169,9 @@ Thanks go to:
<li>Jens Breitenstein, Christophe Bordeaux, Samuel Hägglund, Xet Erixon, <li>Jens Breitenstein, Christophe Bordeaux, Samuel Hägglund, Xet Erixon,
Vlastimil Havran, Petr Prikryl, Ahmed Also Faisal, Alessandro Falappa, Vlastimil Havran, Petr Prikryl, Ahmed Also Faisal, Alessandro Falappa,
Kenji Nagamatsu, Francisco Oltra Thennet, Olli Korhonen, Kenji Nagamatsu, Francisco Oltra Thennet, Olli Korhonen,
Boris Bralo, Nickolay Semyonov, and Grzegorz Kowal for providing Boris Bralo, Nickolay Semyonov, Richard Kim, Földvári György,
translations into various languages. Grzegorz Kowal, and Wang Weihan
for providing translations into various languages.
<li>many, many others for suggestions, patches and bug reports. <li>many, many others for suggestions, patches and bug reports.
</ul> </ul>
*/ */
......
Name: doxygen Name: doxygen
Version: 1.2.3-20001126 Version: 1.2.3-20001203
Summary: documentation system for C, C++ and IDL Summary: documentation system for C, C++ and IDL
Release: 1 Release: 1
Source0: doxygen-%{version}.src.tar.gz Source0: doxygen-%{version}.src.tar.gz
......
// Empty leaves all features enabled. See doc/html/features.html for choices. // Everything
// Note that disabling some features will produce a libqt that is not
// compatible with other libqt builds. Such modifications are only
// supported on Qt/Embedded where reducing the library size is important
// and where the application-suite is often a fixed set.
#define QT_DLL // Internal
...@@ -183,7 +183,7 @@ int qstricmp( const char *str1, const char *str2 ) ...@@ -183,7 +183,7 @@ int qstricmp( const char *str1, const char *str2 )
int res; int res;
uchar c; uchar c;
if ( !s1 || !s2 ) if ( !s1 || !s2 )
return s1 == s1 ? 0 : (int)((long)s2 - (long)s1); return s1 == s2 ? 0 : (int)((long)s2 - (long)s1);
for ( ; !(res = (c=tolower(*s1)) - tolower(*s2)); s1++, s2++ ) for ( ; !(res = (c=tolower(*s1)) - tolower(*s2)); s1++, s2++ )
if ( !c ) // strings are equal if ( !c ) // strings are equal
break; break;
......
...@@ -355,7 +355,7 @@ bool QDate::setYMD( int y, int m, int d ) ...@@ -355,7 +355,7 @@ bool QDate::setYMD( int y, int m, int d )
} }
jd = greg2jul( y, m, d ); jd = greg2jul( y, m, d );
#if defined(DEBUG) #if defined(DEBUG)
ASSERT( year() == y && month() == m && day() == d ); ASSERT( year() == (y > 99 ? y : 1900+y) && month() == m && day() == d );
#endif #endif
return TRUE; return TRUE;
} }
......
...@@ -241,7 +241,7 @@ QDir::~QDir() ...@@ -241,7 +241,7 @@ QDir::~QDir()
is using a relative or an absolute file path. You can call the function is using a relative or an absolute file path. You can call the function
convertToAbs() to convert a relative QDir to an absolute one. convertToAbs() to convert a relative QDir to an absolute one.
\sa path(), absPath(), exists, cleanDirPath(), dirName(), \sa path(), absPath(), exists(), cleanDirPath(), dirName(),
absFilePath(), isRelative(), convertToAbs() absFilePath(), isRelative(), convertToAbs()
*/ */
...@@ -469,7 +469,6 @@ bool QDir::cdUp() ...@@ -469,7 +469,6 @@ bool QDir::cdUp()
/*! /*!
\fn QString QDir::nameFilter() const \fn QString QDir::nameFilter() const
Returns the string set by setNameFilter() Returns the string set by setNameFilter()
\sa setNameFilter()
*/ */
/*! /*!
...@@ -481,7 +480,7 @@ bool QDir::cdUp() ...@@ -481,7 +480,7 @@ bool QDir::cdUp()
".cpp" and all files ending with ".h", you simply call ".cpp" and all files ending with ".h", you simply call
dir.setNameFilter("*.cpp *.h") or dir.setNameFilter("*.cpp;*.h") dir.setNameFilter("*.cpp *.h") or dir.setNameFilter("*.cpp;*.h")
\sa nameFilter() \sa nameFilter(), setFilter()
*/ */
void QDir::setNameFilter( const QString &nameFilter ) void QDir::setNameFilter( const QString &nameFilter )
...@@ -495,7 +494,6 @@ void QDir::setNameFilter( const QString &nameFilter ) ...@@ -495,7 +494,6 @@ void QDir::setNameFilter( const QString &nameFilter )
/*! /*!
\fn QDir::FilterSpec QDir::filter() const \fn QDir::FilterSpec QDir::filter() const
Returns the value set by setFilter() Returns the value set by setFilter()
\sa setFilter()
*/ */
/*! \enum QDir::FilterSpec /*! \enum QDir::FilterSpec
...@@ -533,7 +531,8 @@ void QDir::setNameFilter( const QString &nameFilter ) ...@@ -533,7 +531,8 @@ void QDir::setNameFilter( const QString &nameFilter )
Sets the filter used by entryList() and entryInfoList(). The filter is used Sets the filter used by entryList() and entryInfoList(). The filter is used
to specify the kind of files that should be returned by entryList() and to specify the kind of files that should be returned by entryList() and
entryInfoList(). entryInfoList().
\sa nameFilter()
\sa filter(), setNameFilter()
*/ */
void QDir::setFilter( int filterSpec ) void QDir::setFilter( int filterSpec )
...@@ -1030,7 +1029,20 @@ QStringList qt_makeFilterList( const QString &filter ) ...@@ -1030,7 +1029,20 @@ QStringList qt_makeFilterList( const QString &filter )
QString s = *it; QString s = *it;
if ( s[ (int)s.length() - 1 ] == ';' ) if ( s[ (int)s.length() - 1 ] == ';' )
s.remove( s.length() - 1, 1 ); s.remove( s.length() - 1, 1 );
if ( s[0] == '\"' ) {
s.remove( 0, 1 );
while( ++it != lst.end() ) {
QString s2 = *it;
s += " "+s2;
if ( s2[(int)s2.length() -1] == '\"' ) {
s.remove( s.length() -1, 1 );
break;
}
}
}
lst2 << s; lst2 << s;
if ( it == lst.end() )
break;
} }
return lst2; return lst2;
} }
......
...@@ -243,6 +243,7 @@ bool QDir::readDirEntries( const QString &nameFilter, ...@@ -243,6 +243,7 @@ bool QDir::readDirEntries( const QString &nameFilter,
} }
// Sort... // Sort...
if(fiList->count()) {
QDirSortItem* si= new QDirSortItem[fiList->count()]; QDirSortItem* si= new QDirSortItem[fiList->count()];
QFileInfo* itm; QFileInfo* itm;
i=0; i=0;
...@@ -260,6 +261,7 @@ bool QDir::readDirEntries( const QString &nameFilter, ...@@ -260,6 +261,7 @@ bool QDir::readDirEntries( const QString &nameFilter,
} }
delete [] si; delete [] si;
fiList->setAutoDelete( TRUE ); fiList->setAutoDelete( TRUE );
}
if ( filterSpec == (FilterSpec)filtS && sortSpec == (SortSpec)sortS && if ( filterSpec == (FilterSpec)filtS && sortSpec == (SortSpec)sortS &&
nameFilter == nameFilt ) nameFilter == nameFilt )
......
...@@ -42,7 +42,29 @@ ...@@ -42,7 +42,29 @@
... ...
*/ */
// Qt ships with a number of pre-defined configurations. If none suit
// your needs, define QCONFIG_LOCAL and create a "qconfig-local.h" file.
//
// Note that disabling some features will produce a libqt that is not
// compatible with other libqt builds. Such modifications are only
// supported on Qt/Embedded where reducing the library size is important
// and where the application-suite is often a fixed set.
//
#if defined(QCONFIG_LOCAL)
#include <qconfig-local.h>
#elif defined(QCONFIG_QPE)
#include <qconfig-qpe.h>
#elif defined(QCONFIG_MINIMAL)
#include <qconfig-minimal.h>
#elif defined(QCONFIG_SMALL)
#include <qconfig-small.h>
#elif defined(QCONFIG_MEDIUM)
#include <qconfig-medium.h>
#elif defined(QCONFIG_LARGE)
#include <qconfig-large.h>
#else // everything...
#include <qconfig.h> #include <qconfig.h>
#endif
// Data structures // Data structures
...@@ -51,6 +73,13 @@ ...@@ -51,6 +73,13 @@
*/ */
//#define QT_NO_STRINGLIST //#define QT_NO_STRINGLIST
#if defined(QT_NO_IMAGE_SMOOTHSCALE)
/*!
QIconSet
*/
# define QT_NO_ICONSET
#endif
// File I/O // File I/O
#if defined(QT_NO_STRINGLIST) #if defined(QT_NO_STRINGLIST)
/*! /*!
...@@ -59,6 +88,11 @@ ...@@ -59,6 +88,11 @@
# define QT_NO_DIR # define QT_NO_DIR
#endif #endif
/*!
Palettes
*/
//#define QT_NO_PALETTE
/*! /*!
QTextStream QTextStream
*/ */
...@@ -68,6 +102,12 @@ ...@@ -68,6 +102,12 @@
*/ */
//#define QT_NO_DATASTREAM //#define QT_NO_DATASTREAM
/*!
Dynamic module linking
*/
//#define QT_NO_PLUGIN
// Images // Images
/*! /*!
BMP image I/O BMP image I/O
...@@ -196,50 +236,112 @@ ...@@ -196,50 +236,112 @@
# define QT_NO_UNICODETABLES # define QT_NO_UNICODETABLES
#endif #endif
// MIME-typed data
/*! /*!
MIME MIME
*/ */
#if defined(QT_NO_DIR) #if defined(QT_NO_DIR)
# define QT_NO_MIME # define QT_NO_MIME
#endif #endif
#if defined(QT_NO_MIME) || defined(QT_NO_TEXTSTREAM) #if defined(QT_NO_MIME) || defined(QT_NO_TEXTSTREAM) || defined(QT_NO_DRAWUTIL) || defined(QT_NO_IMAGE_SMOOTHSCALE)
/*! /*!
RichText (HTML) display RichText (HTML) display
*/ */
# define QT_NO_RICHTEXT # define QT_NO_RICHTEXT
#endif #endif
//XML /*!
XML
#if defined(QT_NO_STRINGLIST) */
#if defined(QT_NO_STRINGLIST) || defined(QT_NO_TEXTSTREAM) || defined(QT_NO_TEXTCODEC)
# define QT_NO_XML # define QT_NO_XML
#endif #endif
/*! Document Object Model */ /*!
#if defined(QT_NO_XML) ||defined(QT_NO_MIME) Document Object Model
*/
#if defined(QT_NO_XML) || defined(QT_NO_MIME)
# define QT_NO_DOM # define QT_NO_DOM
#endif #endif
// Sound // Sound
/*! /*!
QSound Playing sounds
*/ */
//#define QT_NO_SOUND //#define QT_NO_SOUND
// Scripting
/*! /*!
Properties Properties
*/ */
#if defined(QT_NO_STRINGLIST) #if defined(QT_NO_STRINGLIST) || defined(QT_NO_ICONSET)
# define QT_NO_PROPERTIES # define QT_NO_PROPERTIES
#endif #endif
// Networking
/*!
Network support
*/
//#define QT_NO_NETWORK
#if defined(QT_NO_NETWORK) || defined(QT_NO_STRINGLIST) || defined(QT_NO_TEXTSTREAM)
/*!
DNS
*/
# define QT_NO_DNS
#endif
/*!
Network file access
*/
#if defined(QT_NO_NETWORK) || defined(QT_NO_DIR) || defined(QT_NO_STRINGLIST)
# define QT_NO_NETWORKPROTOCOL
#endif
#if defined(QT_NO_NETWORKPROTOCOL) || defined(QT_NO_DNS)
/*!
FTP file access
*/
# define QT_NO_NETWORKPROTOCOL_FTP
/*!
HTTP file access
*/
# define QT_NO_NETWORKPROTOCOL_HTTP
#endif
/*!
External process invocation.
*/
//#define QT_NO_PROCESS
// Qt/Embedded-specific // Qt/Embedded-specific
#if defined(QT_NO_NETWORK)
/*!
Multi-process support.
*/
# define QT_NO_QWS_MULTIPROCESS
#endif
#if defined(QT_NO_QWS_MULTIPROCESS) || defined(QT_NO_DATASTREAM)
/*!
Palmtop Communication Protocol
*/
# define QT_NO_COP
#endif
/*!
Console keyboard support
*/
//#define QT_NO_QWS_KEYBOARD
/*! /*!
Visible cursor Visible cursor
*/ */
//#define QT_NO_QWS_CURSOR #if defined(QT_NO_CURSOR)
# define QT_NO_QWS_CURSOR
#endif
/*! /*!
Alpha-blended cursor Alpha-blended cursor
*/ */
...@@ -247,19 +349,24 @@ ...@@ -247,19 +349,24 @@
/*! /*!
Mach64 acceleration Mach64 acceleration
*/ */
#define QT_NO_QWS_MACH64 //#define QT_NO_QWS_MACH64
/*! /*!
Voodoo3 acceleration Voodoo3 acceleration
*/ */
#define QT_NO_QWS_VOODOO3 //#define QT_NO_QWS_VOODOO3
/*! /*!
Matrox MGA acceleration (Millennium/Millennium II/Mystique/G200/G400) Matrox MGA acceleration (Millennium/Millennium II/Mystique/G200/G400)
*/ */
#define QT_NO_QWS_MATROX //#define QT_NO_QWS_MATROX
/*! /*!
Virtual frame buffer Virtual frame buffer
*/ */
//#define QT_NO_QWS_VFB //#define QT_NO_QWS_VFB
/*!
Transformed frame buffer
*/
//#define QT_NO_QWS_TRANSFORMED
/*! /*!
Remote frame buffer (VNC) Remote frame buffer (VNC)
*/ */
...@@ -270,9 +377,13 @@ ...@@ -270,9 +377,13 @@
//#define QT_NO_QWS_DEPTH_1 //#define QT_NO_QWS_DEPTH_1
/*! /*!
4-bit VGA 4-bit VGA
Not yet implemented
*/ */
#define QT_NO_QWS_VGA_16 //#define QT_NO_QWS_VGA_16
/*!
SVGALib Support
Not implemented yet
*/
#define QT_NO_QWS_SVGALIB
/*! /*!
8-bit grayscale 8-bit grayscale
*/ */
...@@ -282,11 +393,7 @@ ...@@ -282,11 +393,7 @@
*/ */
//#define QT_NO_QWS_DEPTH_8 //#define QT_NO_QWS_DEPTH_8
/*! /*!
15-bit color 15 or 16-bit color (define QT_QWS_DEPTH16_RGB as 555 for 15-bit)
*/
#define QT_NO_QWS_DEPTH_15
/*!
16-bit color
*/ */
//#define QT_NO_QWS_DEPTH_16 //#define QT_NO_QWS_DEPTH_16
/*! /*!
...@@ -302,7 +409,7 @@ ...@@ -302,7 +409,7 @@
/*! /*!
Saving of fonts Saving of fonts
*/ */
#define QT_NO_QWS_SAVEFONTS //#define QT_NO_QWS_SAVEFONTS
/*! /*!
Favour code size over graphics speed Favour code size over graphics speed
...@@ -316,8 +423,10 @@ ...@@ -316,8 +423,10 @@
*/ */
//#define QT_NO_QWS_PROPERTIES //#define QT_NO_QWS_PROPERTIES
#if defined(QT_NO_QWS_PROPERTIES) || defined(QT_NO_MIME) && !defined(_WS_QWS_) #if defined(QT_NO_QWS_PROPERTIES) || defined(QT_NO_MIME)
/*! Cut and paste */ /*!
Cut and paste
*/
# define QT_NO_CLIPBOARD # define QT_NO_CLIPBOARD
#endif #endif
...@@ -328,6 +437,13 @@ ...@@ -328,6 +437,13 @@
# define QT_NO_DRAGANDDROP # define QT_NO_DRAGANDDROP
#endif #endif
#if defined(QT_NO_PROPERTIES)
/*!
SQL
*/
# define QT_NO_SQL
#endif
#if defined(QT_NO_CLIPBOARD) || defined(QT_NO_MIME) || defined(_WS_QWS_) #if defined(QT_NO_CLIPBOARD) || defined(QT_NO_MIME) || defined(_WS_QWS_)
/*! /*!
Cut and paste of complex data types (non-text) Cut and paste of complex data types (non-text)
...@@ -362,36 +478,10 @@ ...@@ -362,36 +478,10 @@
*/ */
# define QT_NO_IMAGE_16_BIT # define QT_NO_IMAGE_16_BIT
#endif #endif
#if defined(QT_NO_QWS_CURSOR) && defined(_WS_QWS_)
/*!
Cursors
*/
# define QT_NO_CURSOR
#endif
// Networking
/*! /*!
DNS Cursors
*/
//#define QT_NO_DNS
/*!
Network file access
*/ */
#if defined(QT_NO_DIR) || defined(QT_NO_STRINGLIST) //#define QT_NO_CURSOR
# define QT_NO_NETWORKPROTOCOL
#endif
#if defined(QT_NO_NETWORKPROTOCOL) || defined(QT_NO_DNS)
/*!
FTP file access
*/
# define QT_NO_NETWORKPROTOCOL_FTP
/*!
HTTP file access
*/
# define QT_NO_NETWORKPROTOCOL_HTTP
#endif
// Painting // Painting
/*! /*!
...@@ -403,7 +493,6 @@ ...@@ -403,7 +493,6 @@
*/ */
//#define QT_NO_TRANSFORMATIONS //#define QT_NO_TRANSFORMATIONS
// Printing
/*! /*!
Printing Printing
*/ */
...@@ -411,7 +500,6 @@ ...@@ -411,7 +500,6 @@
# define QT_NO_PRINTER # define QT_NO_PRINTER
#endif #endif
// Metafiles
/*! /*!
QPicture QPicture
*/ */
...@@ -426,64 +514,266 @@ ...@@ -426,64 +514,266 @@
//#define QT_NO_LAYOUT //#define QT_NO_LAYOUT
// Widgets // Widgets
#if defined(QT_NO_DRAWUTIL) || defined(QT_NO_PALETTE)
/*! /*!
QStyle QStyle
*/ */
//#define QT_NO_STYLE # define QT_NO_STYLE
#endif
#if defined QT_NO_IMAGE_SMOOTHSCALE
/*!
QIconSet
*/
# define QT_NO_ICONSET
#endif
/*! /*!
QDialog Dialogs
*/ */
//#define QT_NO_DIALOG //#define QT_NO_DIALOG
/*! /*!
QSemiModal Semi-modal dialogs
*/ */
//#define QT_NO_SEMIMODAL //#define QT_NO_SEMIMODAL
/*! /*!
QFrame Framed widgets
*/ */
//#define QT_NO_FRAME //#define QT_NO_FRAME
#if defined(QT_NO_FRAME) ||defined(QT_NO_PALETTE) || defined(QT_NO_STYLE) ||defined(QT_NO_DRAWUTIL) /*!
/*! Special widget effects (fading, scrolling)
Basic widgets: QLAbel, QPushbutton, ... */
*/ //#define QT_NO_EFFECTS
# define QT_NO_SIMPLEWIDGETS
#endif
#if defined(QT_NO_SIMPLEWIDGETS)
/*! /*!
QLabel QLabel
*/ */
#ifdef QT_NO_FRAME
# define QT_NO_LABEL # define QT_NO_LABEL
/*! #endif
QPushButton (not implemented).
*/ /*!
# define QT_NO_PUSHBUTTON Toolbars
/*! */
QLineEdit (not implemented). #ifdef QT_NO_LAYOUT
*/ # define QT_NO_TOOLBAR
#endif
/*!
Buttons
*/
#if defined(QT_NO_BUTTON) || defined(QT_NO_STYLE)
/*!
Check-boxes
*/
# define QT_NO_CHECKBOX
/*!
Radio-buttons
*/
# define QT_NO_RADIOBUTTON
#endif
#if defined(QT_NO_BUTTON) || defined(QT_NO_TOOLBAR) || defined(QT_NO_ICONSET)
/*!
Tool-buttons
*/
# define QT_NO_TOOLBUTTON
#endif
/*!
Grid layout widgets
*/
#ifdef QT_NO_FRAME
# define QT_NO_GRID
#endif
/*!
Group boxes
*/
#ifdef QT_NO_FRAME
# define QT_NO_GROUPBOX
#endif
#if defined(QT_NO_GROUPBOX)
/*!
Button groups
*/
# define QT_NO_BUTTONGROUP
/*!
Horizontal group boxes
*/
# define QT_NO_HGROUPBOX
#endif
#if defined(QT_NO_HGROUPBOX)
/*!
Vertical group boxes
*/
# define QT_NO_VGROUPBOX
#endif
#if defined(QT_NO_BUTTONGROUP)
/*!
Horizontal button groups
*/
# define QT_NO_HBUTTONGROUP
#endif
#if defined(QT_NO_HBUTTONGROUP)
/*!
Vertical button groups
*/
# define QT_NO_VBUTTONGROUP
#endif
/*!
Horizonal box layout widgets
*/
#ifdef QT_NO_FRAME
# define QT_NO_HBOX
#endif
#if defined(QT_NO_HBOX)
/*!
Vertical box layout widgets
*/
# define QT_NO_VBOX
#endif
/*!
Single-line edits
*/
#if defined(QT_NO_PALETTE)
# define QT_NO_LINEEDIT # define QT_NO_LINEEDIT
#endif #endif
#if defined(QT_NO_ICONSET) || defined(QT_NO_IMAGE_SMOOTHSCALE) || defined(QT_NO_SIMPLEWIDGETS) #if defined(QT_NO_TOOLBAR)
/*! /*!
Pre-defined complex widgets Main-windows
*/ */
# define QT_NO_COMPLEXWIDGETS # define QT_NO_MAINWINDOW
#endif
#if defined(QT_NO_ICONSET)
/*!
Menu-like widgets
*/
# define QT_NO_MENUDATA
#endif
#if defined(QT_NO_MENUDATA)
/*!
Popup-menus
*/
# define QT_NO_POPUPMENU
/*!
Menu bars
*/
# define QT_NO_MENUBAR
#endif
#if defined(QT_NO_BUTTON) || defined(QT_NO_ICONSET) || defined(QT_NO_POPUPMENU)
/*!
Push-buttons
*/
# define QT_NO_PUSHBUTTON
#endif
/*!
Progress bars
*/
#ifdef QT_NO_FRAME
# define QT_NO_PROGRESSBAR
#endif
/*!
Range-control widgets
*/
//#define QT_NO_RANGECONTROL
#if defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE)
/*!
Scroll bars
*/
# define QT_NO_SCROLLBAR
/*!
Sliders
*/
# define QT_NO_SLIDER
/*!
Spin boxes
*/
# define QT_NO_SPINBOX
/*!
Dials
*/
# define QT_NO_DIAL
#endif
#if defined(QT_NO_SCROLLBAR) || defined(QT_NO_FRAME)
/*!
Scrollable view widgets
*/
# define QT_NO_SCROLLVIEW
#endif
#if defined(QT_NO_SCROLLVIEW)
/*!
QCanvas
*/
# define QT_NO_CANVAS
/*!
QIconView
*/
# define QT_NO_ICONVIEW
#endif #endif
#if defined(QT_NO_COMPLEXWIDGETS) || defined(QT_NO_RICHTEXT)
#if defined(QT_NO_SCROLLBAR)
/*!
Table-like widgets
*/
# define QT_NO_TABLEVIEW
#endif
#if defined(QT_NO_TABLEVIEW)
/*!
Multi-line edits
*/
# define QT_NO_MULTILINEEDIT
#endif
/*!
Splitters
*/
#ifdef QT_NO_FRAME
# define QT_NO_SPLITTER
#endif
/*!
Status bars
*/
#ifdef QT_NO_LAYOUT
# define QT_NO_STATUSBAR
#endif
/*!
Tab-bars
*/
#if defined(QT_NO_ICONSET)
# define QT_NO_TABBAR
#endif
#if defined(QT_NO_TABBAR)
/*!
Tab widgets
*/
# define QT_NO_TABWIDGET
#endif
/*!
Tool tips
*/
#if defined( QT_NO_LABEL ) || defined( QT_NO_PALETTE )
# define QT_NO_TOOLTIP
#endif
/*!
Input validators
*/
//#define QT_NO_VALIDATOR
/*!
"What's this" help
*/
#if defined( QT_NO_TOOLTIP )
# define QT_NO_WHATSTHIS
#endif
/*!
Widget stacks
*/
#ifdef QT_NO_FRAME
# define QT_NO_WIDGETSTACK
#endif
#if defined(QT_NO_RICHTEXT) || defined(QT_NO_SCROLLVIEW)
/*! /*!
QTextView QTextView
*/ */
# define QT_NO_TEXTVIEW # define QT_NO_TEXTVIEW
#endif #endif
#if defined(QT_NO_TEXTVIEW) #if defined(QT_NO_TEXTVIEW)
/*! /*!
QTextBrowser QTextBrowser
...@@ -503,84 +793,74 @@ ...@@ -503,84 +793,74 @@
#endif #endif
#if defined(QT_NO_STYLE_MOTIF) #if defined(QT_NO_STYLE_MOTIF)
/*!
Motif-plus style
*/
# define QT_NO_STYLE_MOTIFPLUS # define QT_NO_STYLE_MOTIFPLUS
#endif #endif
#if defined(QT_NO_COMPLEXWIDGETS) || defined(QT_NO_STRINGLIST) #if defined(QT_NO_SCROLLVIEW) || defined(QT_NO_STRINGLIST)
/*! /*!
QListBox QListBox
*/ */
# define QT_NO_LISTBOX # define QT_NO_LISTBOX
#endif #endif
#if defined(QT_NO_COMPLEXWIDGETS) /*!
/*!
QAccel QAccel
*/ */
# define QT_NO_ACCEL //#define QT_NO_ACCEL
/*! /*!
QSizeGrip QSizeGrip
*/ */
#ifdef QT_NO_PALETTE
# define QT_NO_SIZEGRIP # define QT_NO_SIZEGRIP
/*! #endif
/*!
QHeader QHeader
*/ */
#ifdef QT_NO_ICONSET
# define QT_NO_HEADER # define QT_NO_HEADER
/*! #endif
QMenuBar /*!
*/
# define QT_NO_MENUBAR
/*!
QCanvas
*/
# define QT_NO_CANVAS
/*!
QDial
*/
# define QT_NO_DIAL
/*!
QWorkSpace QWorkSpace
*/ */
#ifdef QT_NO_FRAME
# define QT_NO_WORKSPACE # define QT_NO_WORKSPACE
/*! #endif
/*!
QLCDNumber QLCDNumber
*/ */
#ifdef QT_NO_FRAME
# define QT_NO_LCDNUMBER # define QT_NO_LCDNUMBER
/*! #endif
/*!
QAction QAction
*/ */
# define QT_NO_ACTION //#define QT_NO_ACTION
#if defined(QT_NO_HEADER)
/*! /*!
QTable QTable
*/ */
# define QT_NO_TABLE # define QT_NO_TABLE
#endif #endif
#if defined(QT_NO_LISTBOX) || defined(QT_NO_COMPLEXWIDGETS)
#if defined(QT_NO_LISTBOX)
/*! /*!
QComboBox QComboBox
*/ */
# define QT_NO_COMBOBOX # define QT_NO_COMBOBOX
#endif #endif
#if defined(QT_NO_COMPLEXWIDGETS)
/*! #if defined(QT_NO_HEADER) || defined(QT_NO_SCROLLVIEW)
QIconView
*/
# define QT_NO_ICONVIEW
#endif
#if defined(QT_NO_HEADER)
/*! /*!
QListView QListView
*/ */
# define QT_NO_LISTVIEW # define QT_NO_LISTVIEW
#endif #endif
#if defined(QT_NO_COMPLEXWIDGETS) || defined(QT_NO_DIALOG)
/*!
Built-in dialogs
*/
# define QT_NO_DIALOGS
#endif
#if defined(QT_NO_STYLE_WINDOWS) #if defined(QT_NO_STYLE_WINDOWS)
/*! /*!
...@@ -589,7 +869,7 @@ ...@@ -589,7 +869,7 @@
# define QT_NO_STYLE_COMPACT # define QT_NO_STYLE_COMPACT
#endif #endif
#if defined(QT_NO_STYLE_MOTIF) #if defined(QT_NO_STYLE_MOTIF) || defined(QT_NO_TRANSFORMATIONS)
/*! /*!
CDE style CDE style
*/ */
...@@ -606,53 +886,60 @@ ...@@ -606,53 +886,60 @@
# define QT_NO_STYLE_PLATINUM # define QT_NO_STYLE_PLATINUM
#endif #endif
#if defined(QT_NO_DIALOGS) /*!
/*!
QColorDialog QColorDialog
*/ */
#if defined(QT_NO_LAYOUT) || defined(QT_NO_LABEL) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_DIALOG)
# define QT_NO_COLORDIALOG # define QT_NO_COLORDIALOG
/*! #endif
#if defined(QT_NO_DIALOG)
/*!
QMessageBox QMessageBox
*/ */
# define QT_NO_MESSAGEBOX # define QT_NO_MESSAGEBOX
/*! #endif
#if defined(QT_NO_DIALOG) || defined(QT_NO_TABBAR)
/*!
QTabDialog QTabDialog
*/ */
# define QT_NO_TABDIALOG #define QT_NO_TABDIALOG
/*! #endif
#if defined(QT_NO_DIALOG)
/*!
QWizard QWizard
*/ */
# define QT_NO_WIZARD # define QT_NO_WIZARD
#endif #endif
#if defined(QT_NO_DIALOGS) || defined(QT_NO_LISTVIEW) || defined(QT_NO_NETWORKPROTOCOL) || defined(QT_NO_COMBOBOX) || defined(QT_NO_DIR) || defined(QT_NO_MESSAGEBOX) #if defined(QT_NO_DIALOG) || defined(QT_NO_LISTVIEW) || defined(QT_NO_NETWORKPROTOCOL) || defined(QT_NO_COMBOBOX) || defined(QT_NO_DIR) || defined(QT_NO_MESSAGEBOX) || defined(QT_NO_SEMIMODAL)
/*! /*!
QFileDialog QFileDialog
*/ */
# define QT_NO_FILEDIALOG # define QT_NO_FILEDIALOG
#endif #endif
#if defined(QT_NO_DIALOGS) || defined(QT_NO_FONTDATABASE) || defined(QT_NO_COMBOBOX) #if defined(QT_NO_DIALOG) || defined(QT_NO_FONTDATABASE) || defined(QT_NO_COMBOBOX)
/*! /*!
QFontDialog QFontDialog
*/ */
# define QT_NO_FONTDIALOG # define QT_NO_FONTDIALOG
#endif #endif
#if defined(QT_NO_DIALOGS) || defined(QT_NO_LISTVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_COMBOBOX) || defined(QT_NO_DIR) #if defined(QT_NO_DIALOG) || defined(QT_NO_LISTVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_COMBOBOX) || defined(QT_NO_DIR) || defined(QT_NO_LAYOUT) || defined(QT_NO_LABEL)
/*! /*!
QPrintDialog QPrintDialog
*/ */
# define QT_NO_PRINTDIALOG # define QT_NO_PRINTDIALOG
#endif #endif
#if defined(QT_NO_DIALOGS) || defined(QT_NO_SEMIMODAL) #if defined(QT_NO_SEMIMODAL)
/*! /*!
QProgressDialog QProgressDialog
*/ */
# define QT_NO_PROGRESSDIALOG # define QT_NO_PROGRESSDIALOG
#endif #endif
#if defined(QT_NO_DIALOGS) || defined(QT_NO_COMBOBOX) #if defined(QT_NO_DIALOG) || defined(QT_NO_COMBOBOX)
/*! /*!
QInputDialog QInputDialog
*/ */
...@@ -660,12 +947,10 @@ ...@@ -660,12 +947,10 @@
#endif #endif
#if defined(QT_NO_STRINGLIST) #if defined(QT_NO_STRINGLIST)
// Desktop features /*!
/*! Session management support */ Session management support
*/
# define QT_NO_SESSIONMANAGER # define QT_NO_SESSIONMANAGER
#endif #endif
/*! Special widget effects (fading, scrolling) */
//#define QT_NO_EFFECTS
#endif // QFEATURES_H #endif // QFEATURES_H
...@@ -236,7 +236,7 @@ bool QFile::open( int m ) ...@@ -236,7 +236,7 @@ bool QFile::open( int m )
} else { } else {
length = (int)st.st_size; length = (int)st.st_size;
ioIndex = (flags() & IO_Append) == 0 ? 0 : length; ioIndex = (flags() & IO_Append) == 0 ? 0 : length;
if ( (flags() & !IO_Truncate) && length == 0 && isReadable() ) { if ( !(flags()&IO_Truncate) && length == 0 && isReadable() ) {
// try if you can read from it (if you can, it's a sequential // try if you can read from it (if you can, it's a sequential
// device; e.g. a file in the /proc filesystem) // device; e.g. a file in the /proc filesystem)
int c = getch(); int c = getch();
...@@ -300,13 +300,13 @@ bool QFile::open( int m, FILE *f ) ...@@ -300,13 +300,13 @@ bool QFile::open( int m, FILE *f )
STATBUF st; STATBUF st;
FSTAT( FILENO(fh), &st ); FSTAT( FILENO(fh), &st );
ioIndex = (int)ftell( fh ); ioIndex = (int)ftell( fh );
if ( (st.st_mode & STAT_MASK) != STAT_REG ) { if ( (st.st_mode & STAT_MASK) != STAT_REG || f == stdin ) { //stdin is non seekable
// non-seekable // non-seekable
setType( IO_Sequential ); setType( IO_Sequential );
length = INT_MAX; length = INT_MAX;
} else { } else {
length = (int)st.st_size; length = (int)st.st_size;
if ( (flags() & !IO_Truncate) && length == 0 && isReadable() ) { if ( !(flags()&IO_Truncate) && length == 0 && isReadable() ) {
// try if you can read from it (if you can, it's a sequential // try if you can read from it (if you can, it's a sequential
// device; e.g. a file in the /proc filesystem) // device; e.g. a file in the /proc filesystem)
int c = getch(); int c = getch();
...@@ -350,7 +350,7 @@ bool QFile::open( int m, int f ) ...@@ -350,7 +350,7 @@ bool QFile::open( int m, int f )
STATBUF st; STATBUF st;
FSTAT( fd, &st ); FSTAT( fd, &st );
ioIndex = (int)LSEEK(fd, 0, SEEK_CUR); ioIndex = (int)LSEEK(fd, 0, SEEK_CUR);
if ( (st.st_mode & STAT_MASK) != STAT_REG ) { if ( (st.st_mode & STAT_MASK) != STAT_REG || f == 0 ) { // stdin is not seekable...
// non-seekable // non-seekable
setType( IO_Sequential ); setType( IO_Sequential );
length = INT_MAX; length = INT_MAX;
...@@ -365,6 +365,7 @@ bool QFile::open( int m, int f ) ...@@ -365,6 +365,7 @@ bool QFile::open( int m, int f )
setType( IO_Sequential ); setType( IO_Sequential );
length = INT_MAX; length = INT_MAX;
} }
resetStatus();
} }
} }
return TRUE; return TRUE;
...@@ -466,20 +467,33 @@ int QFile::readBlock( char *p, uint len ) ...@@ -466,20 +467,33 @@ int QFile::readBlock( char *p, uint len )
return -1; return -1;
} }
#endif #endif
int nread; // number of bytes read int nread = 0; // number of bytes read
if ( !ungetchBuffer.isEmpty() ) {
// need to add these to the returned string.
int l = ungetchBuffer.length();
while( nread < l ) {
*p = ungetchBuffer[ l - nread - 1 ];
p++;
nread++;
}
ungetchBuffer.truncate( l - nread );
}
if ( nread < (int)len ) {
if ( isRaw() ) { // raw file if ( isRaw() ) { // raw file
nread = READ( fd, p, len ); nread += READ( fd, p, len-nread );
if ( len && nread <= 0 ) { if ( len && nread <= 0 ) {
nread = 0; nread = 0;
setStatus(IO_ReadError); setStatus(IO_ReadError);
} }
} else { // buffered file } else { // buffered file
nread = fread( p, 1, len, fh ); nread += fread( p, 1, len-nread, fh );
if ( (uint)nread != len ) { if ( (uint)nread != len ) {
if ( ferror( fh ) || nread==0 ) if ( ferror( fh ) || nread==0 )
setStatus(IO_ReadError); setStatus(IO_ReadError);
} }
} }
}
ioIndex += nread; ioIndex += nread;
return nread; return nread;
} }
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
#define QGLOBAL_H #define QGLOBAL_H
#define QT_VERSION 220 #define QT_VERSION 222
#define QT_VERSION_STR "2.2.0" #define QT_VERSION_STR "2.2.2"
// //
...@@ -98,9 +98,6 @@ ...@@ -98,9 +98,6 @@
#define _OS_RELIANTUNIX_ #define _OS_RELIANTUNIX_
#elif defined(linux) || defined(__linux) || defined(__linux__) #elif defined(linux) || defined(__linux) || defined(__linux__)
#define _OS_LINUX_ #define _OS_LINUX_
#if defined(__alpha__) || defined(__alpha)
#define _OS_ALPHA_LINUX_
#endif
#elif defined(__FreeBSD__) #elif defined(__FreeBSD__)
#define _OS_FREEBSD_ #define _OS_FREEBSD_
#elif defined(__NetBSD__) #elif defined(__NetBSD__)
...@@ -153,18 +150,19 @@ ...@@ -153,18 +150,19 @@
// //
// SYM - Symantec C++ for both PC and Macintosh // SYM - Symantec C++ for both PC and Macintosh
// MPW - MPW C++ // MPW - MPW C++
// MWERKS - Metroworks CodeWarrior // MWERKS - Metrowerks CodeWarrior
// MSVC - Microsoft Visual C/C++ // MSVC - Microsoft Visual C/C++
// BOR - Borland/Turbo C++ // BOR - Borland/Turbo C++
// WAT - Watcom C++ // WAT - Watcom C++
// GNU - GNU C++ // GNU - GNU C++
// COMEAU - Comeau C++ // COMEAU - Comeau C++
// EDG - Edison Design Group C++ // EDG - Edison Design Group C++
// OC - CenterLine ObjectCenter C++ // OC - CenterLine C++
// SUN - Sun C++ // SUN - Sun C++
// DEC - DEC C++ // DEC - DEC C++
// HP - HPUX C++ // HP - HPUX C++
// USLC - SCO UnixWare C++ // USLC - SCO UnixWare7 C++
// CDS - Reliant C++
// KAI - KAI C++ // KAI - KAI C++
// //
...@@ -175,6 +173,7 @@ ...@@ -175,6 +173,7 @@
#define _CC_SYM_ #define _CC_SYM_
#elif defined( __KCC ) #elif defined( __KCC )
#define _CC_KAI_ #define _CC_KAI_
#define _CC_EDG_
#define Q_HAS_BOOL_TYPE #define Q_HAS_BOOL_TYPE
#elif defined(applec) #elif defined(applec)
#define _CC_MPW_ #define _CC_MPW_
...@@ -196,6 +195,9 @@ ...@@ -196,6 +195,9 @@
#define Q_TEMPLATE_NEEDS_EXPLICIT_CONVERSION #define Q_TEMPLATE_NEEDS_EXPLICIT_CONVERSION
#define Q_SPURIOUS_NON_VOID_WARNING #define Q_SPURIOUS_NON_VOID_WARNING
#endif #endif
#if __GNUC__ == 2 && __GNUC_MINOR__ >= 95
#define Q_DELETING_VOID_UNDEFINED
#endif
#if __GNUC__ == 2 && __GNUC_MINOR__ >= 96 #if __GNUC__ == 2 && __GNUC_MINOR__ >= 96
#define Q_DELETING_VOID_UNDEFINED #define Q_DELETING_VOID_UNDEFINED
#define Q_FP_CCAST_BROKEN #define Q_FP_CCAST_BROKEN
...@@ -206,9 +208,17 @@ ...@@ -206,9 +208,17 @@
#elif defined(__xlC__) #elif defined(__xlC__)
#define _CC_XLC_ #define _CC_XLC_
#define Q_FULL_TEMPLATE_INSTANTIATION #define Q_FULL_TEMPLATE_INSTANTIATION
#if __xlC__ >= 0x400
#define Q_HAS_BOOL_TYPE
#endif
#if __xlC__ <= 0x0306
#define Q_TEMPLATE_NEEDS_EXPLICIT_CONVERSION
#endif
#elif defined(como40) #elif defined(como40)
#define _CC_EDG_ #define _CC_EDG_
#define _CC_COMEAU_ #define _CC_COMEAU_
#define Q_HAS_BOOL_TYPE
#define Q_C_CALLBACKS
#elif defined(__USLC__) #elif defined(__USLC__)
#define _CC_USLC_ #define _CC_USLC_
#ifdef __EDG__ // UnixWare7 #ifdef __EDG__ // UnixWare7
...@@ -216,19 +226,24 @@ ...@@ -216,19 +226,24 @@
#endif #endif
#elif defined(__EDG) || defined(__EDG__) #elif defined(__EDG) || defined(__EDG__)
// one observed on SGI DCC, the other documented // one observed on SGI DCC, the other documented
#define Q_HAS_BOOL_TYPE
#define _CC_EDG_ #define _CC_EDG_
#elif defined(OBJECTCENTER) || defined(CENTERLINE_CLPP) #elif defined(OBJECTCENTER) || defined(CENTERLINE_CLPP)
#define _CC_OC_ #define _CC_OC_
#if defined(_BOOL)
#define Q_HAS_BOOL_TYPE
#endif
#elif defined(__SUNPRO_CC) #elif defined(__SUNPRO_CC)
#define _CC_SUN_ #define _CC_SUN_
#if __SUNPRO_CC >= 0x500 #if __SUNPRO_CC >= 0x500
#define Q_HAS_BOOL_TYPE #define Q_HAS_BOOL_TYPE
#define Q_SPARCWORKS_FUNCP_BUG #define Q_FP_CCAST_BROKEN
#define Q_C_CALLBACKS #define Q_C_CALLBACKS
#endif #endif
#elif defined(__DECCXX) #elif defined(__DECCXX)
#define _CC_DEC_ #define _CC_DEC_
#if __DECCXX_VER >= 60060005
#define Q_HAS_BOOL_TYPE
#endif
#elif defined(__CDS__) #elif defined(__CDS__)
#define _CC_CDS_ #define _CC_CDS_
#define Q_HAS_BOOL_TYPE #define Q_HAS_BOOL_TYPE
...@@ -248,10 +263,6 @@ ...@@ -248,10 +263,6 @@
#error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com" #error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com"
#endif #endif
#if defined(_CC_COMEAU_)
#define Q_C_CALLBACKS
#endif
#ifndef Q_PACKED #ifndef Q_PACKED
#define Q_PACKED #define Q_PACKED
#endif #endif
...@@ -302,13 +313,7 @@ ...@@ -302,13 +313,7 @@
#define Q_HAS_BOOL_TYPE #define Q_HAS_BOOL_TYPE
#elif _MSC_VER >= 1100 || __BORLANDC__ >= 0x500 #elif _MSC_VER >= 1100 || __BORLANDC__ >= 0x500
#define Q_HAS_BOOL_TYPE #define Q_HAS_BOOL_TYPE
#elif defined(_CC_COMEAU_) #elif defined(sgi) && defined(_BOOL)
#define Q_HAS_BOOL_TYPE
#elif defined(sgi) && ( (_COMPILER_VERSION >= 710) || defined(_BOOL) )
#define Q_HAS_BOOL_TYPE
#elif defined(__DECCXX) && (__DECCXX_VER >= 60060005)
#define Q_HAS_BOOL_TYPE
#elif defined(_AIX) && (__xlC__ >= 0x500)
#define Q_HAS_BOOL_TYPE #define Q_HAS_BOOL_TYPE
#endif #endif
...@@ -478,6 +483,8 @@ Q_EXPORT bool qSysInfo( int *wordSize, bool *bigEndian ); ...@@ -478,6 +483,8 @@ Q_EXPORT bool qSysInfo( int *wordSize, bool *bigEndian );
#pragma warning(disable: 4275) #pragma warning(disable: 4275)
#pragma warning(disable: 4514) #pragma warning(disable: 4514)
#pragma warning(disable: 4800) #pragma warning(disable: 4800)
#pragma warning(disable: 4097)
#pragma warning(disable: 4706)
#elif defined(_CC_BOR_) #elif defined(_CC_BOR_)
#pragma option -w-inl #pragma option -w-inl
#pragma option -w-aus #pragma option -w-aus
......
...@@ -425,8 +425,10 @@ void QIODevice::setStatus( int s ) ...@@ -425,8 +425,10 @@ void QIODevice::setStatus( int s )
<li>\c IO_Append sets the file index to the end of the file. <li>\c IO_Append sets the file index to the end of the file.
<li>\c IO_Truncate truncates the file. <li>\c IO_Truncate truncates the file.
<li>\c IO_Translate enables carriage returns and linefeed translation <li>\c IO_Translate enables carriage returns and linefeed translation
for text files under MS-DOS, Window, OS/2 and Macintosh. Cannot be for text files under MS-DOS, Window, OS/2 and Macintosh. On Unix systems
combined with \c IO_Raw. this flag has no effect. Use with caution as it will also transform every linefeed
written to the file into a CRLF pair. This is likely to corrupt your file when
writing binary data to it. Cannot be combined with \c IO_Raw.
</ul> </ul>
This virtual function must be reimplemented by all subclasses. This virtual function must be reimplemented by all subclasses.
......
...@@ -105,7 +105,6 @@ template<class type> inline void QList<type>::deleteItem( QCollection::Item d ) ...@@ -105,7 +105,6 @@ template<class type> inline void QList<type>::deleteItem( QCollection::Item d )
} }
template<class type> class Q_EXPORT QListIterator : public QGListIterator template<class type> class Q_EXPORT QListIterator : public QGListIterator
{ {
public: public:
......
/****************************************************************************
**
**
** Implementation of QMap
**
** Created : 990406
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of the tools module of the Qt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "qmap.h"
typedef QMapNodeBase* NodePtr;
typedef QMapNodeBase Node;
void QMapPrivateBase::rotateLeft( NodePtr x, NodePtr& root)
{
NodePtr y = x->right;
x->right = y->left;
if (y->left !=0)
y->left->parent = x;
y->parent = x->parent;
if (x == root)
root = y;
else if (x == x->parent->left)
x->parent->left = y;
else
x->parent->right = y;
y->left = x;
x->parent = y;
}
void QMapPrivateBase::rotateRight( NodePtr x, NodePtr& root )
{
NodePtr y = x->left;
x->left = y->right;
if (y->right != 0)
y->right->parent = x;
y->parent = x->parent;
if (x == root)
root = y;
else if (x == x->parent->right)
x->parent->right = y;
else
x->parent->left = y;
y->right = x;
x->parent = y;
}
void QMapPrivateBase::rebalance( NodePtr x, NodePtr& root)
{
x->color = Node::Red;
while ( x != root && x->parent->color == Node::Red ) {
if ( x->parent == x->parent->parent->left ) {
NodePtr y = x->parent->parent->right;
if (y && y->color == Node::Red) {
x->parent->color = Node::Black;
y->color = Node::Black;
x->parent->parent->color = Node::Red;
x = x->parent->parent;
} else {
if (x == x->parent->right) {
x = x->parent;
rotateLeft( x, root );
}
x->parent->color = Node::Black;
x->parent->parent->color = Node::Red;
rotateRight (x->parent->parent, root );
}
} else {
NodePtr y = x->parent->parent->left;
if ( y && y->color == Node::Red ) {
x->parent->color = Node::Black;
y->color = Node::Black;
x->parent->parent->color = Node::Red;
x = x->parent->parent;
} else {
if (x == x->parent->left) {
x = x->parent;
rotateRight( x, root );
}
x->parent->color = Node::Black;
x->parent->parent->color = Node::Red;
rotateLeft( x->parent->parent, root );
}
}
}
root->color = Node::Black;
}
NodePtr QMapPrivateBase::removeAndRebalance( NodePtr z, NodePtr& root,
NodePtr& leftmost,
NodePtr& rightmost )
{
NodePtr y = z;
NodePtr x;
NodePtr x_parent;
if (y->left == 0) {
x = y->right;
} else {
if (y->right == 0)
x = y->left;
else
{
y = y->right;
while (y->left != 0)
y = y->left;
x = y->right;
}
}
if (y != z) {
z->left->parent = y;
y->left = z->left;
if (y != z->right) {
x_parent = y->parent;
if (x)
x->parent = y->parent;
y->parent->left = x;
y->right = z->right;
z->right->parent = y;
} else {
x_parent = y;
}
if (root == z)
root = y;
else if (z->parent->left == z)
z->parent->left = y;
else
z->parent->right = y;
y->parent = z->parent;
// Swap the colors
Node::Color c = y->color;
y->color = z->color;
z->color = c;
y = z;
} else {
x_parent = y->parent;
if (x)
x->parent = y->parent;
if (root == z)
root = x;
else if (z->parent->left == z)
z->parent->left = x;
else
z->parent->right = x;
if ( leftmost == z ) {
if (z->right == 0)
leftmost = z->parent;
else
leftmost = x->minimum();
}
if (rightmost == z) {
if (z->left == 0)
rightmost = z->parent;
else
rightmost = x->maximum();
}
}
if (y->color != Node::Red) {
while (x != root && (x == 0 || x->color == Node::Black)) {
if (x == x_parent->left) {
NodePtr w = x_parent->right;
if (w->color == Node::Red) {
w->color = Node::Black;
x_parent->color = Node::Red;
rotateLeft(x_parent, root);
w = x_parent->right;
}
if ((w->left == 0 || w->left->color == Node::Black) &&
(w->right == 0 || w->right->color == Node::Black)) {
w->color = Node::Red;
x = x_parent;
x_parent = x_parent->parent;
} else {
if (w->right == 0 || w->right->color == Node::Black) {
if (w->left)
w->left->color = Node::Black;
w->color = Node::Red;
rotateRight(w, root);
w = x_parent->right;
}
w->color = x_parent->color;
x_parent->color = Node::Black;
if (w->right)
w->right->color = Node::Black;
rotateLeft(x_parent, root);
break;
}
} else {
NodePtr w = x_parent->left;
if (w->color == Node::Red) {
w->color = Node::Black;
x_parent->color = Node::Red;
rotateRight(x_parent, root);
w = x_parent->left;
}
if ((w->right == 0 || w->right->color == Node::Black) &&
(w->left == 0 || w->left->color == Node::Black)) {
w->color = Node::Red;
x = x_parent;
x_parent = x_parent->parent;
} else {
if (w->left == 0 || w->left->color == Node::Black) {
if (w->right)
w->right->color = Node::Black;
w->color = Node::Red;
rotateLeft(w, root);
w = x_parent->left;
}
w->color = x_parent->color;
x_parent->color = Node::Black;
if (w->left)
w->left->color = Node::Black;
rotateRight(x_parent, root);
break;
}
}
}
if (x)
x->color = Node::Black;
}
return y;
}
/****************************************************************************
**
**
** Definition of QMap class
**
** Created : 990406
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of the tools module of the Qt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef QMAP_H
#define QMAP_H
#ifndef QT_H
#include "qshared.h"
#include "qdatastream.h"
#endif // QT_H
struct QMapNodeBase
{
enum Color { Red, Black };
QMapNodeBase* left;
QMapNodeBase* right;
QMapNodeBase* parent;
Color color;
QMapNodeBase* minimum() {
QMapNodeBase* x = this;
while ( x->left )
x = x->left;
return x;
}
QMapNodeBase* maximum() {
QMapNodeBase* x = this;
while ( x->right )
x = x->right;
return x;
}
};
template <class K, class T>
struct QMapNode : public QMapNodeBase
{
QMapNode( const K& _key, const T& _data ) { data = _data; key = _key; }
QMapNode( const K& _key ) { key = _key; }
QMapNode( const QMapNode<K,T>& _n ) { key = _n.key; data = _n.data; }
QMapNode() { }
T data;
K key;
};
template<class K, class T>
class Q_EXPORT QMapIterator
{
public:
/**
* Typedefs
*/
typedef QMapNode< K, T >* NodePtr;
/**
* Variables
*/
QMapNode<K,T>* node;
/**
* Functions
*/
QMapIterator() : node( 0 ) {}
QMapIterator( QMapNode<K,T>* p ) : node( p ) {}
QMapIterator( const QMapIterator<K,T>& it ) : node( it.node ) {}
bool operator==( const QMapIterator<K,T>& it ) const { return node == it.node; }
bool operator!=( const QMapIterator<K,T>& it ) const { return node != it.node; }
T& operator*() { return node->data; }
const T& operator*() const { return node->data; }
// Cannot have this - some compilers are too stupid
//T* operator->() const { return &(node->data); }
const K& key() const { return node->key; }
T& data() { return node->data; }
const T& data() const { return node->data; }
private:
int inc() {
QMapNodeBase* tmp = node;
if ( tmp->right ) {
tmp = tmp->right;
while ( tmp->left )
tmp = tmp->left;
} else {
QMapNodeBase* y = tmp->parent;
while (tmp == y->right) {
tmp = y;
y = y->parent;
}
if (tmp->right != y)
tmp = y;
}
node = (NodePtr)tmp;
return 0;
}
int dec() {
QMapNodeBase* tmp = node;
if (tmp->color == QMapNodeBase::Red &&
tmp->parent->parent == tmp ) {
tmp = tmp->right;
} else if (tmp->left != 0) {
QMapNodeBase* y = tmp->left;
while ( y->right )
y = y->right;
tmp = y;
} else {
QMapNodeBase* y = tmp->parent;
while (tmp == y->left) {
tmp = y;
y = y->parent;
}
tmp = y;
}
node = (NodePtr)tmp;
return 0;
}
public:
QMapIterator<K,T>& operator++() {
inc();
return *this;
}
QMapIterator<K,T> operator++(int) {
QMapIterator<K,T> tmp = *this;
inc();
return tmp;
}
QMapIterator<K,T>& operator--() {
dec();
return *this;
}
QMapIterator<K,T> operator--(int) {
QMapIterator<K,T> tmp = *this;
dec();
return tmp;
}
};
template<class K, class T>
class Q_EXPORT QMapConstIterator
{
public:
/**
* Typedefs
*/
typedef QMapNode< K, T >* NodePtr;
/**
* Variables
*/
QMapNode<K,T>* node;
/**
* Functions
*/
QMapConstIterator() : node( 0 ) {}
QMapConstIterator( QMapNode<K,T>* p ) : node( p ) {}
QMapConstIterator( const QMapConstIterator<K,T>& it ) : node( it.node ) {}
QMapConstIterator( const QMapIterator<K,T>& it ) : node( it.node ) {}
bool operator==( const QMapConstIterator<K,T>& it ) const { return node == it.node; }
bool operator!=( const QMapConstIterator<K,T>& it ) const { return node != it.node; }
const T& operator*() const { return node->data; }
// Cannot have this - some compilers are too stupid
//const T* operator->() const { return &(node->data); }
const K& key() const { return node->key; }
const T& data() const { return node->data; }
private:
int inc() {
QMapNodeBase* tmp = node;
if ( tmp->right ) {
tmp = tmp->right;
while ( tmp->left )
tmp = tmp->left;
} else {
QMapNodeBase* y = tmp->parent;
while (tmp == y->right) {
tmp = y;
y = y->parent;
}
if (tmp->right != y)
tmp = y;
}
node = (NodePtr)tmp;
return 0;
}
int dec() {
QMapNodeBase* tmp = node;
if (tmp->color == QMapNodeBase::Red &&
tmp->parent->parent == tmp ) {
tmp = tmp->right;
} else if (tmp->left != 0) {
QMapNodeBase* y = tmp->left;
while ( y->right )
y = y->right;
tmp = y;
} else {
QMapNodeBase* y = tmp->parent;
while (tmp == y->left) {
tmp = y;
y = y->parent;
}
tmp = y;
}
node = (NodePtr)tmp;
return 0;
}
public:
QMapConstIterator<K,T>& operator++() {
inc();
return *this;
}
QMapConstIterator<K,T> operator++(int) {
QMapConstIterator<K,T> tmp = *this;
inc();
return tmp;
}
QMapConstIterator<K,T>& operator--() {
dec();
return *this;
}
QMapConstIterator<K,T> operator--(int) {
QMapConstIterator<K,T> tmp = *this;
dec();
return tmp;
}
};
class Q_EXPORT QMapPrivateBase : public QShared
{
public:
QMapPrivateBase() {
node_count = 0;
}
QMapPrivateBase( const QMapPrivateBase* _map) {
node_count = _map->node_count;
}
/**
* Implementations of basic tree algorithms
*/
void rotateLeft( QMapNodeBase* x, QMapNodeBase*& root);
void rotateRight( QMapNodeBase* x, QMapNodeBase*& root );
void rebalance( QMapNodeBase* x, QMapNodeBase*& root );
QMapNodeBase* removeAndRebalance( QMapNodeBase* z, QMapNodeBase*& root,
QMapNodeBase*& leftmost,
QMapNodeBase*& rightmost );
/**
* Variables
*/
int node_count;
};
template <class Key, class T>
class QMapPrivate : public QMapPrivateBase
{
public:
/**
* Typedefs
*/
typedef QMapIterator< Key, T > Iterator;
typedef QMapConstIterator< Key, T > ConstIterator;
typedef QMapNode< Key, T > Node;
typedef QMapNode< Key, T >* NodePtr;
/**
* Functions
*/
QMapPrivate() {
header = new Node;
header->color = QMapNodeBase::Red; // Mark the header
header->parent = 0;
header->left = header->right = header;
}
QMapPrivate( const QMapPrivate< Key, T >* _map ) : QMapPrivateBase( _map ) {
header = new Node;
header->color = QMapNodeBase::Red; // Mark the header
if ( _map->header->parent == 0 ) {
header->parent = 0;
header->left = header->right = header;
} else {
header->parent = copy( (NodePtr)(_map->header->parent) );
header->parent->parent = header;
header->left = header->parent->minimum();
header->right = header->parent->maximum();
}
}
~QMapPrivate() { clear(); delete header; }
NodePtr copy( NodePtr p ) {
if ( !p )
return 0;
NodePtr n = new Node( *p );
n->color = p->color;
if ( p->left ) {
n->left = copy( (NodePtr)(p->left) );
n->left->parent = n;
} else {
n->left = 0;
}
if ( p->right ) {
n->right = copy( (NodePtr)(p->right) );
n->right->parent = n;
} else {
n->right = 0;
}
return n;
}
void clear() {
clear( (NodePtr)(header->parent) );
header->color = QMapNodeBase::Red;
header->parent = 0;
header->left = header->right = header;
node_count = 0;
}
void clear( NodePtr p ) {
while ( p != 0 ) {
clear( (NodePtr)p->right );
NodePtr y = (NodePtr)p->left;
delete p;
p = y;
}
}
Iterator begin() { return Iterator( (NodePtr)(header->left ) ); }
Iterator end() { return Iterator( header ); }
ConstIterator begin() const { return ConstIterator( (NodePtr)(header->left ) ); }
ConstIterator end() const { return ConstIterator( header ); }
ConstIterator find(const Key& k) const {
QMapNodeBase* y = header; // Last node
QMapNodeBase* x = header->parent; // Root node.
while ( x != 0 ) {
// If as k <= key(x) go left
if ( !( key(x) < k ) ) {
y = x;
x = x->left;
} else {
x = x->right;
}
}
// Was k bigger/smaller then the biggest/smallest
// element of the tree ? Return end()
if ( y == header || k < key(y) )
return ConstIterator( header );
return ConstIterator( (NodePtr)y );
}
void remove( Iterator it ) {
NodePtr del = (NodePtr) removeAndRebalance( it.node, header->parent, header->left, header->right );
delete del;
--node_count;
}
#ifdef QT_QMAP_DEBUG
void inorder( QMapNodeBase* x = 0, int level = 0 ){
if ( !x )
x = header->parent;
if ( x->left )
inorder( x->left, level + 1 );
//cout << level << " Key=" << key(x) << " Value=" << ((NodePtr)x)->data << endl;
if ( x->right )
inorder( x->right, level + 1 );
}
#endif
Iterator insertMulti(const Key& v){
QMapNodeBase* y = header;
QMapNodeBase* x = header->parent;
while (x != 0){
y = x;
x = ( v < key(x) ) ? x->left : x->right;
}
return insert(x, y, v);
}
Iterator insertSingle( const Key& k ) {
// Search correct position in the tree
QMapNodeBase* y = header;
QMapNodeBase* x = header->parent;
bool result = TRUE;
while ( x != 0 ) {
result = ( k < key(x) );
y = x;
x = result ? x->left : x->right;
}
// Get iterator on the last not empty one
Iterator j( (NodePtr)y );
if ( result ) {
// Smaller then the leftmost one ?
if ( j == begin() ) {
return insert(x, y, k );
} else {
// Perhaps daddy is the right one ?
--j;
}
}
// Really bigger ?
if ( (j.node->key) < k )
return insert(x, y, k );
// We are going to replace a node
return j;
}
Iterator insert( QMapNodeBase* x, QMapNodeBase* y, const Key& k ) {
NodePtr z = new Node( k );
if (y == header || x != 0 || k < key(y) ) {
y->left = z; // also makes leftmost = z when y == header
if ( y == header ) {
header->parent = z;
header->right = z;
} else if ( y == header->left )
header->left = z; // maintain leftmost pointing to min node
} else {
y->right = z;
if ( y == header->right )
header->right = z; // maintain rightmost pointing to max node
}
z->parent = y;
z->left = 0;
z->right = 0;
rebalance( z, header->parent );
++node_count;
return Iterator(z);
}
protected:
/**
* Helpers
*/
const Key& key( QMapNodeBase* b ) const { return ((NodePtr)b)->key; }
/**
* Variables
*/
NodePtr header;
};
template<class Key, class T>
class Q_EXPORT QMap
{
public:
/**
* Typedefs
*/
typedef QMapIterator< Key, T > Iterator;
typedef QMapConstIterator< Key, T > ConstIterator;
typedef T ValueType;
typedef QMapPrivate< Key, T > Priv;
/**
* API
*/
QMap() { sh = new QMapPrivate< Key, T >; }
QMap( const QMap<Key,T>& m ) { sh = m.sh; sh->ref(); }
~QMap() { if ( sh->deref() ) delete sh; }
QMap<Key,T>& operator= ( const QMap<Key,T>& m )
{ m.sh->ref(); if ( sh->deref() ) delete sh; sh = m.sh; return *this; }
Iterator begin() { detach(); return sh->begin(); }
Iterator end() { detach(); return sh->end(); }
ConstIterator begin() const { return ((const Priv*)sh)->begin(); }
ConstIterator end() const { return ((const Priv*)sh)->end(); }
Iterator find ( const Key& k )
{ detach(); return Iterator( sh->find( k ).node ); }
ConstIterator find ( const Key& k ) const
{ return sh->find( k ); }
T& operator[] ( const Key& k ) {
detach(); QMapNode<Key,T>* p = sh->find( k ).node;
if ( p != sh->end().node ) return p->data;
return insert( k, T() ).data(); }
const T& operator[] ( const Key& k ) const
{ return sh->find( k ).data(); }
bool contains ( const Key& k ) const
{ return find( k ) != end(); }
//{ return sh->find( k ) != ((const Priv*)sh)->end(); }
uint count() const { return sh->node_count; }
bool isEmpty() const { return sh->node_count == 0; }
Iterator insert( const Key& key, const T& value ) {
detach();
Iterator it = sh->insertSingle( key );
it.data() = value;
return it;
}
void remove( Iterator it ) { detach(); sh->remove( it ); }
void remove( const Key& k ) {
detach();
Iterator it( sh->find( k ).node );
if ( it != end() )
sh->remove( it );
}
Iterator replace( const Key& k, const T& v ) {
remove( k );
return insert( k, v );
}
void clear() { if ( sh->count == 1 ) sh->clear(); else { sh->deref(); sh = new QMapPrivate<Key,T>; } }
#if defined(Q_FULL_TEMPLATE_INSTANTIATION)
bool operator==( const QMap<Key,T>& ) const { return FALSE; }
#endif
protected:
/**
* Helpers
*/
void detach() { if ( sh->count > 1 ) { sh->deref(); sh = new QMapPrivate<Key,T>( sh ); } }
Priv* sh;
};
#ifndef QT_NO_DATASTREAM
template<class Key, class T>
inline QDataStream& operator>>( QDataStream& s, QMap<Key,T>& m ) {
m.clear();
Q_UINT32 c;
s >> c;
for( Q_UINT32 i = 0; i < c; ++i ) {
Key k; T t;
s >> k >> t;
m.insert( k, t );
}
return s;
}
template<class Key, class T>
inline QDataStream& operator<<( QDataStream& s, const QMap<Key,T>& m ) {
s << (Q_UINT32)m.count();
QMapConstIterator<Key,T> it = m.begin();
for( ; it != m.end(); ++it )
s << it.key() << it.data();
return s;
}
#endif
#endif // QMAP_H
// These modules are licensed to you
#define QT_MODULE_TOOLS
#define QT_MODULE_KERNEL
#define QT_MODULE_WIDGETS
#define QT_MODULE_DIALOGS
#define QT_MODULE_ICONVIEW
#define QT_MODULE_WORKSPACE
#define QT_MODULE_NETWORK
#define QT_MODULE_CANVAS
#define QT_MODULE_TABLE
#define QT_MODULE_XML
...@@ -367,8 +367,6 @@ __END__ ...@@ -367,8 +367,6 @@ __END__
// START OF GENERATED DATA // START OF GENERATED DATA
#ifndef QT_NO_UNICODETABLES
static const Q_UINT8 ui_00[] = { static const Q_UINT8 ui_00[] = {
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
...@@ -404,6 +402,8 @@ static const Q_UINT8 ui_00[] = { ...@@ -404,6 +402,8 @@ static const Q_UINT8 ui_00[] = {
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
}; };
#ifndef QT_NO_UNICODETABLES
static const Q_UINT8 ui_01[] = { static const Q_UINT8 ui_01[] = {
15, 16, 15, 16, 15, 16, 15, 16, 15, 16, 15, 16, 15, 16, 15, 16,
15, 16, 15, 16, 15, 16, 15, 16, 15, 16, 15, 16, 15, 16, 15, 16,
...@@ -11100,19 +11100,7 @@ QChar::Category QChar::category() const ...@@ -11100,19 +11100,7 @@ QChar::Category QChar::category() const
#else #else
// ### just ASCII // ### just ASCII
if ( rw == 0 ) { if ( rw == 0 ) {
if ( cl >= '0' && cl <='9' ) return (Category)(ui_00[cell()]);
return Number_DecimalDigit;
if ( cl >= 'a' && cl <='z' )
return Letter_Lowercase;
if ( cl >= 'A' && cl <='Z' )
return Letter_Uppercase;
if ( cl == ' ' )
return Separator_Space;
if ( cl == '\n' )
return Separator_Line;
if ( cl < ' ' )
return Other_Control;
return Symbol_Other; //#######
} }
return Letter_Uppercase; //####### return Letter_Uppercase; //#######
#endif #endif
...@@ -12241,6 +12229,7 @@ QString::QString( const QChar* unicode, uint length ) ...@@ -12241,6 +12229,7 @@ QString::QString( const QChar* unicode, uint length )
{ {
if ( !unicode && !length ) { if ( !unicode && !length ) {
d = shared_null ? shared_null : makeSharedNull(); d = shared_null ? shared_null : makeSharedNull();
d->ref();
} else { } else {
QChar* uc = QT_ALLOC_QCHAR_VEC( length ); QChar* uc = QT_ALLOC_QCHAR_VEC( length );
if ( unicode ) if ( unicode )
...@@ -12295,6 +12284,8 @@ void QString::real_detach() ...@@ -12295,6 +12284,8 @@ void QString::real_detach()
void QString::deref() void QString::deref()
{ {
if ( d->deref() ) { if ( d->deref() ) {
if ( d == shared_null )
shared_null = 0;
delete d; delete d;
d = 0; // helps debugging d = 0; // helps debugging
} }
...@@ -12749,7 +12740,7 @@ QString &QString::sprintf( const char* cformat, ... ) ...@@ -12749,7 +12740,7 @@ QString &QString::sprintf( const char* cformat, ... )
case 2: ::sprintf( out, in, width, decimals, value ); break; case 2: ::sprintf( out, in, width, decimals, value ); break;
} }
} break; } break;
case 'e': case 'E': case 'f': case 'g': { case 'e': case 'E': case 'f': case 'g': case 'G': {
double value = va_arg(ap, double); double value = va_arg(ap, double);
switch (params) { switch (params) {
case 0: ::sprintf( out, in, value ); break; case 0: ::sprintf( out, in, value ); break;
...@@ -13896,6 +13887,13 @@ ushort QString::toUShort( bool *ok, int base ) const ...@@ -13896,6 +13887,13 @@ ushort QString::toUShort( bool *ok, int base ) const
/*! /*!
Returns the string converted to a <code>int</code> value. Returns the string converted to a <code>int</code> value.
\code
QString str("FF");
bool ok;
int hex = str.toInt( &ok, 16 ); // will return 255, and ok set to TRUE
int dec = str.toInt( &ok, 10 ); // will return 0, and ok set to FALSE
\endcode
If \a ok is non-null, \a *ok is set to TRUE if there are no If \a ok is non-null, \a *ok is set to TRUE if there are no
conceivable errors, and FALSE if the string is not a number at all, conceivable errors, and FALSE if the string is not a number at all,
or if it has trailing garbage. or if it has trailing garbage.
...@@ -14146,8 +14144,8 @@ QString QString::number( uint n, int base ) ...@@ -14146,8 +14144,8 @@ QString QString::number( uint n, int base )
} }
/*! /*!
This static function returns the printed value of \a n, formatted in the \f This static function returns the printed value of \a n, formatted in the
format with \a prec precision. \a f format with \a prec precision.
\a f can be 'f', 'F', 'e', 'E', 'g' or 'G', all of which have the \a f can be 'f', 'F', 'e', 'E', 'g' or 'G', all of which have the
same meaning as for sprintf(). same meaning as for sprintf().
...@@ -14574,6 +14572,7 @@ QString& QString::setUnicode( const QChar *unicode, uint len ) ...@@ -14574,6 +14572,7 @@ QString& QString::setUnicode( const QChar *unicode, uint len )
if ( d != shared_null ) { // beware of nullstring being set to nullstring if ( d != shared_null ) { // beware of nullstring being set to nullstring
deref(); deref();
d = shared_null ? shared_null : makeSharedNull(); d = shared_null ? shared_null : makeSharedNull();
d->ref();
} }
} else if ( d->count != 1 || len > d->maxl || } else if ( d->count != 1 || len > d->maxl ||
( len*4 < d->maxl && d->maxl > 4 ) ) { // detach, grown or shrink ( len*4 < d->maxl && d->maxl > 4 ) ) { // detach, grown or shrink
...@@ -14947,7 +14946,9 @@ QDataStream &operator<<( QDataStream &s, const QString &str ) ...@@ -14947,7 +14946,9 @@ QDataStream &operator<<( QDataStream &s, const QString &str )
QDataStream &operator>>( QDataStream &s, QString &str ) QDataStream &operator>>( QDataStream &s, QString &str )
{ {
#ifdef QT_QSTRING_UCS_4 #ifdef QT_QSTRING_UCS_4
#if defined(_CC_GNU_)
#warning "operator>> not working properly" #warning "operator>> not working properly"
#endif
#endif #endif
if ( s.version() == 1 ) { if ( s.version() == 1 ) {
QCString l; QCString l;
......
...@@ -646,8 +646,11 @@ inline QString::QString() : ...@@ -646,8 +646,11 @@ inline QString::QString() :
// //
inline QString::~QString() inline QString::~QString()
{ {
if ( d->deref() ) if ( d->deref() ) {
if ( d == shared_null )
shared_null = 0;
d->deleteSelf(); d->deleteSelf();
}
} }
inline QString &QString::operator=( QChar c ) inline QString &QString::operator=( QChar c )
......
...@@ -450,6 +450,9 @@ static const char * const iso8859_2locales[] = { ...@@ -450,6 +450,9 @@ static const char * const iso8859_2locales[] = {
static const char * const iso8859_3locales[] = { static const char * const iso8859_3locales[] = {
"eo", 0 }; "eo", 0 };
static const char * const iso8859_4locales[] = {
"ee", "ee_EE", "lt", "lt_LT", "lv", "lv_LV", 0 };
static const char * const iso8859_5locales[] = { static const char * const iso8859_5locales[] = {
"bg", "bg_BG", "bulgarian", "mk", "mk_MK", "bg", "bg_BG", "bulgarian", "mk", "mk_MK",
"sp", "sp_YU", 0 }; "sp", "sp_YU", 0 };
...@@ -461,13 +464,19 @@ static const char * const iso8859_7locales[] = { ...@@ -461,13 +464,19 @@ static const char * const iso8859_7locales[] = {
"el", "el_GR", "greek", 0 }; "el", "el_GR", "greek", 0 };
static const char * const iso8859_8locales[] = { static const char * const iso8859_8locales[] = {
"hebrew", "iw", "iw_IL", 0 }; "hebrew", "he", "he_IL", "iw", "iw_IL", 0 };
static const char * const iso8859_9locales[] = { static const char * const iso8859_9locales[] = {
"tr", "tr_TR", "turkish", 0 }; "tr", "tr_TR", "turkish", 0 };
static const char * const iso8859_15locales[] = { static const char * const iso8859_15locales[] = {
"fr", "fi", "french", "finnish", 0 }; "fr", "fi", "french", "finnish", "et", "et_EE", 0 };
static const char * const koi8_ulocales[] = {
"uk", "uk_UA", "ru_UA", "ukrainian", 0 };
static const char * const tis_620locales[] = {
"th", "th_TH", "thai", 0 };
static bool try_locale_list( const char * const locale[], const char * lang ) static bool try_locale_list( const char * const locale[], const char * lang )
...@@ -523,6 +532,11 @@ static QTextCodec * ru_RU_hack( const char * i ) { ...@@ -523,6 +532,11 @@ static QTextCodec * ru_RU_hack( const char * i ) {
static QTextCodec * localeMapper = 0; static QTextCodec * localeMapper = 0;
void qt_set_locale_codec( QTextCodec *codec )
{
localeMapper = codec;
}
/*! Returns a pointer to the codec most suitable for this locale. */ /*! Returns a pointer to the codec most suitable for this locale. */
QTextCodec* QTextCodec::codecForLocale() QTextCodec* QTextCodec::codecForLocale()
...@@ -572,18 +586,24 @@ QTextCodec* QTextCodec::codecForLocale() ...@@ -572,18 +586,24 @@ QTextCodec* QTextCodec::codecForLocale()
localeMapper = codecForName( "ISO 8859-2" ); localeMapper = codecForName( "ISO 8859-2" );
else if ( try_locale_list( iso8859_3locales, lang ) ) else if ( try_locale_list( iso8859_3locales, lang ) )
localeMapper = codecForName( "ISO 8859-3" ); localeMapper = codecForName( "ISO 8859-3" );
else if ( try_locale_list( iso8859_4locales, lang ) )
localeMapper = codecForName( "ISO 8859-4" );
else if ( try_locale_list( iso8859_5locales, lang ) ) else if ( try_locale_list( iso8859_5locales, lang ) )
localeMapper = codecForName( "ISO 8859-5" ); localeMapper = codecForName( "ISO 8859-5" );
else if ( try_locale_list( iso8859_6locales, lang ) ) else if ( try_locale_list( iso8859_6locales, lang ) )
localeMapper = codecForName( "ISO 8859-6" ); localeMapper = codecForName( "ISO 8859-6-I" );
else if ( try_locale_list( iso8859_7locales, lang ) ) else if ( try_locale_list( iso8859_7locales, lang ) )
localeMapper = codecForName( "ISO 8859-7" ); localeMapper = codecForName( "ISO 8859-7" );
else if ( try_locale_list( iso8859_8locales, lang ) ) else if ( try_locale_list( iso8859_8locales, lang ) )
localeMapper = codecForName( "ISO 8859-8" ); localeMapper = codecForName( "ISO 8859-8-I" );
else if ( try_locale_list( iso8859_9locales, lang ) ) else if ( try_locale_list( iso8859_9locales, lang ) )
localeMapper = codecForName( "ISO 8859-9" ); localeMapper = codecForName( "ISO 8859-9" );
else if ( try_locale_list( iso8859_15locales, lang ) ) else if ( try_locale_list( iso8859_15locales, lang ) )
localeMapper = codecForName( "ISO 8859-15" ); localeMapper = codecForName( "ISO 8859-15" );
else if ( try_locale_list( tis_620locales, lang ) )
localeMapper = codecForName( "ISO 8859-11" );
else if ( try_locale_list( koi8_ulocales, lang ) )
localeMapper = codecForName( "KOI8-U" );
else if ( try_locale_list( probably_koi8_rlocales, lang ) ) else if ( try_locale_list( probably_koi8_rlocales, lang ) )
localeMapper = ru_RU_hack( lang ); localeMapper = ru_RU_hack( lang );
else if (!lang || !(localeMapper = codecForName(lang) )) else if (!lang || !(localeMapper = codecForName(lang) ))
...@@ -1335,6 +1355,25 @@ static struct { ...@@ -1335,6 +1355,25 @@ static struct {
// /**/ - The BULLET OPERATOR is confused. Some people think // /**/ - The BULLET OPERATOR is confused. Some people think
// it should be 0x2022 (BULLET). // it should be 0x2022 (BULLET).
// from RFC 2319, ftp://ftp.isi.edu/in-notes/rfc2319.txt
{ "KOI8-U", 2088,
{ 0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524,
0x252C, 0x2534, 0x253C, 0x2580, 0x2584, 0x2588, 0x258C, 0x2590,
0x2591, 0x2592, 0x2593, 0x2320, 0x25A0, 0x2219, 0x221A, 0x2248,
0x2264, 0x2265, 0x00A0, 0x2321, 0x00B0, 0x00B2, 0x00B7, 0x00F7,
0x2550, 0x2551, 0x2552, 0x0451, 0x0454, 0x2554, 0x0456, 0x0457,
0x2557, 0x2558, 0x2559, 0x255A, 0x255B, 0x0491, 0x255D, 0x255E,
0x255F, 0x2560, 0x2561, 0x0401, 0x0404, 0x2563, 0x0406, 0x0407,
0x2566, 0x2567, 0x2568, 0x2569, 0x256A, 0x0490, 0x256C, 0x00A9,
0x044E, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433,
0x0445, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E,
0x043F, 0x044F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432,
0x044C, 0x044B, 0x0437, 0x0448, 0x044D, 0x0449, 0x0447, 0x044A,
0x042E, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413,
0x0425, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E,
0x041F, 0x042F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412,
0x042C, 0x042B, 0x0417, 0x0428, 0x042D, 0x0429, 0x0427, 0x042A } },
// next bits generated from tables on the Unicode 2.0 CD. we can // next bits generated from tables on the Unicode 2.0 CD. we can
// use these tables since this is part of the transition to using // use these tables since this is part of the transition to using
// unicode everywhere in qt. // unicode everywhere in qt.
...@@ -1342,23 +1381,6 @@ static struct { ...@@ -1342,23 +1381,6 @@ static struct {
// $ for A in 8 9 A B C D E F ; do for B in 0 1 2 3 4 5 6 7 8 9 A B C D E F ; do echo 0x${A}${B} 0xFFFD ; done ; done > /tmp/digits ; for a in 8859-* ; do ( awk '/^0x[89ABCDEF]/{ print $1, $2 }' < $a ; cat /tmp/digits ) | sort | uniq -w4 | cut -c6- | paste '-d ' - - - - - - - - | sed -e 's/ /, /g' -e 's/$/,/' -e '$ s/,$/} },/' -e '1 s/^/{ /' > ~/tmp/$a ; done // $ for A in 8 9 A B C D E F ; do for B in 0 1 2 3 4 5 6 7 8 9 A B C D E F ; do echo 0x${A}${B} 0xFFFD ; done ; done > /tmp/digits ; for a in 8859-* ; do ( awk '/^0x[89ABCDEF]/{ print $1, $2 }' < $a ; cat /tmp/digits ) | sort | uniq -w4 | cut -c6- | paste '-d ' - - - - - - - - | sed -e 's/ /, /g' -e 's/$/,/' -e '$ s/,$/} },/' -e '1 s/^/{ /' > ~/tmp/$a ; done
// then I inserted the files manually. // then I inserted the files manually.
{ "ISO 8859-1", 4,
{ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7,
0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF} },
{ "ISO 8859-2", 5, { "ISO 8859-2", 5,
{ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
...@@ -1512,7 +1534,7 @@ static struct { ...@@ -1512,7 +1534,7 @@ static struct {
0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x00EF, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x00EF,
0x00F0, 0x0146, 0x014D, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x0169, 0x00F0, 0x0146, 0x014D, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x0169,
0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x0138} }, 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x0138} },
{ "ISO 8859-13", 0, // ############# what is the mib? { "ISO 8859-13", 109,
{ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
...@@ -1529,7 +1551,7 @@ static struct { ...@@ -1529,7 +1551,7 @@ static struct {
0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C, 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C,
0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7, 0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7,
0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x2019} }, 0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x2019} },
{ "ISO 8859-14", 0, // ############# what is the mib? { "ISO 8859-14", 110,
{ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
...@@ -1546,7 +1568,7 @@ static struct { ...@@ -1546,7 +1568,7 @@ static struct {
0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
0x0175, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x1E6B, 0x0175, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x1E6B,
0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x0177, 0x00FF} }, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x0177, 0x00FF} },
{ "ISO 8859-15", 0, // ############# what is the mib? { "ISO 8859-15", 111,
{ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
...@@ -1762,6 +1784,8 @@ static struct { ...@@ -1762,6 +1784,8 @@ static struct {
0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57, 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57,
0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD} }, 0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD} },
// change LAST_MIB if you add more, and edit unicodevalues in
// kernel/qpsprinter.cpp too.
}; };
...@@ -1787,13 +1811,21 @@ QSimpleTextCodec::~QSimpleTextCodec() ...@@ -1787,13 +1811,21 @@ QSimpleTextCodec::~QSimpleTextCodec()
// what happens if strlen(chars)<len? what happens if !chars? if len<1? // what happens if strlen(chars)<len? what happens if !chars? if len<1?
QString QSimpleTextCodec::toUnicode(const char* chars, int len) const QString QSimpleTextCodec::toUnicode(const char* chars, int len) const
{ {
if(len <= 0)
return QString::null;
int clen = qstrlen(chars);
len = QMIN(len, clen); // Note: NUL ends string
QString r; QString r;
r.setUnicode(0, len);
QChar* uc = (QChar*)r.unicode(); // const_cast
const unsigned char * c = (const unsigned char *)chars; const unsigned char * c = (const unsigned char *)chars;
for( int i=0; i<len && c[i]; i++ ) { // Note: NUL ends string for( int i=0; i<len; i++ ) {
if ( c[i] > 127 ) if ( c[i] > 127 )
r[i] = unicodevalues[forwardIndex].values[c[i]-128]; uc[i] = unicodevalues[forwardIndex].values[c[i]-128];
else else
r[i] = c[i]; uc[i] = c[i];
} }
return r; return r;
} }
...@@ -1829,12 +1861,17 @@ QCString QSimpleTextCodec::fromUnicode(const QString& uc, int& len ) const ...@@ -1829,12 +1861,17 @@ QCString QSimpleTextCodec::fromUnicode(const QString& uc, int& len ) const
if ( len <0 || len > (int)uc.length() ) if ( len <0 || len > (int)uc.length() )
len = uc.length(); len = uc.length();
QCString r( len+1 ); QCString r( len+1 );
int i; int i = len;
int u; int u;
for( i=0; i<len; i++ ) { const QChar* ucp = uc.unicode();
u = uc[i].cell() + 256* uc[i].row(); char* rp = r.data();
r[i] = u < 128 ? u : ( char* rmp = reverseMap->data();
( u < (int)reverseMap->size() ) ? (*reverseMap)[u] : '?' ); int rmsize = (int) reverseMap->size();
while( i-- )
{
u = ucp->unicode();
*rp++ = u < 128 ? u : (( u < rmsize ) ? (*(rmp+u)) : '?' );
ucp++;
} }
r[len] = 0; r[len] = 0;
return r; return r;
...@@ -1862,7 +1899,9 @@ int QSimpleTextCodec::heuristicNameMatch(const char* hint) const ...@@ -1862,7 +1899,9 @@ int QSimpleTextCodec::heuristicNameMatch(const char* hint) const
return QTextCodec::heuristicNameMatch("koi8-r")-1; return QTextCodec::heuristicNameMatch("koi8-r")-1;
} else if ( hint[0] == 't' && QCString(name()) == "ISO 8859-11" ) { } else if ( hint[0] == 't' && QCString(name()) == "ISO 8859-11" ) {
// 8859-11 and tis620 are byte by bute equivalent // 8859-11 and tis620 are byte by bute equivalent
int i = simpleHeuristicNameMatch("tis-620", hint); int i = simpleHeuristicNameMatch("tis620-0", hint);
if( !i )
i = simpleHeuristicNameMatch("tis-620", hint);
if( i ) return i; if( i ) return i;
} }
return QTextCodec::heuristicNameMatch(hint); return QTextCodec::heuristicNameMatch(hint);
...@@ -1892,27 +1931,7 @@ int QSimpleTextCodec::heuristicContentMatch(const char* chars, int len) const ...@@ -1892,27 +1931,7 @@ int QSimpleTextCodec::heuristicContentMatch(const char* chars, int len) const
} }
static void setupBuiltinCodecs() #endif // QT_NO_CODECS
{
int i = 0;
do {
(void)new QSimpleTextCodec( i );
} while( unicodevalues[i++].mib != LAST_MIB );
(void)new QEucJpCodec;
(void)new QSjisCodec;
(void)new QJisCodec;
(void)new QEucKrCodec;
(void)new QGbkCodec;
(void)new QBig5Codec;
(void)new QUtf8Codec;
(void)new QUtf16Codec;
(void)new QHebrewCodec;
(void)new QArabicCodec;
(void)new QTsciiCodec;
}
#else
class QLatin1Codec: public QTextCodec class QLatin1Codec: public QTextCodec
{ {
...@@ -1948,12 +1967,10 @@ QLatin1Codec::~QLatin1Codec() ...@@ -1948,12 +1967,10 @@ QLatin1Codec::~QLatin1Codec()
// what happens if strlen(chars)<len? what happens if !chars? if len<1? // what happens if strlen(chars)<len? what happens if !chars? if len<1?
QString QLatin1Codec::toUnicode(const char* chars, int len) const QString QLatin1Codec::toUnicode(const char* chars, int len) const
{ {
QString r; if(len <= 0)
const unsigned char * c = (const unsigned char *)chars; return QString::null;
for( int i=0; i<len && c[i]; i++ ) { // Note: NUL ends string
r[i] = c[i]; return QString::fromLatin1(chars, len);
}
return r;
} }
...@@ -1962,11 +1979,12 @@ QCString QLatin1Codec::fromUnicode(const QString& uc, int& len ) const ...@@ -1962,11 +1979,12 @@ QCString QLatin1Codec::fromUnicode(const QString& uc, int& len ) const
if ( len <0 || len > (int)uc.length() ) if ( len <0 || len > (int)uc.length() )
len = uc.length(); len = uc.length();
QCString r( len+1 ); QCString r( len+1 );
int i; int i = 0;
int u; const QChar *ch = uc.unicode();
for( i=0; i<len; i++ ) { while ( i < len ) {
u = uc[i].cell() + 256* uc[i].row(); r[i] = ch->row() ? '?' : ch->cell();
r[i] = u < 255 ? u : '?'; i++;
ch++;
} }
r[len] = 0; r[len] = 0;
return r; return r;
...@@ -1975,7 +1993,7 @@ QCString QLatin1Codec::fromUnicode(const QString& uc, int& len ) const ...@@ -1975,7 +1993,7 @@ QCString QLatin1Codec::fromUnicode(const QString& uc, int& len ) const
const char* QLatin1Codec::name() const const char* QLatin1Codec::name() const
{ {
return "iso8859-1"; return "ISO 8859-1";
} }
...@@ -2009,11 +2027,28 @@ int QLatin1Codec::heuristicContentMatch(const char* chars, int len) const ...@@ -2009,11 +2027,28 @@ int QLatin1Codec::heuristicContentMatch(const char* chars, int len) const
} }
static void setupBuiltinCodecs() static void setupBuiltinCodecs()
{ {
(void)new QLatin1Codec; (void)new QLatin1Codec;
}
#ifndef QT_NO_CODECS
int i = 0;
do {
(void)new QSimpleTextCodec( i );
} while( unicodevalues[i++].mib != LAST_MIB );
(void)new QEucJpCodec;
(void)new QSjisCodec;
(void)new QJisCodec;
(void)new QEucKrCodec;
(void)new QGbkCodec;
(void)new QBig5Codec;
(void)new QUtf8Codec;
(void)new QUtf16Codec;
(void)new QHebrewCodec;
(void)new QArabicCodec;
(void)new QTsciiCodec;
#endif // QT_NO_CODECS #endif // QT_NO_CODECS
}
#endif // QT_NO_TEXTCODEC #endif // QT_NO_TEXTCODEC
...@@ -193,10 +193,14 @@ const int QTextStream::floatfield = ( QTextStream::scientific | ...@@ -193,10 +193,14 @@ const int QTextStream::floatfield = ( QTextStream::scientific |
class QTextStreamPrivate { class QTextStreamPrivate {
public: public:
QTextStreamPrivate(): decoder( 0 ), sourceType( NotSet ) {} #ifndef QT_NO_TEXTCODEC
QTextStreamPrivate() : decoder( 0 ), sourceType( NotSet ) {}
~QTextStreamPrivate() { delete decoder; } ~QTextStreamPrivate() { delete decoder; }
QTextDecoder *decoder; //??? QTextDecoder *decoder; //???
#else
QTextStreamPrivate() : sourceType( NotSet ) {}
~QTextStreamPrivate() { }
#endif
QString ungetcBuf; QString ungetcBuf;
enum SourceType { NotSet, IODevice, String, ByteArray, File }; enum SourceType { NotSet, IODevice, String, ByteArray, File };
...@@ -664,14 +668,41 @@ uint QTextStream::ts_getbuf( QChar* buf, uint len ) ...@@ -664,14 +668,41 @@ uint QTextStream::ts_getbuf( QChar* buf, uint len )
} }
} }
#ifndef QT_NO_TEXTCODEC
if ( mapper ) { if ( mapper ) {
bool shortRead = FALSE;
if ( !d->decoder ) if ( !d->decoder )
d->decoder = mapper->makeDecoder(); d->decoder = mapper->makeDecoder();
while( rnum < len ) { while( rnum < len ) {
QString s; QString s;
while ( s.isEmpty() ) { bool readBlock = !( len == 1+rnum );
// TODO: can this getch() call be optimized to read while ( TRUE ) {
// more than one character after another? YES! // for efficiency: normally read a whole block
if ( readBlock ) {
// guess buffersize; this may be wrong (too small or too
// big). But we can handle this (either iterate reading
// or use ungetcBuf).
// Note that this might cause problems for codecs where
// one byte can result in >1 Unicode Characters if bytes
// are written to the stream in the meantime (loss of
// synchronicity).
uint rlen = len - rnum;
char *cbuf = new char[ rlen ];
if ( ungetHack != EOF ) {
rlen = 1+dev->readBlock( cbuf+1, rlen-1 );
cbuf[0] = (char)ungetHack;
ungetHack = EOF;
} else {
rlen = dev->readBlock( cbuf, rlen );
}
s += d->decoder->toUnicode( cbuf, rlen );
delete[] cbuf;
// use buffered reading only for the first time, because we
// have to get the stream synchronous again (this is easier
// with single character reading)
readBlock = FALSE;
}
// get stream (and codec) in sync
int c; int c;
if ( ungetHack == EOF ) { if ( ungetHack == EOF ) {
c = dev->getch(); c = dev->getch();
...@@ -679,10 +710,15 @@ uint QTextStream::ts_getbuf( QChar* buf, uint len ) ...@@ -679,10 +710,15 @@ uint QTextStream::ts_getbuf( QChar* buf, uint len )
c = ungetHack; c = ungetHack;
ungetHack = EOF; ungetHack = EOF;
} }
if ( c == EOF ) if ( c == EOF ) {
return rnum; shortRead = TRUE;
break;
}
char b = c; char b = c;
s = d->decoder->toUnicode( &b, 1 ); uint lengthBefore = s.length();
s += d->decoder->toUnicode( &b, 1 );
if ( s.length() > lengthBefore )
break; // it seems we are in sync now
} }
uint i = 0; uint i = 0;
while( rnum < len && i < s.length() ) while( rnum < len && i < s.length() )
...@@ -690,8 +726,12 @@ uint QTextStream::ts_getbuf( QChar* buf, uint len ) ...@@ -690,8 +726,12 @@ uint QTextStream::ts_getbuf( QChar* buf, uint len )
if ( s.length() > i ) if ( s.length() > i )
// could be = but append is clearer // could be = but append is clearer
d->ungetcBuf.append( s.mid( i ) ); d->ungetcBuf.append( s.mid( i ) );
if ( shortRead )
return rnum;
} }
} else if ( latin1 ) { } else
#endif
if ( latin1 ) {
if ( len == 1+rnum ) { if ( len == 1+rnum ) {
// use this method for one character because it is more efficient // use this method for one character because it is more efficient
// (arnt doubts whether it makes a difference, but lets it stand) // (arnt doubts whether it makes a difference, but lets it stand)
...@@ -699,14 +739,18 @@ uint QTextStream::ts_getbuf( QChar* buf, uint len ) ...@@ -699,14 +739,18 @@ uint QTextStream::ts_getbuf( QChar* buf, uint len )
if ( c != EOF ) if ( c != EOF )
buf[rnum++] = (char)c; buf[rnum++] = (char)c;
} else { } else {
if ( (QChar)ungetHack != QEOF ) if ( ungetHack != EOF ) {
buf[rnum++] = (char)ungetHack; buf[rnum++] = (char)ungetHack;
ungetHack = EOF;
}
char *cbuf = new char[len - rnum];
while ( !dev->atEnd() && rnum < len ) {
uint rlen = len - rnum; uint rlen = len - rnum;
char *cbuf = new char[rlen];
rlen = dev->readBlock( cbuf, rlen ); rlen = dev->readBlock( cbuf, rlen );
uint i = 0; uint i = 0;
while( i < rlen ) while( i < rlen )
buf[rnum++] = cbuf[i++]; buf[rnum++] = cbuf[i++];
}
delete[] cbuf; delete[] cbuf;
} }
} else { // UCS-2 or UTF-16 } else { // UCS-2 or UTF-16
...@@ -722,18 +766,22 @@ uint QTextStream::ts_getbuf( QChar* buf, uint len ) ...@@ -722,18 +766,22 @@ uint QTextStream::ts_getbuf( QChar* buf, uint len )
else else
buf[rnum++] = QChar( c1, c2 ); buf[rnum++] = QChar( c1, c2 );
} else { } else {
char *cbuf = new char[ 2*( len - rnum ) ]; // for paranoids: overflow possible
while ( !dev->atEnd() && rnum < len ) {
uint rlen = 2 * ( len-rnum ); uint rlen = 2 * ( len-rnum );
char *cbuf = new char[rlen]; // for paranoids: overflow possible if ( ungetHack != EOF ) {
if ( (QChar)ungetHack != QEOF ) {
rlen = 1+dev->readBlock( cbuf+1, rlen-1 ); rlen = 1+dev->readBlock( cbuf+1, rlen-1 );
cbuf[0] = (char)ungetHack; cbuf[0] = (char)ungetHack;
ungetHack = EOF;
} else { } else {
rlen = dev->readBlock( cbuf, rlen ); rlen = dev->readBlock( cbuf, rlen );
} }
// is this right? we can't use an odd number of bytes, but // We can't use an odd number of bytes, so put it back. But
// if there -is- an odd number, with this code we'll never // do it only if we are capable of reading more -- normally
// get to EOF. // there should not be an odd number, but the file might be
// truncated or not in UTF-16...
if ( (rlen & 1) == 1 ) if ( (rlen & 1) == 1 )
if ( !dev->atEnd() )
dev->ungetch( cbuf[--rlen] ); dev->ungetch( cbuf[--rlen] );
uint i = 0; uint i = 0;
if ( isNetworkOrder() ) { if ( isNetworkOrder() ) {
...@@ -747,6 +795,7 @@ uint QTextStream::ts_getbuf( QChar* buf, uint len ) ...@@ -747,6 +795,7 @@ uint QTextStream::ts_getbuf( QChar* buf, uint len )
i+=2; i+=2;
} }
} }
}
delete[] cbuf; delete[] cbuf;
} }
} }
...@@ -759,12 +808,15 @@ uint QTextStream::ts_getbuf( QChar* buf, uint len ) ...@@ -759,12 +808,15 @@ uint QTextStream::ts_getbuf( QChar* buf, uint len )
*/ */
void QTextStream::ts_putc( QChar c ) void QTextStream::ts_putc( QChar c )
{ {
#ifndef QT_NO_TEXTCODEC
if ( mapper ) { if ( mapper ) {
int len = 1; int len = 1;
QString s = c; QString s = c;
QCString block = mapper->fromUnicode( s, len ); QCString block = mapper->fromUnicode( s, len );
dev->writeBlock( block, len ); dev->writeBlock( block, len );
} else if ( latin1 ) { } else
#endif
if ( latin1 ) {
if( c.row() ) if( c.row() )
dev->putch( '?' ); //######unknown character??? dev->putch( '?' ); //######unknown character???
else else
...@@ -820,7 +872,7 @@ void QTextStream::ts_ungetc( QChar c ) ...@@ -820,7 +872,7 @@ void QTextStream::ts_ungetc( QChar c )
The buffer \e s must be preallocated. The buffer \e s must be preallocated.
\note No Encoding is done by this function. Note that no encoding is done by this function.
\warning The behaviour of this function is undefined unless the \warning The behaviour of this function is undefined unless the
stream's encoding is set to Unicode or Latin1. stream's encoding is set to Unicode or Latin1.
...@@ -838,7 +890,7 @@ QTextStream &QTextStream::readRawBytes( char *s, uint len ) ...@@ -838,7 +890,7 @@ QTextStream &QTextStream::readRawBytes( char *s, uint len )
Writes the \e len bytes from \e s to the stream and returns a reference to Writes the \e len bytes from \e s to the stream and returns a reference to
the stream. the stream.
\note No Encoding is done by this function. Note that no encoding is done by this function.
\sa QIODevice::writeBlock() \sa QIODevice::writeBlock()
*/ */
...@@ -1428,15 +1480,24 @@ QString QTextStream::readLine() ...@@ -1428,15 +1480,24 @@ QString QTextStream::readLine()
return QString::null; return QString::null;
} }
#endif #endif
QChar c = ts_getc(); QString result( "" );
if ( c == QEOF ) const int buf_size = 256;
QChar c[buf_size];
int pos = 0;
c[pos] = ts_getc();
if ( c[pos] == QEOF )
return QString::null; return QString::null;
QString result( "" ); while ( c[pos] != QEOF && c[pos] != '\n' ) {
while ( c != QEOF && c != '\n' ) { pos++;
result += c; if ( pos >= buf_size ) {
c = ts_getc(); result += QString( c, pos );
pos = 0;
} }
c[pos] = ts_getc();
}
result += QString( c, pos );
int len = (int)result.length(); int len = (int)result.length();
if ( len && result[len-1] == '\r' ) if ( len && result[len-1] == '\r' )
...@@ -1456,7 +1517,7 @@ QString QTextStream::read() ...@@ -1456,7 +1517,7 @@ QString QTextStream::read()
{ {
#if defined(CHECK_STATE) #if defined(CHECK_STATE)
if ( !dev ) { if ( !dev ) {
qWarning( "QTextStream::readLine: No device" ); qWarning( "QTextStream::read: No device" );
return QString::null; return QString::null;
} }
#endif #endif
...@@ -1507,8 +1568,20 @@ QString QTextStream::read() ...@@ -1507,8 +1568,20 @@ QString QTextStream::read()
/*! /*!
Writes a \c char to the stream and returns a reference to the stream. Writes a \c char to the stream and returns a reference to the stream.
The character \a c is assumed to be Latin1 encoded independent of the Encoding set
for the QTextStream.
*/ */
QTextStream &QTextStream::operator<<( QChar c )
{
CHECK_STREAM_PRECOND
ts_putc( c );
return *this;
}
/*!
Writes a \c char to the stream and returns a reference to the stream.
*/
QTextStream &QTextStream::operator<<( char c ) QTextStream &QTextStream::operator<<( char c )
{ {
CHECK_STREAM_PRECOND CHECK_STREAM_PRECOND
...@@ -1737,6 +1810,9 @@ QTextStream &QTextStream::operator<<( double f ) ...@@ -1737,6 +1810,9 @@ QTextStream &QTextStream::operator<<( double f )
/*! /*!
Writes a string to the stream and returns a reference to the stream. Writes a string to the stream and returns a reference to the stream.
The string \a s is assumed to be Latin1 encoded independent of the Encoding set
for the QTextStream.
*/ */
QTextStream &QTextStream::operator<<( const char* s ) QTextStream &QTextStream::operator<<( const char* s )
...@@ -1774,6 +1850,9 @@ QTextStream &QTextStream::operator<<( const char* s ) ...@@ -1774,6 +1850,9 @@ QTextStream &QTextStream::operator<<( const char* s )
/*! /*!
Writes \a s to the stream and returns a reference to the stream. Writes \a s to the stream and returns a reference to the stream.
The string \a s is assumed to be Latin1 encoded independent of the Encoding set
for the QTextStream.
*/ */
QTextStream &QTextStream::operator<<( const QCString & s ) QTextStream &QTextStream::operator<<( const QCString & s )
...@@ -2064,11 +2143,12 @@ QTextStream &reset( QTextStream &s ) ...@@ -2064,11 +2143,12 @@ QTextStream &reset( QTextStream &s )
writing to non-persistent storage used by a single process. writing to non-persistent storage used by a single process.
</ul> </ul>
\c Locale and all Unicode encodings, except \c RawUnicode, will look \c Locale and all Unicode encodings, except \c RawUnicode, will look at
at the first two bytes in a input stream to determine the byte the first two bytes in a input stream to determine the byte order. The
order. The initial byte order marker will be stripped off before data is read. initial byte order marker will be stripped off before data is read.
\note This function should be called before any data is read to/written from the stream. Note that this function should be called before any data is read
to/written from the stream.
\sa setCodec() \sa setCodec()
*/ */
...@@ -2084,10 +2164,16 @@ void QTextStream::setEncoding( Encoding e ) ...@@ -2084,10 +2164,16 @@ void QTextStream::setEncoding( Encoding e )
internalOrder = TRUE; internalOrder = TRUE;
break; break;
case UnicodeUTF8: case UnicodeUTF8:
#ifndef QT_NO_CODECS
mapper = QTextCodec::codecForMib( 106 ); mapper = QTextCodec::codecForMib( 106 );
latin1 = FALSE; latin1 = FALSE;
doUnicodeHeader = TRUE; doUnicodeHeader = TRUE;
internalOrder = TRUE; internalOrder = TRUE;
#else
mapper = 0;
latin1 = TRUE;
doUnicodeHeader = TRUE;
#endif
break; break;
case UnicodeNetworkOrder: case UnicodeNetworkOrder:
mapper = 0; mapper = 0;
...@@ -2109,12 +2195,14 @@ void QTextStream::setEncoding( Encoding e ) ...@@ -2109,12 +2195,14 @@ void QTextStream::setEncoding( Encoding e )
break; break;
case Locale: case Locale:
latin1 = TRUE; // fallback to Latin 1 latin1 = TRUE; // fallback to Latin 1
#ifndef QT_NO_TEXTCODEC
mapper = QTextCodec::codecForLocale(); mapper = QTextCodec::codecForLocale();
#if defined(_OS_WIN32_) #if defined(_OS_WIN32_)
if ( GetACP() == 1252 ) if ( GetACP() == 1252 )
mapper = 0; // Optimized latin1 processing mapper = 0; // Optimized latin1 processing
#endif #endif
if ( mapper && mapper->mibEnum() == 4 ) if ( mapper && mapper->mibEnum() == 4 )
#endif
mapper = 0; // Optimized latin1 processing mapper = 0; // Optimized latin1 processing
doUnicodeHeader = TRUE; // If it reads as Unicode, accept it doUnicodeHeader = TRUE; // If it reads as Unicode, accept it
break; break;
...@@ -2127,10 +2215,13 @@ void QTextStream::setEncoding( Encoding e ) ...@@ -2127,10 +2215,13 @@ void QTextStream::setEncoding( Encoding e )
} }
/*! #ifndef QT_NO_TEXTCODEC
Sets the codec for this stream to \a codec. Will not try to autodetect Unicode. /*! Sets the codec for this stream to \a codec. Will not try to
autodetect Unicode.
Note that this function should be called before any data is read
to/written from the stream.
\note This function should be called before any data is read to/written from the stream.
\sa setEncoding() \sa setEncoding()
*/ */
...@@ -2141,5 +2232,6 @@ void QTextStream::setCodec( QTextCodec *codec ) ...@@ -2141,5 +2232,6 @@ void QTextStream::setCodec( QTextCodec *codec )
mapper = codec; mapper = codec;
doUnicodeHeader = FALSE; doUnicodeHeader = FALSE;
} }
#endif
#endif // QT_NO_TEXTSTREAM #endif // QT_NO_TEXTSTREAM
...@@ -57,7 +57,10 @@ public: ...@@ -57,7 +57,10 @@ public:
UnicodeReverse, RawUnicode, UnicodeUTF8 }; UnicodeReverse, RawUnicode, UnicodeUTF8 };
void setEncoding( Encoding ); void setEncoding( Encoding );
#ifndef QT_NO_TEXTCODEC
void setCodec( QTextCodec* ); void setCodec( QTextCodec* );
#endif
// Encoding encoding() const { return cmode; } // Encoding encoding() const { return cmode; }
QTextStream(); QTextStream();
...@@ -89,6 +92,7 @@ public: ...@@ -89,6 +92,7 @@ public:
QTextStream &operator>>( QString & ); QTextStream &operator>>( QString & );
QTextStream &operator>>( QCString & ); QTextStream &operator>>( QCString & );
QTextStream &operator<<( QChar );
QTextStream &operator<<( char ); QTextStream &operator<<( char );
QTextStream &operator<<( signed short ); QTextStream &operator<<( signed short );
QTextStream &operator<<( unsigned short ); QTextStream &operator<<( unsigned short );
......
...@@ -36,7 +36,11 @@ HEADERS = qarray.h \ ...@@ -36,7 +36,11 @@ HEADERS = qarray.h \
qtextstream.h \ qtextstream.h \
qtl.h \ qtl.h \
qvaluelist.h \ qvaluelist.h \
qvector.h qvector.h \
qxml.h \
qvaluestack.h \
qmap.h \
qmodules.h
SOURCES = qbuffer.cpp \ SOURCES = qbuffer.cpp \
qcollection.cpp \ qcollection.cpp \
qcstring.cpp \ qcstring.cpp \
...@@ -55,7 +59,9 @@ SOURCES = qbuffer.cpp \ ...@@ -55,7 +59,9 @@ SOURCES = qbuffer.cpp \
qstring.cpp \ qstring.cpp \
qtextstream.cpp \ qtextstream.cpp \
qtextcodec.cpp \ qtextcodec.cpp \
qstringlist.cpp qstringlist.cpp \
qxml.cpp \
qmap.cpp
unix:SOURCES += qfile_unix.cpp \ unix:SOURCES += qfile_unix.cpp \
qdir_unix.cpp \ qdir_unix.cpp \
......
/****************************************************************************
**
**
** Definition of QValueStack class
**
** Created : 990925
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of the tools module of the Qt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef QVALUESTACK_H
#define QVALUESTACK_H
#ifndef QT_H
#include "qvaluelist.h"
#endif // QT_H
template<class T>
class Q_EXPORT QValueStack : public QValueList<T>
{
public:
QValueStack() {}
~QValueStack() {}
void push( const T& d ) { append(d); }
T pop()
{
T elem( this->last() );
if ( !this->isEmpty() )
remove( this->fromLast() );
return elem;
}
T& top() { return this->last(); }
const T& top() const { return this->last(); }
};
#endif
This source diff could not be displayed because it is too large. You can view the blob instead.
/****************************************************************************
**
**
** Definition of QXmlSimpleReader and related classes.
**
** Created : 000518
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of the XML module of the Qt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition licenses may use this
** file in accordance with the Qt Commercial License Agreement provided
** with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef QXML_H
#define QXML_H
#include <qmodules.h>
#if !defined(QT_MODULE_XML)
#define QM_EXPORT
#else
#define QM_EXPORT Q_EXPORT
#endif
#ifndef QT_H
#include <qtextstream.h>
#include <qfile.h>
#include <qstring.h>
#include <qstringlist.h>
#include <qvaluestack.h>
#include <qmap.h>
#endif // QT_H
#ifndef QT_NO_XML
class QXmlNamespaceSupport;
class QXmlAttributes;
class QXmlContentHandler;
class QXmlDefaultHandler;
class QXmlDTDHandler;
class QXmlEntityResolver;
class QXmlErrorHandler;
class QXmlLexicalHandler;
class QXmlDeclHandler;
class QXmlInputSource;
class QXmlLocator;
class QXmlNamespaceSupport;
class QXmlParseException;
class QXmlReader;
class QXmlSimpleReader;
class QXmlSimpleReaderPrivate;
class QXmlNamespaceSupportPrivate;
class QXmlAttributesPrivate;
class QXmlInputSourcePrivate;
class QXmlParseExceptionPrivate;
class QXmlLocatorPrivate;
class QXmlDefaultHandlerPrivate;
//
// SAX Namespace Support
//
#if defined(Q_TEMPLATEDLL)
// MOC_SKIP_BEGIN
template class QM_EXPORT QMap<QString, QString>;
template class QM_EXPORT QValueStack<QMap<QString, QString> >;
template class QM_EXPORT QValueStack<QString>;
// MOC_SKIP_END
#endif
class QM_EXPORT QXmlNamespaceSupport
{
public:
QXmlNamespaceSupport();
~QXmlNamespaceSupport();
void setPrefix( const QString&, const QString& );
QString prefix( const QString& ) const;
QString uri( const QString& ) const;
void splitName( const QString&, QString&, QString& ) const;
void processName( const QString&, bool, QString&, QString& ) const;
QStringList prefixes() const;
QStringList prefixes( const QString& ) const;
void pushContext();
void popContext();
void reset();
private:
QValueStack<QMap<QString, QString> > nsStack;
QMap<QString, QString> ns;
QXmlNamespaceSupportPrivate *d;
};
//
// SAX Attributes
//
class QM_EXPORT QXmlAttributes
{
public:
QXmlAttributes() {}
virtual ~QXmlAttributes() {}
int index( const QString& qName ) const;
int index( const QString& uri, const QString& localPart ) const;
int length() const;
QString localName( int index ) const;
QString qName( int index ) const;
QString uri( int index ) const;
QString type( int index ) const;
QString type( const QString& qName ) const;
QString type( const QString& uri, const QString& localName ) const;
QString value( int index ) const;
QString value( const QString& qName ) const;
QString value( const QString& uri, const QString& localName ) const;
private:
QStringList qnameList;
QStringList uriList;
QStringList localnameList;
QStringList valueList;
QXmlAttributesPrivate *d;
friend class QXmlSimpleReader;
};
//
// SAX Input Source
//
class QM_EXPORT QXmlInputSource
{
public:
QXmlInputSource();
QXmlInputSource( QTextStream& stream );
QXmlInputSource( QFile& file );
virtual ~QXmlInputSource();
virtual const QString& data() const;
virtual void setData( const QString& d );
private:
void readInput( QByteArray& rawData );
QString input;
QXmlInputSourcePrivate *d;
};
//
// SAX Exception Classes
//
class QM_EXPORT QXmlParseException
{
public:
QXmlParseException( const QString& name="", int c=-1, int l=-1, const QString& p="", const QString& s="" )
: msg( name ), column( c ), line( l ), pub( p ), sys( s )
{ }
int columnNumber() const;
int lineNumber() const;
QString publicId() const;
QString systemId() const;
QString message() const;
private:
QString msg;
int column;
int line;
QString pub;
QString sys;
QXmlParseExceptionPrivate *d;
};
//
// XML Reader
//
class QM_EXPORT QXmlReader
{
public:
virtual bool feature( const QString& name, bool *ok = 0 ) const = 0;
virtual void setFeature( const QString& name, bool value ) = 0;
virtual bool hasFeature( const QString& name ) const = 0;
virtual void* property( const QString& name, bool *ok = 0 ) const = 0;
virtual void setProperty( const QString& name, void* value ) = 0;
virtual bool hasProperty( const QString& name ) const = 0;
virtual void setEntityResolver( QXmlEntityResolver* handler ) = 0;
virtual QXmlEntityResolver* entityResolver() const = 0;
virtual void setDTDHandler( QXmlDTDHandler* handler ) = 0;
virtual QXmlDTDHandler* DTDHandler() const = 0;
virtual void setContentHandler( QXmlContentHandler* handler ) = 0;
virtual QXmlContentHandler* contentHandler() const = 0;
virtual void setErrorHandler( QXmlErrorHandler* handler ) = 0;
virtual QXmlErrorHandler* errorHandler() const = 0;
virtual void setLexicalHandler( QXmlLexicalHandler* handler ) = 0;
virtual QXmlLexicalHandler* lexicalHandler() const = 0;
virtual void setDeclHandler( QXmlDeclHandler* handler ) = 0;
virtual QXmlDeclHandler* declHandler() const = 0;
virtual bool parse( const QXmlInputSource& input ) = 0;
};
class QM_EXPORT QXmlSimpleReader : public QXmlReader
{
public:
QXmlSimpleReader();
virtual ~QXmlSimpleReader();
bool feature( const QString& name, bool *ok = 0 ) const;
void setFeature( const QString& name, bool value );
bool hasFeature( const QString& name ) const;
void* property( const QString& name, bool *ok = 0 ) const;
void setProperty( const QString& name, void* value );
bool hasProperty( const QString& name ) const;
void setEntityResolver( QXmlEntityResolver* handler );
QXmlEntityResolver* entityResolver() const;
void setDTDHandler( QXmlDTDHandler* handler );
QXmlDTDHandler* DTDHandler() const;
void setContentHandler( QXmlContentHandler* handler );
QXmlContentHandler* contentHandler() const;
void setErrorHandler( QXmlErrorHandler* handler );
QXmlErrorHandler* errorHandler() const;
void setLexicalHandler( QXmlLexicalHandler* handler );
QXmlLexicalHandler* lexicalHandler() const;
void setDeclHandler( QXmlDeclHandler* handler );
QXmlDeclHandler* declHandler() const;
bool parse( const QXmlInputSource& input );
private:
// variables
QXmlContentHandler* contentHnd;
QXmlErrorHandler* errorHnd;
QXmlDTDHandler* dtdHnd;
QXmlEntityResolver* entityRes;
QXmlLexicalHandler* lexicalHnd;
QXmlDeclHandler* declHnd;
QChar c; // the character at reading position
int lineNr; // number of line
int columnNr; // position in line
int pos; // position in string
int namePos;
QChar nameArray[256]; // only used for names
QString nameValue; // only used for names
int refPos;
QChar refArray[256]; // only used for references
QString refValue; // only used for references
int stringPos;
QChar stringArray[256]; // used for any other strings that are parsed
QString stringValue; // used for any other strings that are parsed
QString xml;
int xmlLength;
QString xmlRef; // used for parsing of entity references
QValueStack<QString> tags;
QXmlSimpleReaderPrivate* d;
static const QChar QEOF;
// inlines
virtual bool is_S( const QChar& );
virtual bool is_Letter( const QChar& );
virtual bool is_NameBeginning( const QChar& );
virtual bool is_Digit( const QChar& );
virtual bool is_CombiningChar( const QChar& );
virtual bool is_Extender( const QChar& );
virtual bool is_NameChar( const QChar& );
QString& string();
void stringClear();
void stringAddC();
void stringAddC(const QChar&);
QString& name();
void nameClear();
void nameAddC();
void nameAddC(const QChar&);
QString& ref();
void refClear();
void refAddC();
void refAddC(const QChar&);
// used by parseReference() and parsePEReference()
enum EntityRecognitionContext { InContent, InAttributeValue, InEntityValue, InDTD };
// private methods
void eat_ws();
void next_eat_ws();
void next();
bool atEnd();
void init( const QXmlInputSource& i );
bool parseProlog();
bool parseElement();
bool parseElementEmptyTag( bool &t, QString &uri, QString &lname );
bool parseElementETagBegin2();
bool parseElementAttribute( QString &prefix, QString &uri, QString &lname );
bool parseMisc();
bool parseContent();
bool parsePI(bool xmldecl=FALSE);
bool parseDoctype();
bool parseComment();
bool parseName( bool useRef=FALSE );
bool parseNmtoken();
bool parseAttribute();
bool parseReference( bool &charDataRead, EntityRecognitionContext context );
bool parseExternalID( bool allowPublicID = FALSE );
bool parsePEReference( EntityRecognitionContext context );
bool parseMarkupdecl();
bool parseAttlistDecl();
bool parseAttType();
bool parseAttValue();
bool parseElementDecl();
bool parseNotationDecl();
bool parseChoiceSeq();
bool parseEntityDecl();
bool parseEntityValue();
bool parseString( const QString& s );
void reportParseError();
friend class QXmlSimpleReaderPrivate;
friend class QXmlLocator;
};
//
// SAX Locator
//
class QM_EXPORT QXmlLocator
{
public:
QXmlLocator( QXmlSimpleReader* parent )
{ reader = parent; }
~QXmlLocator()
{ }
int columnNumber();
int lineNumber();
// QString getPublicId()
// QString getSystemId()
private:
QXmlSimpleReader* reader;
QXmlLocatorPrivate *d;
};
//
// SAX handler classes
//
class QM_EXPORT QXmlContentHandler
{
public:
virtual void setDocumentLocator( QXmlLocator* locator ) = 0;
virtual bool startDocument() = 0;
virtual bool endDocument() = 0;
virtual bool startPrefixMapping( const QString& prefix, const QString& uri ) = 0;
virtual bool endPrefixMapping( const QString& prefix ) = 0;
virtual bool startElement( const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts ) = 0;
virtual bool endElement( const QString& namespaceURI, const QString& localName, const QString& qName ) = 0;
virtual bool characters( const QString& ch ) = 0;
virtual bool ignorableWhitespace( const QString& ch ) = 0;
virtual bool processingInstruction( const QString& target, const QString& data ) = 0;
virtual bool skippedEntity( const QString& name ) = 0;
virtual QString errorString() = 0;
};
class QM_EXPORT QXmlErrorHandler
{
public:
virtual bool warning( const QXmlParseException& exception ) = 0;
virtual bool error( const QXmlParseException& exception ) = 0;
virtual bool fatalError( const QXmlParseException& exception ) = 0;
virtual QString errorString() = 0;
};
class QM_EXPORT QXmlDTDHandler
{
public:
virtual bool notationDecl( const QString& name, const QString& publicId, const QString& systemId ) = 0;
virtual bool unparsedEntityDecl( const QString& name, const QString& publicId, const QString& systemId, const QString& notationName ) = 0;
virtual QString errorString() = 0;
};
class QM_EXPORT QXmlEntityResolver
{
public:
virtual bool resolveEntity( const QString& publicId, const QString& systemId, QXmlInputSource* ret ) = 0;
virtual QString errorString() = 0;
};
class QM_EXPORT QXmlLexicalHandler
{
public:
virtual bool startDTD( const QString& name, const QString& publicId, const QString& systemId ) = 0;
virtual bool endDTD() = 0;
// virtual bool startEntity( const QString& name ) = 0;
// virtual bool endEntity( const QString& name ) = 0;
virtual bool startCDATA() = 0;
virtual bool endCDATA() = 0;
virtual bool comment( const QString& ch ) = 0;
virtual QString errorString() = 0;
};
class QM_EXPORT QXmlDeclHandler
{
public:
virtual bool attributeDecl( const QString& eName, const QString& aName, const QString& type, const QString& valueDefault, const QString& value ) = 0;
virtual bool internalEntityDecl( const QString& name, const QString& value ) = 0;
virtual bool externalEntityDecl( const QString& name, const QString& publicId, const QString& systemId ) = 0;
virtual QString errorString() = 0;
};
class QM_EXPORT QXmlDefaultHandler : public QXmlContentHandler, public QXmlErrorHandler, public QXmlDTDHandler, public QXmlEntityResolver, public QXmlLexicalHandler, public QXmlDeclHandler
{
public:
QXmlDefaultHandler() { }
virtual ~QXmlDefaultHandler() { }
void setDocumentLocator( QXmlLocator* locator );
bool startDocument();
bool endDocument();
bool startPrefixMapping( const QString& prefix, const QString& uri );
bool endPrefixMapping( const QString& prefix );
bool startElement( const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts );
bool endElement( const QString& namespaceURI, const QString& localName, const QString& qName );
bool characters( const QString& ch );
bool ignorableWhitespace( const QString& ch );
bool processingInstruction( const QString& target, const QString& data );
bool skippedEntity( const QString& name );
bool warning( const QXmlParseException& exception );
bool error( const QXmlParseException& exception );
bool fatalError( const QXmlParseException& exception );
bool notationDecl( const QString& name, const QString& publicId, const QString& systemId );
bool unparsedEntityDecl( const QString& name, const QString& publicId, const QString& systemId, const QString& notationName );
bool resolveEntity( const QString& publicId, const QString& systemId, QXmlInputSource* ret );
bool startDTD( const QString& name, const QString& publicId, const QString& systemId );
bool endDTD();
// bool startEntity( const QString& name );
// bool endEntity( const QString& name );
bool startCDATA();
bool endCDATA();
bool comment( const QString& ch );
bool attributeDecl( const QString& eName, const QString& aName, const QString& type, const QString& valueDefault, const QString& value );
bool internalEntityDecl( const QString& name, const QString& value );
bool externalEntityDecl( const QString& name, const QString& publicId, const QString& systemId );
QString errorString();
private:
QXmlDefaultHandlerPrivate *d;
};
//
// inlines
//
inline bool QXmlSimpleReader::is_S(const QChar& ch)
{ return ch==' ' || ch=='\t' || ch=='\n' || ch=='\r'; }
inline bool QXmlSimpleReader::is_Letter( const QChar& ch )
{ return ch.isLetter(); }
inline bool QXmlSimpleReader::is_NameBeginning( const QChar& ch )
{ return ch=='_' || ch==':' || ch.isLetter(); }
inline bool QXmlSimpleReader::is_Digit( const QChar& ch )
{ return ch.isDigit(); }
inline bool QXmlSimpleReader::is_CombiningChar( const QChar& )
{ return FALSE; }
inline bool QXmlSimpleReader::is_Extender( const QChar& )
{ return FALSE; }
inline bool QXmlSimpleReader::is_NameChar( const QChar& ch )
{
return ch=='.' || ch=='-' || ch=='_' || ch==':' ||
is_Letter(ch) || is_Digit(ch) ||
is_CombiningChar(ch) || is_Extender(ch);
}
inline void QXmlSimpleReader::next()
{
if ( !xmlRef.isEmpty() ) {
c = xmlRef[0];
xmlRef.remove( 0, 1 );
} else {
if ( c=='\n' || c=='\r' ) {
lineNr++;
columnNr = -1;
}
if ( pos >= xmlLength ) {
c = QEOF;
} else {
c = xml[pos];
columnNr++;
pos++;
}
}
}
inline bool QXmlSimpleReader::atEnd()
{ return c == QEOF; }
inline void QXmlSimpleReader::eat_ws()
{ while ( !atEnd() && is_S(c) ) next(); }
inline void QXmlSimpleReader::next_eat_ws()
{ next(); eat_ws(); }
// use buffers instead of QString::operator+= when single characters are read
inline QString& QXmlSimpleReader::string()
{
stringValue += QString( stringArray, stringPos );
stringPos = 0;
return stringValue;
}
inline QString& QXmlSimpleReader::name()
{
nameValue += QString( nameArray, namePos );
namePos = 0;
return nameValue;
}
inline QString& QXmlSimpleReader::ref()
{
refValue += QString( refArray, refPos );
refPos = 0;
return refValue;
}
inline void QXmlSimpleReader::stringClear()
{ stringValue = ""; stringPos = 0; }
inline void QXmlSimpleReader::nameClear()
{ nameValue = ""; namePos = 0; }
inline void QXmlSimpleReader::refClear()
{ refValue = ""; refPos = 0; }
inline void QXmlSimpleReader::stringAddC()
{
if ( stringPos >= 256 ) {
stringValue += QString( stringArray, stringPos );
stringPos = 0;
}
stringArray[stringPos++] = c;
}
inline void QXmlSimpleReader::nameAddC()
{
if ( namePos >= 256 ) {
nameValue += QString( nameArray, namePos );
namePos = 0;
}
nameArray[namePos++] = c;
}
inline void QXmlSimpleReader::refAddC()
{
if ( refPos >= 256 ) {
refValue += QString( refArray, refPos );
refPos = 0;
}
refArray[refPos++] = c;
}
inline void QXmlSimpleReader::stringAddC(const QChar& ch)
{
if ( stringPos >= 256 ) {
stringValue += QString( stringArray, stringPos );
stringPos = 0;
}
stringArray[stringPos++] = ch;
}
inline void QXmlSimpleReader::nameAddC(const QChar& ch)
{
if ( namePos >= 256 ) {
nameValue += QString( nameArray, namePos );
namePos = 0;
}
nameArray[namePos++] = ch;
}
inline void QXmlSimpleReader::refAddC(const QChar& ch)
{
if ( refPos >= 256 ) {
refValue += QString( refArray, refPos );
refPos = 0;
}
refArray[refPos++] = ch;
}
#endif //QT_NO_XML
#endif
...@@ -604,6 +604,7 @@ ArgumentList *ClassDef::outerTemplateArguments() const ...@@ -604,6 +604,7 @@ ArgumentList *ClassDef::outerTemplateArguments() const
int ti; int ti;
ClassDef *pcd=0; ClassDef *pcd=0;
int pi=0; int pi=0;
if (tempArgs) return tempArgs;
// find the outer most class scope // find the outer most class scope
while ((ti=name().find("::",pi))!=-1 && while ((ti=name().find("::",pi))!=-1 &&
(pcd=getClass(name().left(ti)))==0 (pcd=getClass(name().left(ti)))==0
...@@ -612,10 +613,7 @@ ArgumentList *ClassDef::outerTemplateArguments() const ...@@ -612,10 +613,7 @@ ArgumentList *ClassDef::outerTemplateArguments() const
{ {
return pcd->templateArguments(); return pcd->templateArguments();
} }
else return 0;
{
return tempArgs;
}
} }
......
/* This file was generated by configgen on Sat Nov 25 21:38:08 2000 /* This file was generated by configgen on Sun Dec 3 18:27:54 2000
* from config_templ.h * from config_templ.h
* *
* DO NOT EDIT! * DO NOT EDIT!
...@@ -98,6 +98,7 @@ struct Config ...@@ -98,6 +98,7 @@ struct Config
static bool noIndexFlag; // generate condensed index flag static bool noIndexFlag; // generate condensed index flag
static int enumValuesPerLine; // number of enum values that are put on one line static int enumValuesPerLine; // number of enum values that are put on one line
static bool ftvHelpFlag; // should a folder tree view be generated? static bool ftvHelpFlag; // should a folder tree view be generated?
static int treeViewWidth; // What is the width of the treeview panel?
static bool generateLatex; // generate Latex output static bool generateLatex; // generate Latex output
static QCString latexOutputDir; // the directory to put the Latex files static QCString latexOutputDir; // the directory to put the Latex files
static bool compactLatexFlag; // generate compact LaTeX documentation. static bool compactLatexFlag; // generate compact LaTeX documentation.
......
/* This file was generated by configgen on Sat Nov 25 21:38:08 2000 /* This file was generated by configgen on Sun Dec 3 19:18:43 2000
* from config_templ.l * from config_templ.l
* *
* DO NOT EDIT! * DO NOT EDIT!
...@@ -135,6 +135,7 @@ bool Config::htmlHelpFlag = FALSE; ...@@ -135,6 +135,7 @@ bool Config::htmlHelpFlag = FALSE;
bool Config::noIndexFlag = FALSE; bool Config::noIndexFlag = FALSE;
int Config::enumValuesPerLine = 4; int Config::enumValuesPerLine = 4;
bool Config::ftvHelpFlag = FALSE; bool Config::ftvHelpFlag = FALSE;
int Config::treeViewWidth = 250;
bool Config::generateLatex = TRUE; bool Config::generateLatex = TRUE;
QCString Config::latexOutputDir = "latex"; QCString Config::latexOutputDir = "latex";
bool Config::compactLatexFlag = FALSE; bool Config::compactLatexFlag = FALSE;
...@@ -215,6 +216,7 @@ static int includeDepth; ...@@ -215,6 +216,7 @@ static int includeDepth;
static QCString tabSizeString; static QCString tabSizeString;
static QCString colsInAlphaIndexString; static QCString colsInAlphaIndexString;
static QCString enumValuesPerLineString; static QCString enumValuesPerLineString;
static QCString treeViewWidthString;
static QCString maxDotGraphWidthString; static QCString maxDotGraphWidthString;
static QCString maxDotGraphHeightString; static QCString maxDotGraphHeightString;
...@@ -413,6 +415,7 @@ static void readIncludeFile(const char *incName) ...@@ -413,6 +415,7 @@ static void readIncludeFile(const char *incName)
<Start>"DISABLE_INDEX"[ \t]*"=" { BEGIN(GetBool); b=&Config::noIndexFlag; } <Start>"DISABLE_INDEX"[ \t]*"=" { BEGIN(GetBool); b=&Config::noIndexFlag; }
<Start>"ENUM_VALUES_PER_LINE"[ \t]*"=" { BEGIN(GetString); s=&enumValuesPerLineString; s->resize(0); } <Start>"ENUM_VALUES_PER_LINE"[ \t]*"=" { BEGIN(GetString); s=&enumValuesPerLineString; s->resize(0); }
<Start>"GENERATE_TREEVIEW"[ \t]*"=" { BEGIN(GetBool); b=&Config::ftvHelpFlag; } <Start>"GENERATE_TREEVIEW"[ \t]*"=" { BEGIN(GetBool); b=&Config::ftvHelpFlag; }
<Start>"TREEVIEW_WIDTH"[ \t]*"=" { BEGIN(GetString); s=&treeViewWidthString; s->resize(0); }
<Start>"GENERATE_LATEX"[ \t]*"=" { BEGIN(GetBool); b=&Config::generateLatex; } <Start>"GENERATE_LATEX"[ \t]*"=" { BEGIN(GetBool); b=&Config::generateLatex; }
<Start>"LATEX_OUTPUT"[ \t]*"=" { BEGIN(GetString); s=&Config::latexOutputDir; s->resize(0); } <Start>"LATEX_OUTPUT"[ \t]*"=" { BEGIN(GetString); s=&Config::latexOutputDir; s->resize(0); }
<Start>"COMPACT_LATEX"[ \t]*"=" { BEGIN(GetBool); b=&Config::compactLatexFlag; } <Start>"COMPACT_LATEX"[ \t]*"=" { BEGIN(GetBool); b=&Config::compactLatexFlag; }
...@@ -713,6 +716,7 @@ void dumpConfig() ...@@ -713,6 +716,7 @@ void dumpConfig()
printf("noIndexFlag=`%d'\n",Config::noIndexFlag); printf("noIndexFlag=`%d'\n",Config::noIndexFlag);
printf("enumValuesPerLine=`%d'\n",Config::enumValuesPerLine); printf("enumValuesPerLine=`%d'\n",Config::enumValuesPerLine);
printf("ftvHelpFlag=`%d'\n",Config::ftvHelpFlag); printf("ftvHelpFlag=`%d'\n",Config::ftvHelpFlag);
printf("treeViewWidth=`%d'\n",Config::treeViewWidth);
printf("# configuration options related to the LaTeX output\n"); printf("# configuration options related to the LaTeX output\n");
printf("generateLatex=`%d'\n",Config::generateLatex); printf("generateLatex=`%d'\n",Config::generateLatex);
printf("latexOutputDir=`%s'\n",Config::latexOutputDir.data()); printf("latexOutputDir=`%s'\n",Config::latexOutputDir.data());
...@@ -882,6 +886,7 @@ void Config::init() ...@@ -882,6 +886,7 @@ void Config::init()
Config::noIndexFlag = FALSE; Config::noIndexFlag = FALSE;
Config::enumValuesPerLine = 4; Config::enumValuesPerLine = 4;
Config::ftvHelpFlag = FALSE; Config::ftvHelpFlag = FALSE;
Config::treeViewWidth = 250;
Config::generateLatex = TRUE; Config::generateLatex = TRUE;
Config::latexOutputDir = "latex"; Config::latexOutputDir = "latex";
Config::compactLatexFlag = FALSE; Config::compactLatexFlag = FALSE;
...@@ -1723,6 +1728,17 @@ void writeTemplateConfig(QFile *f,bool sl) ...@@ -1723,6 +1728,17 @@ void writeTemplateConfig(QFile *f,bool sl)
writeBoolValue(t,Config::ftvHelpFlag); writeBoolValue(t,Config::ftvHelpFlag);
t << "\n"; t << "\n";
if (!sl) if (!sl)
{
t << "\n";
t << "# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be \n";
t << "# used to set the initial width (in pixels) of the frame in which the tree \n";
t << "# is shown. \n";
t << "\n";
}
t << "TREEVIEW_WIDTH = ";
writeIntValue(t,Config::treeViewWidth);
t << "\n";
if (!sl)
{ {
t << "\n"; t << "\n";
} }
...@@ -2356,6 +2372,23 @@ void configStrToVal() ...@@ -2356,6 +2372,23 @@ void configStrToVal()
Config::enumValuesPerLine=cols; Config::enumValuesPerLine=cols;
} }
if (treeViewWidthString.isEmpty())
{
Config::treeViewWidth=250;
}
else
{
bool ok;
int width = treeViewWidthString.toInt(&ok);
if (!ok || width<0 || width>1500)
{
warn_cont("Warning: argument of TREEVIEW_WIDTH is not a valid number in the range [0..1500]!\n"
"Using the default of 250!\n");
width = 250;
}
Config::treeViewWidth=width;
}
if (maxDotGraphWidthString.isEmpty()) if (maxDotGraphWidthString.isEmpty())
{ {
Config::maxDotGraphWidth=1024; Config::maxDotGraphWidth=1024;
......
...@@ -560,11 +560,15 @@ static void addListItemMarker(const char *marker,int dashPos,bool enumerated) ...@@ -560,11 +560,15 @@ static void addListItemMarker(const char *marker,int dashPos,bool enumerated)
listIndentStack.top()->writeItem(); listIndentStack.top()->writeItem();
} }
else // end sub item list else // end sub item list
{
while (pPrevInfo && pPrevInfo->indent>indent)
{ {
pPrevInfo->endList(); pPrevInfo->endList();
listIndentStack.pop(); listIndentStack.pop();
currentListIndent.pop(); currentListIndent.pop();
delete pPrevInfo; delete pPrevInfo;
pPrevInfo = listIndentStack.top();
}
// safe guard against wrong indenting // safe guard against wrong indenting
if (listIndentStack.isEmpty()) if (listIndentStack.isEmpty())
{ {
...@@ -855,7 +859,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") ...@@ -855,7 +859,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"")
int dashPos = text.findRev('-'); int dashPos = text.findRev('-');
//printf("dashPos=%d char='%c'\n",dashPos,text.at(dashPos+1)); //printf("dashPos=%d char='%c'\n",dashPos,text.at(dashPos+1));
bool isEnumerated = text.at(dashPos+1)=='#'; bool isEnumerated = text.at(dashPos+1)=='#';
addListItemMarker(yytext,dashPos,isEnumerated); addListItemMarker(yytext,dashPos+1,isEnumerated);
} }
<DocScan>\n{B}*(("//"{B}*)?)"*"*{B}*"-"("#")?{B}+ { /* found list item marker */ <DocScan>\n{B}*(("//"{B}*)?)"*"*{B}*"-"("#")?{B}+ { /* found list item marker */
QCString text=yytext; QCString text=yytext;
......
...@@ -731,7 +731,7 @@ static void buildClassList(Entry *root) ...@@ -731,7 +731,7 @@ static void buildClassList(Entry *root)
ClassDef *cd=new ClassDef(root->fileName,root->startLine,fullName,sec); ClassDef *cd=new ClassDef(root->fileName,root->startLine,fullName,sec);
cd->setDocumentation(root->doc); // copy docs to definition cd->setDocumentation(root->doc); // copy docs to definition
cd->setBriefDescription(root->brief); cd->setBriefDescription(root->brief);
//printf("new ClassDef tempArgList=%p specScope=%s\n",root->tArgList,root->scopeSpec.data()); //printf("new ClassDef %s tempArgList=%p specScope=%s\n",fullName.data(),root->tArgList,root->scopeSpec.data());
cd->setTemplateArguments(root->tArgList); cd->setTemplateArguments(root->tArgList);
cd->setProtection(root->protection); cd->setProtection(root->protection);
cd->addSectionsToDefinition(root->anchors); cd->addSectionsToDefinition(root->anchors);
...@@ -1364,7 +1364,7 @@ static MemberDef *addVariableToFile( ...@@ -1364,7 +1364,7 @@ static MemberDef *addVariableToFile(
void buildVarList(Entry *root) void buildVarList(Entry *root)
{ {
QRegExp re("([^)]*)"); static const QRegExp re("([^)]*)");
int i=-1; int i=-1;
if (!root->name.isEmpty() && if (!root->name.isEmpty() &&
//root->type!="class" && root->type!="interface" && //root->type!="class" && root->type!="interface" &&
...@@ -1397,9 +1397,9 @@ void buildVarList(Entry *root) ...@@ -1397,9 +1397,9 @@ void buildVarList(Entry *root)
{ {
// recover from parse error caused by redundant braces // recover from parse error caused by redundant braces
root->type=root->name; root->type=root->name;
QRegExp re("[a-z_A-Z][a-z_A-Z0-9]*"); static const QRegExp reName("[a-z_A-Z][a-z_A-Z0-9]*");
int l; int l;
i=root->args.isEmpty() ? -1 : re.match(root->args,0,&l); i=root->args.isEmpty() ? -1 : reName.match(root->args,0,&l);
root->name=root->args.mid(i,l); root->name=root->args.mid(i,l);
root->args=root->args.mid(i+l,root->args.find(')',i+l)-i-l); root->args=root->args.mid(i+l,root->args.find(')',i+l)-i-l);
//printf("new: type=`%s' name=`%s' args=`%s'\n", //printf("new: type=`%s' name=`%s' args=`%s'\n",
...@@ -1408,12 +1408,21 @@ void buildVarList(Entry *root) ...@@ -1408,12 +1408,21 @@ void buildVarList(Entry *root)
else else
{ {
i=root->type.find(re,0); i=root->type.find(re,0);
if (i!=-1) // function variable if (i!=-1) // function pointer
{
int ai = root->type.find('[',i);
if (ai>i) // function pointer array
{
root->args.prepend(root->type.right(root->type.length()-ai));
root->type=root->type.left(ai);
}
else
{ {
root->type=root->type.left(root->type.length()-1); root->type=root->type.left(root->type.length()-1);
root->args.prepend(")"); root->args.prepend(")");
} }
} }
}
QCString scope,name=root->name.copy(); QCString scope,name=root->name.copy();
//int si; //int si;
...@@ -2046,6 +2055,14 @@ static void transferFunctionDocumentation() ...@@ -2046,6 +2055,14 @@ static void transferFunctionDocumentation()
if (mdef && mdec && if (mdef && mdec &&
matchArguments(mdef->argumentList(),mdec->argumentList()) matchArguments(mdef->argumentList(),mdec->argumentList())
) /* match found */ ) /* match found */
{
FileDef *fdef = mdef->getFileDef();
FileDef *fdec = mdec->getFileDef();
// check if not in different but documented files
if (Config::extractAllFlag ||
fdef==fdec ||
!fdef->hasDocumentation() || !mdec->hasDocumentation())
{ {
//printf("Found member %s: def in %s and dec in %s\n", //printf("Found member %s: def in %s and dec in %s\n",
// mn->memberName(),mdef->getFileDef()->name().data(), // mn->memberName(),mdef->getFileDef()->name().data(),
...@@ -2082,6 +2099,7 @@ static void transferFunctionDocumentation() ...@@ -2082,6 +2099,7 @@ static void transferFunctionDocumentation()
mdef->mergeMemberSpecifiers(mdec->getMemberSpecifiers()); mdef->mergeMemberSpecifiers(mdec->getMemberSpecifiers());
} }
} }
}
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
......
...@@ -164,6 +164,10 @@ void FileDef::writeDocumentation(OutputList &ol) ...@@ -164,6 +164,10 @@ void FileDef::writeDocumentation(OutputList &ol)
ol.docify(ii->includeName); ol.docify(ii->includeName);
ol.enableAll(); ol.enableAll();
ol.disableAllBut(OutputGenerator::Html); ol.disableAllBut(OutputGenerator::Html);
// Here we use the include file name as it appears in the file.
// we could also we the name as it is used within doxygen,
// then we should have used fd->docName() instead of ii->includeName
if (fd && fd->isLinkable() && fd->generateSourceFile()) if (fd && fd->isLinkable() && fd->generateSourceFile())
{ {
ol.writeObjectLink(fd->getReference(),fd->includeName(),0,ii->includeName); ol.writeObjectLink(fd->getReference(),fd->includeName(),0,ii->includeName);
...@@ -172,6 +176,7 @@ void FileDef::writeDocumentation(OutputList &ol) ...@@ -172,6 +176,7 @@ void FileDef::writeDocumentation(OutputList &ol)
{ {
ol.docify(ii->includeName); ol.docify(ii->includeName);
} }
ol.enableAll(); ol.enableAll();
if (ii->local) if (ii->local)
ol.docify("\""); ol.docify("\"");
...@@ -438,7 +443,10 @@ void FileDef::writeSource(OutputList &ol) ...@@ -438,7 +443,10 @@ void FileDef::writeSource(OutputList &ol)
initParseCodeContext(); initParseCodeContext();
ol.startCodeFragment(); ol.startCodeFragment();
parseCode(ol,0,fileToString(absFilePath(),TRUE),FALSE,0,this); parseCode(ol,0,
fileToString(absFilePath(),Config::filterForSourceFlag),
FALSE,0,this
);
ol.endCodeFragment(); ol.endCodeFragment();
endFile(ol); endFile(ol);
ol.enableAll(); ol.enableAll();
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "ftvhelp.h" #include "ftvhelp.h"
#include "config.h" #include "config.h"
#include "message.h" #include "message.h"
#include "doxygen.h"
const char treeview_data[]= const char treeview_data[]=
...@@ -272,7 +273,7 @@ static void generateFolderTreeViewData() ...@@ -272,7 +273,7 @@ static void generateFolderTreeViewData()
{ {
QTextStream t(&f); QTextStream t(&f);
t << "<html><head><title>" << Config::projectName << "</title></head>" << endl; t << "<html><head><title>" << Config::projectName << "</title></head>" << endl;
t << "<frameset cols=\"250,*\">" << endl; t << "<frameset cols=\"" << Config::treeViewWidth << ",*\">" << endl;
t << " <frame src=\"tree.html\" name=\"treefrm\">" << endl; t << " <frame src=\"tree.html\" name=\"treefrm\">" << endl;
t << " <frame src=\"main.html\" name=\"basefrm\">" << endl; t << " <frame src=\"main.html\" name=\"basefrm\">" << endl;
t << "</frameset>" << endl; t << "</frameset>" << endl;
...@@ -360,7 +361,7 @@ void FTVHelp::initialize() ...@@ -360,7 +361,7 @@ void FTVHelp::initialize()
} }
/* Write the header of the contents file */ /* Write the header of the contents file */
m_cts.setDevice(m_cf); m_cts.setDevice(m_cf);
m_cts << "foldersTree = gFld(\"<b>"; m_cts << "foldersTree = gFld(\"\", \"<b>";
if (Config::projectName.isEmpty()) if (Config::projectName.isEmpty())
{ {
m_cts << "Root"; m_cts << "Root";
...@@ -409,18 +410,35 @@ int FTVHelp::decContentsDepth() ...@@ -409,18 +410,35 @@ int FTVHelp::decContentsDepth()
* \param name the name of the item. * \param name the name of the item.
* \param ref the URL of to the item. * \param ref the URL of to the item.
*/ */
void FTVHelp::addContentsItem(bool isDir,const char *name,const char *ref, void FTVHelp::addContentsItem(bool isDir,
const char *anchor) const char *ref,
const char *file,
const char *anchor,
const char *name
)
{ {
int i; for (i=0;i<m_dc;i++) m_cts << " "; int i; for (i=0;i<m_dc;i++) m_cts << " ";
QCString parent; QCString parent;
QCString tagName = ref;
QCString tagDir;
if (ref)
{
tagName += ":";
QCString *s = tagDestinationDict[ref];
if (s)
{
tagDir = *s + "/";
tagName += tagDir;
}
}
if (m_dc==0) parent="foldersTree"; else parent.sprintf("aux%d",m_dc); if (m_dc==0) parent="foldersTree"; else parent.sprintf("aux%d",m_dc);
if (isDir) // directory entry if (isDir) // directory entry
{ {
m_cts << "aux" << m_dc+1 << " = insFld(" << parent << ", gFld(\"" << name << "\", "; m_cts << "aux" << m_dc+1 << " = insFld(" << parent << ", gFld(\""
if (ref) // ref optional param << name << "\", \"" << tagName << "\", ";
if (file) // file optional param
{ {
m_cts << "\"" << ref << ".html\"))"; m_cts << "\"" << tagDir << file << ".html\"))";
} }
else else
{ {
...@@ -429,10 +447,11 @@ void FTVHelp::addContentsItem(bool isDir,const char *name,const char *ref, ...@@ -429,10 +447,11 @@ void FTVHelp::addContentsItem(bool isDir,const char *name,const char *ref,
} }
else // text entry else // text entry
{ {
m_cts << " insDoc(" << parent << ", gLnk(0, \"" << name << "\", "; m_cts << " insDoc(" << parent << ", gLnk(\""
if (ref) // ref optional param << name << "\", \"" << tagName << "\", ";
if (file) // ref optional param
{ {
m_cts << "\"" << ref << ".html"; m_cts << "\"" << tagDir << file << ".html";
if (anchor) m_cts << "#" << anchor; if (anchor) m_cts << "#" << anchor;
m_cts << "\"))"; m_cts << "\"))";
} }
......
...@@ -32,8 +32,10 @@ class FTVHelp ...@@ -32,8 +32,10 @@ class FTVHelp
/*! return the current depth of the contents tree */ /*! return the current depth of the contents tree */
int contentsDepth() { return m_dc; } int contentsDepth() { return m_dc; }
void addContentsItem(bool isDir, void addContentsItem(bool isDir,
const char *name, const char *ref = 0, const char *ref,
const char *anchor = 0); const char *file,
const char *anchor,
const char *name);
private: private:
FTVHelp(); FTVHelp();
......
...@@ -540,6 +540,7 @@ void HtmlGenerator::codify(const char *str) ...@@ -540,6 +540,7 @@ void HtmlGenerator::codify(const char *str)
break; break;
case '\n': t << '\n'; col=0; case '\n': t << '\n'; col=0;
break; break;
case '\r': break;
case '<': t << "&lt;"; col++; case '<': t << "&lt;"; col++;
break; break;
case '>': t << "&gt;"; col++; case '>': t << "&gt;"; col++;
......
...@@ -144,7 +144,7 @@ void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper) ...@@ -144,7 +144,7 @@ void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper)
} }
if (hasFtvHelp) if (hasFtvHelp)
{ {
ftvHelp->addContentsItem(hasChildren,cd->name(),cd->getOutputFileBase()); ftvHelp->addContentsItem(hasChildren,cd->getReference(),cd->getOutputFileBase(),0,cd->name());
} }
} }
else else
...@@ -156,7 +156,7 @@ void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper) ...@@ -156,7 +156,7 @@ void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper)
} }
if (hasFtvHelp) if (hasFtvHelp)
{ {
ftvHelp->addContentsItem(hasChildren,cd->name(),0); ftvHelp->addContentsItem(hasChildren,0,0,0,cd->name());
} }
} }
if (hasChildren) if (hasChildren)
...@@ -271,7 +271,7 @@ void writeClassTree(ClassList *cl) ...@@ -271,7 +271,7 @@ void writeClassTree(ClassList *cl)
} }
if (hasFtvHelp) if (hasFtvHelp)
{ {
ftvHelp->addContentsItem(hasChildren,cd->name(),cd->getOutputFileBase()); ftvHelp->addContentsItem(hasChildren,cd->getReference(),cd->getOutputFileBase(),0,cd->name());
} }
} }
if (hasChildren) if (hasChildren)
...@@ -340,7 +340,7 @@ void writeClassHierarchy(OutputList &ol) ...@@ -340,7 +340,7 @@ void writeClassHierarchy(OutputList &ol)
} }
if (hasFtvHelp) if (hasFtvHelp)
{ {
ftvHelp->addContentsItem(hasChildren,cd->name(),cd->getOutputFileBase()); ftvHelp->addContentsItem(hasChildren,cd->getReference(),cd->getOutputFileBase(),0,cd->name());
} }
} }
else else
...@@ -352,7 +352,7 @@ void writeClassHierarchy(OutputList &ol) ...@@ -352,7 +352,7 @@ void writeClassHierarchy(OutputList &ol)
} }
if (hasFtvHelp) if (hasFtvHelp)
{ {
ftvHelp->addContentsItem(hasChildren,cd->name(),0); ftvHelp->addContentsItem(hasChildren,0,0,0,cd->name());
} }
} }
if (hasChildren) if (hasChildren)
...@@ -412,7 +412,7 @@ void writeHierarchicalIndex(OutputList &ol) ...@@ -412,7 +412,7 @@ void writeHierarchicalIndex(OutputList &ol)
if (Config::generateHtml && Config::ftvHelpFlag /*&& !Config::htmlHelpGroupsOnly*/) if (Config::generateHtml && Config::ftvHelpFlag /*&& !Config::htmlHelpGroupsOnly*/)
{ {
ftvHelp = FTVHelp::getInstance(); ftvHelp = FTVHelp::getInstance();
ftvHelp->addContentsItem(TRUE,ftvHelpTitle,"hierarchy"); ftvHelp->addContentsItem(TRUE,0,"hierarchy",0,ftvHelpTitle);
} }
if (Config::haveDotFlag && Config::gfxHierarchyFlag) if (Config::haveDotFlag && Config::gfxHierarchyFlag)
{ {
...@@ -459,7 +459,7 @@ void writeGraphicalClassHierarchy(OutputList &ol) ...@@ -459,7 +459,7 @@ void writeGraphicalClassHierarchy(OutputList &ol)
if (Config::generateHtml && Config::ftvHelpFlag) if (Config::generateHtml && Config::ftvHelpFlag)
{ {
ftvHelp = FTVHelp::getInstance(); ftvHelp = FTVHelp::getInstance();
ftvHelp->addContentsItem(FALSE,ftvHelpTitle,"inherits"); ftvHelp->addContentsItem(FALSE,0,"inherits",0,ftvHelpTitle);
} }
ol.startTextLink("hierarchy",0); ol.startTextLink("hierarchy",0);
parseText(ol,theTranslator->trGotoTextualHierarchy()); parseText(ol,theTranslator->trGotoTextualHierarchy());
...@@ -538,7 +538,7 @@ void writeFileIndex(OutputList &ol) ...@@ -538,7 +538,7 @@ void writeFileIndex(OutputList &ol)
if (hasFtvHelp) if (hasFtvHelp)
{ {
ftvHelp = FTVHelp::getInstance(); ftvHelp = FTVHelp::getInstance();
ftvHelp->addContentsItem(TRUE,ftvHelpTitle,"files"); ftvHelp->addContentsItem(TRUE,0,"files",0,ftvHelpTitle);
ftvHelp->incContentsDepth(); ftvHelp->incContentsDepth();
} }
//ol.newParagraph(); //ol.newParagraph();
...@@ -638,7 +638,7 @@ void writeFileIndex(OutputList &ol) ...@@ -638,7 +638,7 @@ void writeFileIndex(OutputList &ol)
} }
if (hasFtvHelp) if (hasFtvHelp)
{ {
ftvHelp->addContentsItem(FALSE,fd->name(),fd->getOutputFileBase()); ftvHelp->addContentsItem(FALSE,fd->getReference(),fd->getOutputFileBase(),0,fd->name());
} }
} }
else else
...@@ -652,7 +652,7 @@ void writeFileIndex(OutputList &ol) ...@@ -652,7 +652,7 @@ void writeFileIndex(OutputList &ol)
} }
if (hasFtvHelp) if (hasFtvHelp)
{ {
ftvHelp->addContentsItem(FALSE,fd->name(),0); ftvHelp->addContentsItem(FALSE,0,0,0,fd->name());
} }
} }
if (src) if (src)
...@@ -738,7 +738,7 @@ void writeNamespaceIndex(OutputList &ol) ...@@ -738,7 +738,7 @@ void writeNamespaceIndex(OutputList &ol)
if (hasFtvHelp) if (hasFtvHelp)
{ {
ftvHelp = FTVHelp::getInstance(); ftvHelp = FTVHelp::getInstance();
ftvHelp->addContentsItem(TRUE,ftvHelpTitle,"namespaces"); ftvHelp->addContentsItem(TRUE,0,"namespaces",0,ftvHelpTitle);
ftvHelp->incContentsDepth(); ftvHelp->incContentsDepth();
} }
//ol.newParagraph(); //ol.newParagraph();
...@@ -771,7 +771,7 @@ void writeNamespaceIndex(OutputList &ol) ...@@ -771,7 +771,7 @@ void writeNamespaceIndex(OutputList &ol)
} }
if (hasFtvHelp) if (hasFtvHelp)
{ {
ftvHelp->addContentsItem(FALSE,nd->name(),nd->getOutputFileBase()); ftvHelp->addContentsItem(FALSE,nd->getReference(),nd->getOutputFileBase(),0,nd->name());
} }
} }
nd=namespaceList.next(); nd=namespaceList.next();
...@@ -851,7 +851,7 @@ void writeAnnotatedClassList(OutputList &ol) ...@@ -851,7 +851,7 @@ void writeAnnotatedClassList(OutputList &ol)
} }
if (hasFtvHelp) if (hasFtvHelp)
{ {
FTVHelp::getInstance()->addContentsItem(FALSE,cd->name(),cd->getOutputFileBase()); FTVHelp::getInstance()->addContentsItem(FALSE,cd->getReference(),cd->getOutputFileBase(),0,cd->name());
} }
} }
cd=classList.next(); cd=classList.next();
...@@ -1060,7 +1060,7 @@ void writeAnnotatedIndex(OutputList &ol) ...@@ -1060,7 +1060,7 @@ void writeAnnotatedIndex(OutputList &ol)
if (hasFtvHelp) if (hasFtvHelp)
{ {
ftvHelp = FTVHelp::getInstance(); ftvHelp = FTVHelp::getInstance();
ftvHelp->addContentsItem(TRUE,ftvHelpTitle,"annotated"); ftvHelp->addContentsItem(TRUE,0,"annotated",0,ftvHelpTitle);
ftvHelp->incContentsDepth(); ftvHelp->incContentsDepth();
} }
parseText(ol,theTranslator->trCompoundListDescription()); parseText(ol,theTranslator->trCompoundListDescription());
...@@ -1536,7 +1536,7 @@ void writeExampleIndex(OutputList &ol) ...@@ -1536,7 +1536,7 @@ void writeExampleIndex(OutputList &ol)
if (hasFtvHelp) if (hasFtvHelp)
{ {
ftvHelp = FTVHelp::getInstance(); ftvHelp = FTVHelp::getInstance();
ftvHelp->addContentsItem(TRUE,ftvHelpTitle,"examples"); ftvHelp->addContentsItem(TRUE,0,"examples",0,ftvHelpTitle);
ftvHelp->incContentsDepth(); ftvHelp->incContentsDepth();
} }
parseText(ol,theTranslator->trExamplesDescription()); parseText(ol,theTranslator->trExamplesDescription());
...@@ -1553,13 +1553,13 @@ void writeExampleIndex(OutputList &ol) ...@@ -1553,13 +1553,13 @@ void writeExampleIndex(OutputList &ol)
{ {
ol.writeObjectLink(0,n,0,pi->title); ol.writeObjectLink(0,n,0,pi->title);
if (hasHtmlHelp) htmlHelp->addContentsItem(FALSE,pi->title,n); if (hasHtmlHelp) htmlHelp->addContentsItem(FALSE,pi->title,n);
if (hasFtvHelp) ftvHelp->addContentsItem(FALSE,pi->title,n); if (hasFtvHelp) ftvHelp->addContentsItem(FALSE,0,n,0,pi->title);
} }
else else
{ {
ol.writeObjectLink(0,n,0,pi->name); ol.writeObjectLink(0,n,0,pi->name);
if (hasHtmlHelp) htmlHelp->addContentsItem(FALSE,pi->name,n); if (hasHtmlHelp) htmlHelp->addContentsItem(FALSE,pi->name,n);
if (hasFtvHelp) ftvHelp->addContentsItem(FALSE,pi->name,n); if (hasFtvHelp) ftvHelp->addContentsItem(FALSE,0,n,0,pi->name);
} }
ol.writeString("\n"); ol.writeString("\n");
} }
...@@ -1620,7 +1620,7 @@ void writePageIndex(OutputList &ol) ...@@ -1620,7 +1620,7 @@ void writePageIndex(OutputList &ol)
if (hasFtvHelp) if (hasFtvHelp)
{ {
ftvHelp = FTVHelp::getInstance(); ftvHelp = FTVHelp::getInstance();
ftvHelp->addContentsItem(TRUE,ftvHelpTitle,"pages"); ftvHelp->addContentsItem(TRUE,0,"pages",0,ftvHelpTitle);
ftvHelp->incContentsDepth(); ftvHelp->incContentsDepth();
} }
parseText(ol,theTranslator->trRelatedPagesDescription()); parseText(ol,theTranslator->trRelatedPagesDescription());
...@@ -1651,7 +1651,7 @@ void writePageIndex(OutputList &ol) ...@@ -1651,7 +1651,7 @@ void writePageIndex(OutputList &ol)
ol.writeEndAnnoItem(pageName); ol.writeEndAnnoItem(pageName);
ol.writeString("\n"); ol.writeString("\n");
if (hasHtmlHelp) htmlHelp->addContentsItem(FALSE,pageTitle,pageName); if (hasHtmlHelp) htmlHelp->addContentsItem(FALSE,pageTitle,pageName);
if (hasFtvHelp) ftvHelp->addContentsItem(FALSE,pageTitle,pageName); if (hasFtvHelp) ftvHelp->addContentsItem(FALSE,0,pageName,0,pageTitle);
} }
} }
ol.endIndexList(); ol.endIndexList();
...@@ -1742,7 +1742,7 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd) ...@@ -1742,7 +1742,7 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd)
} }
if(ftvHelp) if(ftvHelp)
{ {
ftvHelp->addContentsItem(hasSubGroups || hasSubPages,gd->groupTitle(),gd->getOutputFileBase()); ftvHelp->addContentsItem(hasSubGroups || hasSubPages,gd->getReference(),gd->getOutputFileBase(),0,gd->groupTitle());
ftvHelp->incContentsDepth(); ftvHelp->incContentsDepth();
} }
...@@ -1770,9 +1770,10 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd) ...@@ -1770,9 +1770,10 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd)
si ? si->label.data() : 0 si ? si->label.data() : 0
); );
if(ftvHelp) ftvHelp->addContentsItem(FALSE, if(ftvHelp) ftvHelp->addContentsItem(FALSE,
convertToHtml(pi->title), gd->getReference(),
gd->getOutputFileBase(), gd->getOutputFileBase(),
si ? si->label.data() : 0 si ? si->label.data() : 0,
convertToHtml(pi->title)
); );
} }
...@@ -1972,7 +1973,7 @@ void writeGroupIndex(OutputList &ol) ...@@ -1972,7 +1973,7 @@ void writeGroupIndex(OutputList &ol)
ftvHelp = FTVHelp::getInstance(); ftvHelp = FTVHelp::getInstance();
//if(!Config::htmlHelpGroupsOnly) //if(!Config::htmlHelpGroupsOnly)
//{ //{
ftvHelp->addContentsItem(TRUE,htmlHelpTitle,"modules"); ftvHelp->addContentsItem(TRUE,0,"modules",0,htmlHelpTitle);
ftvHelp->incContentsDepth(); ftvHelp->incContentsDepth();
//} //}
} }
...@@ -2042,7 +2043,7 @@ void writeIndex(OutputList &ol) ...@@ -2042,7 +2043,7 @@ void writeIndex(OutputList &ol)
} }
if (Config::generateHtml && Config::ftvHelpFlag) if (Config::generateHtml && Config::ftvHelpFlag)
{ {
FTVHelp::getInstance()->addContentsItem(FALSE,title,indexName); FTVHelp::getInstance()->addContentsItem(FALSE,0,indexName,0,title);
} }
if (!Config::noIndexFlag) writeQuickLinks(ol,TRUE); if (!Config::noIndexFlag) writeQuickLinks(ol,TRUE);
......
...@@ -120,6 +120,7 @@ void writeInstallScript() ...@@ -120,6 +120,7 @@ void writeInstallScript()
t << " $match = \".html\";\n"; t << " $match = \".html\";\n";
t << " next if ( $file =~ /^\\.\\.?$/ );\n"; t << " next if ( $file =~ /^\\.\\.?$/ );\n";
t << " ($file =~ /$match/) && (push @files, $file);\n"; t << " ($file =~ /$match/) && (push @files, $file);\n";
t << " ($file =~ \"tree.js\") && (push @files, $file);\n";
t << " }\n"; t << " }\n";
t << " closedir(D);\n"; t << " closedir(D);\n";
t << " }\n"; t << " }\n";
...@@ -145,10 +146,18 @@ void writeInstallScript() ...@@ -145,10 +146,18 @@ void writeInstallScript()
t << " print STDERR \"Error: opening file $oldf for writing\\n\";\n"; t << " print STDERR \"Error: opening file $oldf for writing\\n\";\n";
t << " exit 1;\n"; t << " exit 1;\n";
t << " }\n"; t << " }\n";
t << " if ($oldf!=\"tree.js\") {\n";
t << " while (<F>) {\n"; t << " while (<F>) {\n";
t << " s/doxygen\\=\\\"([^ \\\"\\:\\t\\>\\<]*)\\:([^ \\\"\\t\\>\\<]*)\\\" (href|src)=\\\"\\2/doxygen\\=\\\"$1:$subst{$1}\\\" \\3=\\\"$subst{$1}/g;\n"; t << " s/doxygen\\=\\\"([^ \\\"\\:\\t\\>\\<]*)\\:([^ \\\"\\t\\>\\<]*)\\\" (href|src)=\\\"\\2/doxygen\\=\\\"$1:$subst{$1}\\\" \\3=\\\"$subst{$1}/g;\n";
t << " print G \"$_\";\n"; t << " print G \"$_\";\n";
t << " }\n"; t << " }\n";
t << " }\n";
t << " else {\n";
t << " while (<F>) {\n";
t << " s/\\\"([^ \\\"\\:\\t\\>\\<]*)\\:([^ \\\"\\t\\>\\<]*)\\\", \\\"\\2/\\\"$1:$subst{$1}\\\" ,\\\"$subst{$1}/g;\n";
t << " print G \"$_\";\n";
t << " }\n";
t << " }\n";
t << " } \n"; t << " } \n";
t << " else {\n"; t << " else {\n";
t << " print STDERR \"Warning file $f does not exist\\n\";\n"; t << " print STDERR \"Warning file $f does not exist\\n\";\n";
......
...@@ -93,6 +93,7 @@ static QCString g_lastGuardName; ...@@ -93,6 +93,7 @@ static QCString g_lastGuardName;
static QCString g_incName; static QCString g_incName;
static QCString g_guardExpr; static QCString g_guardExpr;
static int g_curlyCount; static int g_curlyCount;
static bool g_nospaces; // add extra spaces during macro expansion
static void setFileName(const char *name) static void setFileName(const char *name)
{ {
...@@ -494,6 +495,7 @@ static bool replaceFunctionMacro(const QCString &expr,QCString *rest,int pos,int ...@@ -494,6 +495,7 @@ static bool replaceFunctionMacro(const QCString &expr,QCString *rest,int pos,int
if (key.length()>1 && (subst=argTable[key])) if (key.length()>1 && (subst=argTable[key]))
{ {
QCString substArg=*subst; QCString substArg=*subst;
//printf("substArg=`%s'\n",substArg.data());
// only if no ## operator is before or after the argument // only if no ## operator is before or after the argument
// marker we do macro expansion. // marker we do macro expansion.
if (!hash) expandExpression(substArg,0,0); if (!hash) expandExpression(substArg,0,0);
...@@ -506,12 +508,19 @@ static bool replaceFunctionMacro(const QCString &expr,QCString *rest,int pos,int ...@@ -506,12 +508,19 @@ static bool replaceFunctionMacro(const QCString &expr,QCString *rest,int pos,int
resExpr+=stringize(substArg); resExpr+=stringize(substArg);
} }
else else
{
if (g_nospaces)
{
resExpr+=substArg;
}
else
{ {
resExpr+=" "+substArg+" "; resExpr+=" "+substArg+" ";
} }
} }
} }
} }
}
else // no marker, just copy else // no marker, just copy
{ {
if (!inString && d.at(k)=='\"') if (!inString && d.at(k)=='\"')
...@@ -597,7 +606,15 @@ static void expandExpression(QCString &expr,QCString *rest,int pos) ...@@ -597,7 +606,15 @@ static void expandExpression(QCString &expr,QCString *rest,int pos)
{ {
// substitute the definition of the macro // substitute the definition of the macro
//printf("macro `%s'->`%s'\n",macroName.data(),def->definition.data()); //printf("macro `%s'->`%s'\n",macroName.data(),def->definition.data());
if (g_nospaces)
{
expMacro=def->definition.stripWhiteSpace();
}
else
{
expMacro=" "+def->definition.stripWhiteSpace()+" "; expMacro=" "+def->definition.stripWhiteSpace()+" ";
}
//expMacro=def->definition.stripWhiteSpace();
replaced=TRUE; replaced=TRUE;
len=l; len=l;
//printf("simple macro expansion=`%s'->`%s'\n",macroName.data(),expMacro.data()); //printf("simple macro expansion=`%s'->`%s'\n",macroName.data(),expMacro.data());
...@@ -1086,6 +1103,7 @@ BN [ \t\r\n] ...@@ -1086,6 +1103,7 @@ BN [ \t\r\n]
else // g_findDefArgContext==IncludeID else // g_findDefArgContext==IncludeID
{ {
readIncludeFile(result); readIncludeFile(result);
g_nospaces=FALSE;
BEGIN(Start); BEGIN(Start);
} }
} }
...@@ -1339,12 +1357,14 @@ BN [ \t\r\n] ...@@ -1339,12 +1357,14 @@ BN [ \t\r\n]
BEGIN(SkipCPPBlock); BEGIN(SkipCPPBlock);
} }
<IncludeID>{ID}{B}*/"(" { <IncludeID>{ID}{B}*/"(" {
g_nospaces=TRUE;
g_roundCount=0; g_roundCount=0;
g_defArgsStr=yytext; g_defArgsStr=yytext;
g_findDefArgContext = IncludeID; g_findDefArgContext = IncludeID;
BEGIN(FindDefineArgs); BEGIN(FindDefineArgs);
} }
<IncludeID>{ID} { <IncludeID>{ID} {
g_nospaces=TRUE;
readIncludeFile(expandMacro(yytext)); readIncludeFile(expandMacro(yytext));
BEGIN(Start); BEGIN(Start);
} }
...@@ -1529,12 +1549,12 @@ BN [ \t\r\n] ...@@ -1529,12 +1549,12 @@ BN [ \t\r\n]
int *n; int *n;
if ((n=(*g_argDict)[yytext])) if ((n=(*g_argDict)[yytext]))
{ {
if (!g_quoteArg) g_defText+=' '; //if (!g_quoteArg) g_defText+=' ';
g_defText+='@'; g_defText+='@';
QCString numStr; QCString numStr;
numStr.sprintf("%d",*n); numStr.sprintf("%d",*n);
g_defText+=numStr; g_defText+=numStr;
if (!g_quoteArg) g_defText+=' '; //if (!g_quoteArg) g_defText+=' ';
} }
else else
{ {
...@@ -1768,6 +1788,7 @@ void preprocessFile(const char *fileName,BufStr &output) ...@@ -1768,6 +1788,7 @@ void preprocessFile(const char *fileName,BufStr &output)
//#endif //#endif
g_curlyCount=0; g_curlyCount=0;
g_nospaces=FALSE;
g_outputBuf=&output; g_outputBuf=&output;
g_includeStack.setAutoDelete(TRUE); g_includeStack.setAutoDelete(TRUE);
g_includeStack.clear(); g_includeStack.clear();
......
...@@ -693,6 +693,11 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -693,6 +693,11 @@ TITLE [tT][iI][tT][lL][eE]
current->fileName = yyFileName; current->fileName = yyFileName;
current->startLine = yyLineNr; current->startLine = yyLineNr;
current->bodyLine = yyLineNr; current->bodyLine = yyLineNr;
if (current->mtArgList) // transfer template arguments
{
current->tArgList = current->mtArgList;
current->mtArgList = 0;
}
lineCount() ; lineCount() ;
BEGIN( CompoundName ) ; BEGIN( CompoundName ) ;
} }
...@@ -749,9 +754,9 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -749,9 +754,9 @@ TITLE [tT][iI][tT][lL][eE]
lineCount(); lineCount();
// class template specifier already found => member template specifier // class template specifier already found => member template specifier
// already inside class => member template specifier // already inside class => member template specifier
if (current->tArgList || (current_root->section&Entry::COMPOUND_MASK)) //if (current->tArgList /*|| (current_root->section&Entry::COMPOUND_MASK)*/)
{ //{
//printf("-------> member template\n"); // printf("-------> member template \n");
if (current->mtArgList) if (current->mtArgList)
{ {
current->mtArgList->clear(); current->mtArgList->clear();
...@@ -762,26 +767,25 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -762,26 +767,25 @@ TITLE [tT][iI][tT][lL][eE]
current->mtArgList->setAutoDelete(TRUE); current->mtArgList->setAutoDelete(TRUE);
} }
currentArgumentList = current->mtArgList; currentArgumentList = current->mtArgList;
} //}
else // class template specifier //else // class template specifier
{ //{
//printf("-------> class template\n"); // printf("-------> class template\n");
if (current->tArgList) // if (current->tArgList)
{ // {
current->tArgList->clear(); // current->tArgList->clear();
} // }
else // else
{ // {
current->tArgList = new ArgumentList; // current->tArgList = new ArgumentList;
current->tArgList->setAutoDelete(TRUE); // current->tArgList->setAutoDelete(TRUE);
} // }
currentArgumentList = current->tArgList; // currentArgumentList = current->tArgList;
} //}
templateStr="<"; templateStr="<";
fullArgString = templateStr.copy(); fullArgString = templateStr.copy();
copyArgString = &templateStr; copyArgString = &templateStr;
currentArgumentContext = FindMembers; currentArgumentContext = FindMembers;
//printf("Start template list\n");
BEGIN( ReadTempArgs ); BEGIN( ReadTempArgs );
} }
<FindMembers>"namespace"{BN}+/{ID}{BN}*"=" { // namespace alias <FindMembers>"namespace"{BN}+/{ID}{BN}*"=" { // namespace alias
...@@ -793,7 +797,7 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -793,7 +797,7 @@ TITLE [tT][iI][tT][lL][eE]
BEGIN( NSAliasArg ); BEGIN( NSAliasArg );
} }
<NSAliasArg>({ID}"::")*{ID} { <NSAliasArg>({ID}"::")*{ID} {
printf("Inserting namespace alias %s::%s->%s\n",current_root->name.data(),aliasName.data(),yytext); //printf("Inserting namespace alias %s::%s->%s\n",current_root->name.data(),aliasName.data(),yytext);
if (current_root->name.isEmpty()) if (current_root->name.isEmpty())
{ {
namespaceAliasDict.insert(aliasName,new QCString(yytext)); namespaceAliasDict.insert(aliasName,new QCString(yytext));
...@@ -1616,6 +1620,7 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -1616,6 +1620,7 @@ TITLE [tT][iI][tT][lL][eE]
lineCount(); lineCount();
addType(current); addType(current);
funcPtrType=yytext; funcPtrType=yytext;
roundCount=0;
//current->type += yytext; //current->type += yytext;
BEGIN( FuncPtr ); BEGIN( FuncPtr );
} }
...@@ -1638,12 +1643,12 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -1638,12 +1643,12 @@ TITLE [tT][iI][tT][lL][eE]
current->type+=funcPtrType.data()+1; current->type+=funcPtrType.data()+1;
BEGIN(FindMembers); BEGIN(FindMembers);
} }
<EndFuncPtr>")"{BN}*/"(" { // a variable function <EndFuncPtr>")"{BN}*/"(" { // a function pointer
lineCount(); lineCount();
current->type+=funcPtrType+")"; current->type+=funcPtrType+")";
BEGIN(FindMembers); BEGIN(FindMembers);
} }
<EndFuncPtr>")"{BN}*/"[" { <EndFuncPtr>")"{BN}*/"[" { // an array of variables
lineCount(); lineCount();
current->type+=funcPtrType.data(); current->type+=funcPtrType.data();
current->args += ")"; current->args += ")";
...@@ -1654,6 +1659,9 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -1654,6 +1659,9 @@ TITLE [tT][iI][tT][lL][eE]
roundCount=0; roundCount=0;
BEGIN( FuncFunc ); BEGIN( FuncFunc );
} }
<EndFuncPtr>"["[^\n\]]*"]" {
funcPtrType+=yytext;
}
<EndFuncPtr>")" { <EndFuncPtr>")" {
BEGIN(FindMembers); BEGIN(FindMembers);
} }
...@@ -1790,7 +1798,7 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -1790,7 +1798,7 @@ TITLE [tT][iI][tT][lL][eE]
<ReadTempArgs>"<" { <ReadTempArgs>"<" {
*copyArgString+=*yytext; *copyArgString+=*yytext;
fullArgString+=*yytext; fullArgString+=*yytext;
argSharpCount=0; argSharpCount=1;
BEGIN( CopyArgSharp ); BEGIN( CopyArgSharp );
} }
<ReadTempArgs>">" { <ReadTempArgs>">" {
...@@ -1815,16 +1823,23 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -1815,16 +1823,23 @@ TITLE [tT][iI][tT][lL][eE]
} }
<CopyArgSharp>"<" { <CopyArgSharp>"<" {
argSharpCount++; argSharpCount++;
//printf("argSharpCount++=%d copy\n",argSharpCount);
*copyArgString+=*yytext; *copyArgString+=*yytext;
fullArgString+=*yytext; fullArgString+=*yytext;
} }
<CopyArgSharp>">" { <CopyArgSharp>">" {
*copyArgString+=*yytext; *copyArgString+=*yytext;
fullArgString+=*yytext; fullArgString+=*yytext;
if (argRoundCount>0) argSharpCount--;
argRoundCount--; if (argSharpCount>0)
{
//printf("argSharpCount--=%d copy\n",argSharpCount);
}
else else
{
BEGIN( ReadTempArgs ); BEGIN( ReadTempArgs );
//printf("end of argSharpCount\n");
}
} }
<CopyArgString>\\. { <CopyArgString>\\. {
*copyArgString+=yytext; *copyArgString+=yytext;
...@@ -2631,6 +2646,8 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -2631,6 +2646,8 @@ TITLE [tT][iI][tT][lL][eE]
BEGIN(ClassDocBrief); BEGIN(ClassDocBrief);
} }
<TodoParam>\n | <TodoParam>\n |
<TodoParam>"//" |
<TodoParam>"/*" |
<TodoParam>. { <TodoParam>. {
if (current->todoId!=0) if (current->todoId!=0)
{ {
...@@ -2659,6 +2676,8 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -2659,6 +2676,8 @@ TITLE [tT][iI][tT][lL][eE]
BEGIN(todoStartContext); BEGIN(todoStartContext);
} }
<TestParam>\n | <TestParam>\n |
<TestParam>"//" |
<TestParam>"/*" |
<TestParam>. { <TestParam>. {
if (current->testId!=0) if (current->testId!=0)
{ {
...@@ -3008,7 +3027,7 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -3008,7 +3027,7 @@ TITLE [tT][iI][tT][lL][eE]
<ExampleDoc,PageDoc,ClassDoc>. { current->doc += yytext; } <ExampleDoc,PageDoc,ClassDoc>. { current->doc += yytext; }
<Doc,JavaDoc,LineDoc,ExampleDoc,PageDoc,ClassDoc>^{B}*"//" <Doc,JavaDoc,LineDoc,ExampleDoc,PageDoc,ClassDoc>^{B}*"//"
<Doc,ExampleDoc,PageDoc,ClassDoc>"//" { current->doc += yytext; } <Doc,ExampleDoc,PageDoc,ClassDoc>"//" { current->doc += yytext; }
<LineDoc,JavaDoc>"//" { current->brief += yytext; } <LineDoc,JavaDoc,ClassDocBrief>"//" { current->brief += yytext; }
<Doc,JavaDoc,LineDoc,ExampleDoc,ClassDocBrief,PageDoc,ClassDoc,AfterDoc,AfterDocLine,AfterDocBrief>("\\\\"|"@@")"f"[$\[\]] { <Doc,JavaDoc,LineDoc,ExampleDoc,ClassDocBrief,PageDoc,ClassDoc,AfterDoc,AfterDocLine,AfterDocBrief>("\\\\"|"@@")"f"[$\[\]] {
current->doc += &yytext[1]; current->doc += &yytext[1];
} }
......
...@@ -51,6 +51,13 @@ class TranslatorChinese : public Translator ...@@ -51,6 +51,13 @@ class TranslatorChinese : public Translator
{ return "成员函数文档"; } { return "成员函数文档"; }
QCString trMemberDataDocumentation() QCString trMemberDataDocumentation()
{ return "成员数据文档"; } { return "成员数据文档"; }
QCString trGeneratedFrom(const char *s,bool single)
{
QCString result=(QCString)"De documentatie voor deze"+s+
" is gegenereerd op grond van de volgende file";
if (single) result+=":"; else result+="s:";
return result;
}
QCString trMore() QCString trMore()
{ return "更多..."; } { return "更多..."; }
QCString trListOfAllMembers() QCString trListOfAllMembers()
...@@ -495,17 +502,17 @@ class TranslatorChinese : public Translator ...@@ -495,17 +502,17 @@ class TranslatorChinese : public Translator
/*! Text for the \pre command */ /*! Text for the \pre command */
QCString trPrecondition() QCString trPrecondition()
{ {
return "前条件"; return "前条件";
} }
/*! Text for the \post command */ /*! Text for the \post command */
QCString trPostcondition() QCString trPostcondition()
{ {
return "Postcondition"; return "后置条件";
} }
/*! Text for the \invariant command */ /*! Text for the \invariant command */
QCString trInvariant() QCString trInvariant()
{ {
return "Invariant"; return "不变性";
} }
/*! Text shown before a multi-line variable/enum initialization */ /*! Text shown before a multi-line variable/enum initialization */
QCString trInitialValue() QCString trInitialValue()
......
...@@ -11,14 +11,17 @@ ...@@ -11,14 +11,17 @@
"// 27 Jan 98 - Root folder starts open; support for USETEXTLINKS; \n" "// 27 Jan 98 - Root folder starts open; support for USETEXTLINKS; \n"
"// make the ftien4 a js file \n" "// make the ftien4 a js file \n"
"// \n" "// \n"
"// DvH: Dec 2000 - Made some minor changes to support external \n"
"// references\n"
" \n" " \n"
"// Definition of class Folder \n" "// Definition of class Folder \n"
"// ***************************************************************** \n" "// ***************************************************************** \n"
" \n" " \n"
"function Folder(folderDescription, hreference) //constructor \n" "function Folder(folderDescription, tagName, hreference) //constructor \n"
"{ \n" "{ \n"
" //constant data \n" " //constant data \n"
" this.desc = folderDescription \n" " this.desc = folderDescription \n"
" this.tagName = tagName\n"
" this.hreference = hreference \n" " this.hreference = hreference \n"
" this.id = -1 \n" " this.id = -1 \n"
" this.navObj = 0 \n" " this.navObj = 0 \n"
...@@ -186,6 +189,10 @@ ...@@ -186,6 +189,10 @@
" } \n" " } \n"
" else \n" " else \n"
" doc.write(this.desc) \n" " doc.write(this.desc) \n"
" if (this.tagName!=\"\")\n"
" {\n"
" doc.write(\" [external]\")\n"
" }\n"
" doc.write(\"</td>\") \n" " doc.write(\"</td>\") \n"
" doc.write(\"\\n</table>\\n\") \n" " doc.write(\"\\n</table>\\n\") \n"
" \n" " \n"
...@@ -209,7 +216,12 @@ ...@@ -209,7 +216,12 @@
"{ \n" "{ \n"
" if (this.hreference) \n" " if (this.hreference) \n"
" { \n" " { \n"
" doc.write(\"<a href='\" + this.hreference + \"' TARGET=\\\"basefrm\\\" \") \n" " doc.write(\"<a \")\n"
" if (this.tagName)\n"
" {\n"
" doc.write(\"doxygen='\" + this.tagName + \"' \");\n"
" }\n"
" doc.write(\"href='\" + this.hreference + \"' TARGET=\\\"basefrm\\\" \") \n"
" if (browserVersion > 0) \n" " if (browserVersion > 0) \n"
" doc.write(\"onClick='javascript:clickOnFolder(\"+this.id+\")'\") \n" " doc.write(\"onClick='javascript:clickOnFolder(\"+this.id+\")'\") \n"
" doc.write(\">\") \n" " doc.write(\">\") \n"
...@@ -242,10 +254,11 @@ ...@@ -242,10 +254,11 @@
"// Definition of class Item (a document or link inside a Folder) \n" "// Definition of class Item (a document or link inside a Folder) \n"
"// ************************************************************* \n" "// ************************************************************* \n"
" \n" " \n"
"function Item(itemDescription, itemLink) // Constructor \n" "function Item(itemDescription, tagName, itemLink) // Constructor \n"
"{ \n" "{ \n"
" // constant data \n" " // constant data \n"
" this.desc = itemDescription \n" " this.desc = itemDescription \n"
" this.tagName = tagName\n"
" this.link = itemLink \n" " this.link = itemLink \n"
" this.id = -1 //initialized in initalize() \n" " this.id = -1 //initialized in initalize() \n"
" this.navObj = 0 //initialized in render() \n" " this.navObj = 0 //initialized in render() \n"
...@@ -319,6 +332,10 @@ ...@@ -319,6 +332,10 @@
" doc.write(\"<a href=\" + this.link + \">\" + this.desc + \"</a>\") \n" " doc.write(\"<a href=\" + this.link + \">\" + this.desc + \"</a>\") \n"
" else \n" " else \n"
" doc.write(this.desc) \n" " doc.write(this.desc) \n"
" if (this.tagName!=\"\")\n"
" {\n"
" doc.write(\" [external]\");\n"
" }\n"
" doc.write(\"\\n</table>\\n\") \n" " doc.write(\"\\n</table>\\n\") \n"
" \n" " \n"
" if (browserVersion == 2) \n" " if (browserVersion == 2) \n"
...@@ -422,32 +439,22 @@ ...@@ -422,32 +439,22 @@
"// Auxiliary Functions for Folder-Treee backward compatibility \n" "// Auxiliary Functions for Folder-Treee backward compatibility \n"
"// ********************************************************* \n" "// ********************************************************* \n"
" \n" " \n"
"function gFld(description, hreference) \n" "function gFld(description, tagName, hreference) \n"
"{ \n" "{ \n"
" folder = new Folder(description, hreference) \n" " folder = new Folder(description, tagName, hreference) \n"
" return folder \n" " return folder \n"
"} \n" "} \n"
" \n" " \n"
"function gLnk(target, description, linkData) \n" "function gLnk(description, tagName, linkData) \n"
"{ \n" "{ \n"
" fullLink = \"\" \n" " fullLink = \"\" \n"
" \n" " \n"
" if (linkData!=\"\")\n" " if (linkData!=\"\")\n"
" {\n" " {\n"
" if (target==0) \n"
" { \n"
" fullLink = \"'\"+linkData+\"' target=\\\"basefrm\\\"\" \n" " fullLink = \"'\"+linkData+\"' target=\\\"basefrm\\\"\" \n"
" } \n" " } \n"
" else \n"
" { \n"
" if (target==1) \n"
" fullLink = \"'http://\"+linkData+\"' target=_blank\" \n"
" else \n"
" fullLink = \"'http://\"+linkData+\"' target=\\\"basefrm\\\"\" \n"
" }\n"
" } \n"
" \n" " \n"
" linkItem = new Item(description, fullLink) \n" " linkItem = new Item(description, tagName, fullLink) \n"
" return linkItem \n" " return linkItem \n"
"} \n" "} \n"
" \n" " \n"
......
...@@ -11,14 +11,17 @@ ...@@ -11,14 +11,17 @@
// 27 Jan 98 - Root folder starts open; support for USETEXTLINKS; // 27 Jan 98 - Root folder starts open; support for USETEXTLINKS;
// make the ftien4 a js file // make the ftien4 a js file
// //
// DvH: Dec 2000 - Made some minor changes to support external
// references
// Definition of class Folder // Definition of class Folder
// ***************************************************************** // *****************************************************************
function Folder(folderDescription, hreference) //constructor function Folder(folderDescription, tagName, hreference) //constructor
{ {
//constant data //constant data
this.desc = folderDescription this.desc = folderDescription
this.tagName = tagName
this.hreference = hreference this.hreference = hreference
this.id = -1 this.id = -1
this.navObj = 0 this.navObj = 0
...@@ -186,6 +189,10 @@ function drawFolder(leftSide) ...@@ -186,6 +189,10 @@ function drawFolder(leftSide)
} }
else else
doc.write(this.desc) doc.write(this.desc)
if (this.tagName!="")
{
doc.write(" [external]")
}
doc.write("</td>") doc.write("</td>")
doc.write("\n</table>\n") doc.write("\n</table>\n")
...@@ -209,7 +216,12 @@ function outputFolderLink() ...@@ -209,7 +216,12 @@ function outputFolderLink()
{ {
if (this.hreference) if (this.hreference)
{ {
doc.write("<a href='" + this.hreference + "' TARGET=\"basefrm\" ") doc.write("<a ")
if (this.tagName)
{
doc.write("doxygen='" + this.tagName + "' ");
}
doc.write("href='" + this.hreference + "' TARGET=\"basefrm\" ")
if (browserVersion > 0) if (browserVersion > 0)
doc.write("onClick='javascript:clickOnFolder("+this.id+")'") doc.write("onClick='javascript:clickOnFolder("+this.id+")'")
doc.write(">") doc.write(">")
...@@ -242,10 +254,11 @@ function folderSubEntries() ...@@ -242,10 +254,11 @@ function folderSubEntries()
// Definition of class Item (a document or link inside a Folder) // Definition of class Item (a document or link inside a Folder)
// ************************************************************* // *************************************************************
function Item(itemDescription, itemLink) // Constructor function Item(itemDescription, tagName, itemLink) // Constructor
{ {
// constant data // constant data
this.desc = itemDescription this.desc = itemDescription
this.tagName = tagName
this.link = itemLink this.link = itemLink
this.id = -1 //initialized in initalize() this.id = -1 //initialized in initalize()
this.navObj = 0 //initialized in render() this.navObj = 0 //initialized in render()
...@@ -319,6 +332,10 @@ function drawItem(leftSide) ...@@ -319,6 +332,10 @@ function drawItem(leftSide)
doc.write("<a href=" + this.link + ">" + this.desc + "</a>") doc.write("<a href=" + this.link + ">" + this.desc + "</a>")
else else
doc.write(this.desc) doc.write(this.desc)
if (this.tagName!="")
{
doc.write(" [external]");
}
doc.write("\n</table>\n") doc.write("\n</table>\n")
if (browserVersion == 2) if (browserVersion == 2)
...@@ -422,32 +439,22 @@ function initializeDocument() ...@@ -422,32 +439,22 @@ function initializeDocument()
// Auxiliary Functions for Folder-Treee backward compatibility // Auxiliary Functions for Folder-Treee backward compatibility
// ********************************************************* // *********************************************************
function gFld(description, hreference) function gFld(description, tagName, hreference)
{ {
folder = new Folder(description, hreference) folder = new Folder(description, tagName, hreference)
return folder return folder
} }
function gLnk(target, description, linkData) function gLnk(description, tagName, linkData)
{ {
fullLink = "" fullLink = ""
if (linkData!="") if (linkData!="")
{
if (target==0)
{ {
fullLink = "'"+linkData+"' target=\"basefrm\"" fullLink = "'"+linkData+"' target=\"basefrm\""
} }
else
{
if (target==1)
fullLink = "'http://"+linkData+"' target=_blank"
else
fullLink = "'http://"+linkData+"' target=\"basefrm\""
}
}
linkItem = new Item(description, fullLink) linkItem = new Item(description, tagName, fullLink)
return linkItem return linkItem
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment