acinclude.m4: Minor comment tweaks.

2002-08-31  Phil Edwards  <pme@gcc.gnu.org>

	* acinclude.m4:  Minor comment tweaks.

	* docs/html/makedoc.awk:  New file...
	* docs/html/Makefile:  ...called from here...
	* docs/html/documentation.html:  ...to help generate this.

	* docs/html/21_strings/howto.html:  Prepare for new entry.
	* include/bits/basic_string.h:  Initial basic_stirng hook for
	doxygen.  Remove trailing whitespace.
	* include/bits/char_traits.h:  Point to onlinedocs for new entry.
	* include/bits/stringfwd.h:  Add doxygen hooks for string and
	wstring typedefs.

From-SVN: r56711
This commit is contained in:
Phil Edwards 2002-09-01 00:33:53 +00:00
parent 98c0d8d105
commit 51122a4242
9 changed files with 485 additions and 342 deletions

View file

@ -1,3 +1,18 @@
2002-08-31 Phil Edwards <pme@gcc.gnu.org>
* acinclude.m4: Minor comment tweaks.
* docs/html/makedoc.awk: New file...
* docs/html/Makefile: ...called from here...
* docs/html/documentation.html: ...to help generate this.
* docs/html/21_strings/howto.html: Prepare for new entry.
* include/bits/basic_string.h: Initial basic_stirng hook for
doxygen. Remove trailing whitespace.
* include/bits/char_traits.h: Point to onlinedocs for new entry.
* include/bits/stringfwd.h: Add doxygen hooks for string and
wstring typedefs.
2002-08-29 Richard Earnshaw <rearnshaw@arm.com>
* config/cpu/arm/cpu_limits.h: New file.

View file

@ -1,5 +1,5 @@
dnl
dnl Initialize configure bits.
dnl Initialize basic configure bits, set toplevel_srcdir for Makefiles.
dnl
dnl GLIBCPP_TOPREL_CONFIGURE
AC_DEFUN(GLIBCPP_TOPREL_CONFIGURE, [
@ -37,13 +37,10 @@ AC_DEFUN(GLIBCPP_TOPREL_CONFIGURE, [
])
dnl
dnl Initialize configure bits.
dnl Initialize the rest of the library configury.
dnl
dnl GLIBCPP_CONFIGURE
AC_DEFUN(GLIBCPP_CONFIGURE, [
#possibly test for the presence of the compiler sources here?
# Export build and source directories.
# These need to be absolute paths, yet at the same time need to
# canonicalize only relative paths, because then amd will not unmount

View file

@ -25,6 +25,7 @@
<li><a href="#2">A case-insensitive string class</a>
<li><a href="#3">Breaking a C++ string into tokens</a>
<li><a href="#4">Simple transformations</a>
<li><a href="#5">Making strings of arbitrary character types</a>
</ul>
<hr>
@ -321,6 +322,15 @@
<a href="../faq/index.html">to the FAQ</a>.
</p>
<hr>
<h2><a name="5">Making strings of arbitrary character types</a></h2>
<p>how to work with char_traits -- in the archives, just need to
go through and pull the examples together
</p>
<p>Return <a href="#top">to top of page</a> or
<a href="../faq/index.html">to the FAQ</a>.
</p>
<!-- ####################################################### -->

View file

@ -1,10 +1,28 @@
PWD=$${PWDCMD-pwd}
PWD=$${PWDCMD-pwd}
MAKEINFO=makeinfo
INC=../../../gcc/doc/include
all: faq/index.txt 17_intro/porting.html 17_intro/porting-howto.html
all: documentation.html \
faq/index.txt \
17_intro/porting.html \
17_intro/porting-howto.html
# chock full of GNUism, probably
documentation.html: $(wildcard */howto.html)
sed -n '1,/beginlist/p' $@ > tmp.top
sed -n '/endlist/,$$p' $@ > tmp.bottom
echo ' <ul>' > tmp.middle
for i in [[:digit:]]*/howto.html; do \
title=`grep 'h1 ' $$i |\
sed 's=.*\(Chapter [[:digit:]]*\):[[:space:]]*\(.*\)</a>.*=\2 (\1)='` ;\
awk -v file=$$i -v "title=$$title" -f makedoc.awk $$i >> tmp.middle ;\
done
awk -v file=ext/howto.html -v "title=Extensions to the Standard Library"\
-f makedoc.awk ext/howto.html >> tmp.middle ;\
echo ' </ul>' >> tmp.middle
cat tmp.top tmp.middle tmp.bottom > $@
rm tmp.top tmp.middle tmp.bottom
faq/index.txt: faq/index.html
lynx -dump $< | sed "s%file://localhost`${PWD}`%..%" > $@
@ -16,3 +34,4 @@ faq/index.txt: faq/index.html
17_intro/porting-howto.html: 17_intro/porting-howto.xml
xltproc -o $@ /usr/share/xml/docbook/xsl-stylesheets-1.48-2/html/docbook.xsl $<
# vim:noet ts=4

View file

@ -84,121 +84,127 @@
<br>
<h2><a name="3">Chapter-Specific Documentation</a></h2>
<p>Information, extensions, notes and advice on specific implementation
capabilites and or liabilities broken down into chapter names based on the
capabilites and/or liabilities broken down into chapter names based on the
C++ standard.
</p>
<!--
The list below is automatically generated. To make changes in the text,
edit the appropriate HOWTO file and run "make" in this directory. In
those files, you may reorder entries as you like, but DO NOT change the
"#number"s in anchors, for they are used elsewhere and in bookmarks.
-->
<!-- beginlist -->
<ul>
<li>Intro (Chapter 17)
<li>Library Introduction (Chapter 17)</li>
<ul>
<li><a href="17_intro/howto.html#1">Header files</a>
<li><a href="17_intro/howto.html#3">Using &lt;foo&gt; vs &lt;foo.h&gt;</a>
<li><a href="17_intro/howto.html#2">Multithreading</a>
<li><a href="17_intro/howto.html#4">Porting</a>
<li><a href="17_intro/howto.html#5">Implementation-specific behavior</a>
<li><a href="17_intro/howto.html#6">Using preprocessor macros to change behavior of the library</a>
<li><a href="17_intro/howto.html#2">The Standard C++ header files</a></li>
<li><a href="17_intro/howto.html#3">The Standard C++ library and multithreading</a></li>
<li><a href="17_intro/howto.html#4"><code>&lt;foo&gt;</code> vs <code>&lt;foo.h&gt;</code></a></li>
<li><a href="17_intro/porting-howto.html">Porting HOWTO</a></li>
<li><a href="17_intro/howto.html#5">Behavior specific to libstdc++-v3</a></li>
<li><a href="17_intro/howto.html#6">Preprocessor macros controlling the library</a></li>
</ul>
<li>Library Support (Chapter 18)
<li>Library Support (Chapter 18)</li>
<ul>
<li><a href="18_support/howto.html#1">Types</a>
<li><a href="18_support/howto.html#2">Implementation properties</a>
<li><a href="18_support/howto.html#3">Start and Termination</a>
<li><a href="18_support/howto.html#4">Dynamic memory management</a>
<li><a href="18_support/howto.html#5">RTTI, the ABI, and demangling</a>
<li><a href="18_support/howto.html#1">Types</a></li>
<li><a href="18_support/howto.html#2">Implementation properties</a></li>
<li><a href="18_support/howto.html#3">Start and Termination</a></li>
<li><a href="18_support/howto.html#4">Dynamic memory management</a></li>
<li><a href="18_support/howto.html#5">RTTI, the ABI, and demangling</a></li>
</ul>
<li>Diagnostics (Chapter 19)
<li>Diagnostics (Chapter 19)</li>
<ul>
<li><a href="19_diagnostics/howto.html#1">Adding data to exceptions</a>
<li><a href="19_diagnostics/howto.html#2">Exception class hierarchy diagram</a>
<li><a href="19_diagnostics/howto.html#3">Concept checkers -- new and improved!</a>
<li><a href="19_diagnostics/howto.html#4">Verbose terminate</a>
<li><a href="19_diagnostics/howto.html#1">Adding data to exceptions</a></li>
<li><a href="19_diagnostics/howto.html#2">Exception class hierarchy diagram</a></li>
<li><a href="19_diagnostics/howto.html#3">Concept checkers -- <strong>new and improved!</strong></a></li>
<li><a href="19_diagnostics/howto.html#4">Verbose <code>terminate</code></a></li>
</ul>
<li>Utilities (Chapter 20)
<li>General Utilities (Chapter 20)</li>
<ul>
<li><a href="20_util/howto.html#1">auto_ptr is not omnipotent</a>
<li><a href="20_util/howto.html#1">auto_ptr inside container classes</a>
<li><a href="20_util/howto.html#1">Functors</a>
<li><a href="20_util/howto.html#1">Pairs</a>
<li><a href="20_util/howto.html#1"><code>auto_ptr</code> is not omnipotent</a></li>
<li><a href="20_util/howto.html#2"><code>auto_ptr</code> inside container classes</a></li>
<li><a href="20_util/howto.html#3">Functors</a></li>
<li><a href="20_util/howto.html#4">Pairs</a></li>
</ul>
<li>Strings (Chapter 21)
<li>Strings (Chapter 21)</li>
<ul>
<li><a href="21_strings/howto.html#1">MFC's CString</a>
<li><a href="21_strings/howto.html#2">A case-insensitive string class</a>
<li><a href="21_strings/howto.html#3">Breaking a C++ string into tokens</a>
<li><a href="21_strings/howto.html#4">Simple transformations</a>
<li><a href="21_strings/howto.html#1">MFC's CString</a></li>
<li><a href="21_strings/howto.html#2">A case-insensitive string class</a></li>
<li><a href="21_strings/howto.html#3">Breaking a C++ string into tokens</a></li>
<li><a href="21_strings/howto.html#4">Simple transformations</a></li>
<li><a href="21_strings/howto.html#5">Making strings of arbitrary character types</a></li>
</ul>
<li>Localization (Chapter 22)
<li>Localization (Chapter 22)</li>
<ul>
<li><a href="22_locale/howto.html#1">Class locale</a>
<li><a href="22_locale/howto.html#2">Class codecvt</a>
<li><a href="22_locale/howto.html#3">Class ctype</a>
<li><a href="22_locale/howto.html#4">Class messages</a>
<li><a href="22_locale/howto.html#5">Bjarne Stroustrup on Locales</a>
<li><a href="22_locale/howto.html#6">Nathan Myers on Locales</a>
<li><a href="22_locale/howto.html#7">Correct Transformations </a>
<li><a href="22_locale/howto.html#1">class locale</a></li>
<li><a href="22_locale/howto.html#2">class codecvt</a></li>
<li><a href="22_locale/howto.html#3">class ctype</a></li>
<li><a href="22_locale/howto.html#4">class messages</a></li>
<li><a href="22_locale/howto.html#5">Bjarne Stroustrup on Locales</a></li>
<li><a href="22_locale/howto.html#6">Nathan Myers on Locales </a></li>
<li><a href="22_locale/howto.html#7">Correct Transformations</a></li>
</ul>
<li>Containers (Chapter 23)
<li>Containers (Chapter 23)</li>
<ul>
<li><a href="23_containers/howto.html#1">Making code unaware of the container/array difference</a>
<li><a href="23_containers/howto.html#2">Variable-sized bitmasks</a>
<li><a href="23_containers/howto.html#3">Containers and multithreading</a>
<li><a href="23_containers/howto.html#4">&quot;Hinting&quot; during insertion</a>
<li><a href="23_containers/howto.html#5">Bitmasks and string arguments</a>
<li><a href="23_containers/howto.html#6"><code>std::list::size()</code> is O(n)!</a>
<li><a href="23_containers/howto.html#7">Space overhead management for vectors </a>
<li><a href="23_containers/howto.html#1">Making code unaware of the container/array difference</a></li>
<li><a href="23_containers/howto.html#2">Variable-sized bitmasks</a></li>
<li><a href="23_containers/howto.html#3">Containers and multithreading</a></li>
<li><a href="23_containers/howto.html#4">&quot;Hinting&quot; during insertion</a></li>
<li><a href="23_containers/howto.html#5">Bitmasks and string arguments</a></li>
<li><a href="23_containers/howto.html#6"><code>std::list::size()</code> is O(n)!</a></li>
<li><a href="23_containers/howto.html#7">Space overhead management for vectors</a></li>
</ul>
<li>Iterators (Chapter24)
<li>Iterators (Chapter 24)</li>
<ul>
<li><a href="24_iterators/howto.html#1">They aren't pointers!</a>
<li><a href="24_iterators/howto.html#1">It ends where?</a>
<li><a href="24_iterators/howto.html#1">They ain't pointers!</a></li>
<li><a href="24_iterators/howto.html#2">It ends <em>where?</em></a></li>
</ul>
<li>Algorithms (Chapter 25)
<li>Algorithms (Chapter 25)</li>
<ul>
<li><a href="25_algorithms/howto.html#1">Prerequisites</a>
<li><a href="25_algorithms/howto.html#2">Special swaps</a>
<li><a href="25_algorithms/howto.html#1">Prerequisites</a></li>
<li><a href="25_algorithms/howto.html#2">Special <code>swap</code>s</a></li>
</ul>
<li>Numerics (Chapter 26)
<li>Numerics (Chapter 26)</li>
<ul>
<li><a href="26_numerics/howto.html#1">Complex Number Processing</a>
<li><a href="26_numerics/howto.html#2">Array Processing</a>
<li><a href="26_numerics/howto.html#3">Numerical Functions</a>
<li><a href="26_numerics/howto.html#4">C99</a>
<li><a href="26_numerics/howto.html#1">Complex Number Processing</a></li>
<li><a href="26_numerics/howto.html#2">Array Processing</a></li>
<li><a href="26_numerics/howto.html#3">Numerical Functions</a></li>
<li><a href="26_numerics/howto.html#4">C99</a></li>
</ul>
<li>I/O (Chapter 27)
<li>Input/Output (Chapter 27)</li>
<ul>
<li><a href="27_io/howto.html#1">Copying a file</a>
<li><a href="27_io/howto.html#2">The buffering is screwing up my program!</a>
</ul>
<ul>
<li><a href="27_io/howto.html#3">Binary I/O</a>
<li><a href="27_io/howto.html#6">More on binary I/O</a>
<li><a href="27_io/howto.html#5">Deriving a stream buffer</a>
<li><a href="27_io/howto.html#4">What is this &lt;sstream&gt;/stringstreams thing?</a>
<li><a href="27_io/howto.html#7">Pathetic performance? Ditch C.</a>
<li><a href="27_io/howto.html#8">Threads and I/O</a>
<li><a href="27_io/howto.html#1">Copying a file</a></li>
<li><a href="27_io/howto.html#2">The buffering is screwing up my program!</a></li>
<li><a href="27_io/howto.html#3">Binary I/O</a></li>
<li><a href="27_io/howto.html#5">What is this &lt;sstream&gt;/stringstreams thing?</a></li>
<li><a href="27_io/howto.html#6">Deriving a stream buffer</a></li>
<li><a href="27_io/howto.html#7">More on binary I/O</a></li>
<li><a href="27_io/howto.html#8">Pathetic performance? Ditch C.</a></li>
<li><a href="27_io/howto.html#9">Threads and I/O</a></li>
</ul>
<li>Extensions to the Standard Library
<li>Extensions to the Standard Library</li>
<ul>
<li><a href="ext/howto.html#1">Ropes and trees and hashes, oh my!</a>
<li><a href="ext/howto.html#2">Added members and types</a>
<li><a href="ext/howto.html#3">Allocators (versions 3.0, 3.1, 3.2)</a>
<li><a href="ext/howto.html#4">Allocators (version 3.3)</a>
<li><a href="ext/howto.html#5">Compile-time checks</a>
<li><a href="ext/howto.html#6">LWG Issues</a>
<li><a href="ext/howto.html#1">Ropes and trees and hashes, oh my!</a></li>
<li><a href="ext/howto.html#2">Added members and types</a></li>
<li><a href="ext/howto.html#3">Allocators (versions 3.0, 3.1, 3.2)</a></li>
<li><a href="ext/howto.html#6">Allocators (version 3.3)</a></li>
<li><a href="ext/howto.html#4">Compile-time checks</a></li>
<li><a href="ext/howto.html#5">LWG Issues</a></li>
</ul>
</ul>
<!-- endlist -->
<hr />
<br>

View file

@ -0,0 +1,69 @@
# Take apart bits of HTML and puts them back together again in new and
# fascinating ways. Copyright (C) 2002 Free Software Foundation, Inc.
# Contributed by Phil Edwards <pme@gcc.gnu.org>. Simple two-state automaton
# inspired by Richard Henderson's gcc/mkmap-symver.awk.
# 'file' is the name of the file on stdin
# 'title' is the text to print at the start of the list
BEGIN {
state = "looking";
entries = 0;
printf (" <li>%s</li>\n", title);
printf (" <ul>\n");
}
# Searching for the little table of contents at the top.
state == "looking" && /^<h1>Contents/ {
state = "entries";
next;
}
# Ignore everything else up to that point.
state == "looking" {
next;
}
# An entry in the table of contents. Pull that line apart.
state == "entries" && /<li>/ {
extract_info($0);
next;
}
# End of the list. Don't bother reading the rest of the file. (It could
# also contain more <li>'s, so that would be incorrect as well as wasteful.)
state == "entries" && /^<\/ul>/ {
exit;
}
END {
for (i = 0; i < entries; i++)
printf (" %s\n", entry[i]);
printf (" </ul>\n\n");
}
function extract_info(line) {
# thistarget will be things like "#5" or "elsewhere.html"
match(line,"href=\".*\"");
thistarget = substr(line,RSTART+6,RLENGTH-7);
# take apart the filename
split(file,X,"/");
if (thistarget ~ /^#/) {
# local name, use directory and filename
target = file thistarget
} else {
# different file, only use directory
target = X[1] "/" thistarget
}
# visible text
gsub("</a>","",line);
start = index(line,"\">") + 2;
thistext = substr(line,start);
# Assemble and store the HTML for later output.
entry[entries++] = "<li><a href=\"" target "\">" thistext "</a></li>"
}
# vim:sw=2

View file

@ -46,44 +46,64 @@
namespace std
{
// Documentation? What's that?
// Nathan Myers <ncm@cantrip.org>.
//
// A string looks like this:
//
// [_Rep]
// _M_length
// [basic_string<char_type>] _M_capacity
// _M_dataplus _M_state
// _M_p ----------------> unnamed array of char_type
// Where the _M_p points to the first character in the string, and
// you cast it to a pointer-to-_Rep and subtract 1 to get a
// pointer to the header.
// This approach has the enormous advantage that a string object
// requires only one allocation. All the ugliness is confined
// within a single pair of inline functions, which each compile to
// a single "add" instruction: _Rep::_M_data(), and
// string::_M_rep(); and the allocation function which gets a
// block of raw bytes and with room enough and constructs a _Rep
// object at the front.
// The reason you want _M_data pointing to the character array and
// not the _Rep is so that the debugger can see the string
// contents. (Probably we should add a non-inline member to get
// the _Rep for the debugger to use, so users can check the actual
// string length.)
// Note that the _Rep object is a POD so that you can have a
// static "empty string" _Rep object already "constructed" before
// static constructors have run. The reference-count encoding is
// chosen so that a 0 indicates one reference, so you never try to
// destroy the empty-string _Rep object.
// All but the last paragraph is considered pretty conventional
// for a C++ string implementation.
/**
* @class basic_string basic_string.h <string>
* @brief Managing sequences of characters and character-like objects.
*
* @ingroup Containers
* @ingroup Sequences
*
* Meets the requirements of a <a href="tables.html#65">container</a>, a
* <a href="tables.html#66">reversible container</a>, and a
* <a href="tables.html#67">sequence</a>. Of the
* <a href="tables.html#68">optional sequence requirements</a>, only
* @c push_back, @c at, and array access are supported.
*
* @doctodo
*
*
* @if maint
* Documentation? What's that?
* Nathan Myers <ncm@cantrip.org>.
*
* A string looks like this:
*
* @code
* [_Rep]
* _M_length
* [basic_string<char_type>] _M_capacity
* _M_dataplus _M_state
* _M_p ----------------> unnamed array of char_type
* @endcode
*
* Where the _M_p points to the first character in the string, and
* you cast it to a pointer-to-_Rep and subtract 1 to get a
* pointer to the header.
*
* This approach has the enormous advantage that a string object
* requires only one allocation. All the ugliness is confined
* within a single pair of inline functions, which each compile to
* a single "add" instruction: _Rep::_M_data(), and
* string::_M_rep(); and the allocation function which gets a
* block of raw bytes and with room enough and constructs a _Rep
* object at the front.
*
* The reason you want _M_data pointing to the character array and
* not the _Rep is so that the debugger can see the string
* contents. (Probably we should add a non-inline member to get
* the _Rep for the debugger to use, so users can check the actual
* string length.)
*
* Note that the _Rep object is a POD so that you can have a
* static "empty string" _Rep object already "constructed" before
* static constructors have run. The reference-count encoding is
* chosen so that a 0 indicates one reference, so you never try to
* destroy the empty-string _Rep object.
*
* All but the last paragraph is considered pretty conventional
* for a C++ string implementation.
* @endif
*/
// 21.3 Template class basic_string
template<typename _CharT, typename _Traits, typename _Alloc>
class basic_string

View file

@ -47,12 +47,16 @@
namespace std
{
// 21.1.2
// 21.1
/**
* @brief Basis for explicit traits specializations.
*
* @note For any given actual character type, this definition is
* probably wrong.
*
* See http://gcc.gnu.org/onlinedocs/libstdc++/21_strings/howto.html#5
* for advice on how to make use of this class for "unusual" character
* types.
*/
template<class _CharT>
struct char_traits
@ -108,7 +112,7 @@ namespace std
};
/// 21.1.4 char_traits specializations
/// 21.1.3.1 char_traits specializations
template<>
struct char_traits<char>
{
@ -178,6 +182,7 @@ namespace std
#ifdef _GLIBCPP_USE_WCHAR_T
/// 21.1.3.2 char_traits specializations
template<>
struct char_traits<wchar_t>
{

View file

@ -60,7 +60,9 @@ namespace std
typename _Alloc = allocator<_CharT> >
class basic_string;
/// 99%% of %string users only ever [need to] see the typedef.
typedef basic_string<char> string;
/// 99%% of %wstring users only ever [need to] see the typedef.
typedef basic_string<wchar_t> wstring;
} // namespace std