Commit 51122a42 by Phil Edwards

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
parent 98c0d8d1
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.
......
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
......
......@@ -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>
<!-- ####################################################### -->
......
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
# 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
......@@ -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
......
......@@ -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>
{
......
......@@ -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
......
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