This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
doxygen + char_traits, patch
- To: libstdc++ at gcc dot gnu dot org
- Subject: doxygen + char_traits, patch
- From: Benjamin Kosnik <bkoz at redhat dot com>
- Date: Fri, 27 Apr 2001 00:23:32 -0700
Phil here's an example of char_traits. It's not especially good yet,
but it is better. I've included the generated documentation for
char_traits in the next email, and the patch against current CVS at
the end of the file. Non-html-emaily people just ditch the next mail,
or look at it on the web archives.
-benjamin
2001-04-26 benjamin kosnik <bkoz@fillmore.constant.com>
* include/bits/char_traits.h: Sample doxygen formatting.
* docs/doxygen/user.cfg.in: Change default configuration. Single
frame, other tweaks.
Index: docs/doxygen/user.cfg.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/docs/doxygen/user.cfg.in,v
retrieving revision 1.3
diff -c -p -r1.3 user.cfg.in
*** user.cfg.in 2001/04/19 23:01:40 1.3
--- user.cfg.in 2001/04/27 07:20:10
***************
*** 16,28 ****
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
! PROJECT_NAME = "libstdc++"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.
! PROJECT_NUMBER = 3
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
--- 16,28 ----
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
! PROJECT_NAME = "libstdc++-v3"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.
! PROJECT_NUMBER =
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
*************** EXTRACT_ALL = YES
*** 52,58 ****
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
! EXTRACT_PRIVATE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
--- 52,58 ----
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
! EXTRACT_PRIVATE = YES
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
*************** STRIP_CODE_COMMENTS = YES
*** 142,154 ****
# in case and if your file system supports case sensitive file names. Windows
# users are adviced to set this option to NO.
! CASE_SENSE_NAMES = YES
# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
# will show members with their full class and namespace scopes in the
# documentation. If set to YES the scope will be hidden.
! HIDE_SCOPE_NAMES = YES
# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
# will generate a verbatim copy of the header file for each class for
--- 142,154 ----
# in case and if your file system supports case sensitive file names. Windows
# users are adviced to set this option to NO.
! CASE_SENSE_NAMES = NO
# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
# will show members with their full class and namespace scopes in the
# documentation. If set to YES the scope will be hidden.
! HIDE_SCOPE_NAMES = NO
# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
# will generate a verbatim copy of the header file for each class for
*************** VERBATIM_HEADERS = NO
*** 160,166 ****
# will put list of the files that are included by a file in the documentation
# of that file.
! SHOW_INCLUDE_FILES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
# will interpret the first line (until the first dot) of a JavaDoc-style
--- 160,166 ----
# will put list of the files that are included by a file in the documentation
# of that file.
! SHOW_INCLUDE_FILES = YES
# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
# will interpret the first line (until the first dot) of a JavaDoc-style
*************** INLINE_INFO = YES
*** 186,192 ****
# alphabetically by member name. If set to NO the members will appear in
# declaration order.
! SORT_MEMBER_DOCS = NO
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
--- 186,192 ----
# alphabetically by member name. If set to NO the members will appear in
# declaration order.
! SORT_MEMBER_DOCS = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
*************** WARN_FORMAT = "$file:$line: $
*** 270,283 ****
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
! INPUT = include src
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank all files are included.
! FILE_PATTERNS = *.cc *.h c++config
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
--- 270,283 ----
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
! INPUT = include/std include/bits include/c_std src
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank all files are included.
! FILE_PATTERNS = *.cc *.tcc *.h c++config
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
*************** DISABLE_INDEX = NO
*** 417,423 ****
# JavaScript and frames is required (for instance Netscape 4.0+
# or Internet explorer 4.0+).
! GENERATE_TREEVIEW = YES
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
--- 417,423 ----
# JavaScript and frames is required (for instance Netscape 4.0+
# or Internet explorer 4.0+).
! GENERATE_TREEVIEW = NO
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
*************** EXT_DOC_PATHS =
*** 737,740 ****
--- 737,742 ----
# End of file
+
+
Index: include/bits/char_traits.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/char_traits.h,v
retrieving revision 1.6
diff -c -p -r1.6 char_traits.h
*** char_traits.h 2001/03/07 22:22:41 1.6
--- char_traits.h 2001/04/27 07:20:11
***************
*** 41,71 ****
namespace std
{
! // 21.1.2 Basis for explicit _Traits specialization
! // NB: That for any given actual character type this definition is
! // probably wrong.
template<class _CharT>
struct char_traits
{
typedef _CharT char_type;
! // Unsigned as wint_t in unsigned.
! typedef unsigned long int_type;
typedef streampos pos_type;
typedef streamoff off_type;
typedef mbstate_t state_type;
static void
assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; }
static bool
eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; }
static bool
lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; }
static int
compare(const char_type* __s1, const char_type* __s2, size_t __n)
{
--- 41,74 ----
namespace std
{
! /// 21.1.2 Basis for explicit _Traits specialization
! /// NB: For any given actual character type this definition is
! /// probably wrong.
template<class _CharT>
struct char_traits
{
typedef _CharT char_type;
! typedef unsigned long int_type; // Unsigned as wint_t is unsigned.
typedef streampos pos_type;
typedef streamoff off_type;
typedef mbstate_t state_type;
+ ///
static void
assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; }
+ ///
static bool
eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; }
+ ///
static bool
lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; }
+ ///
static int
compare(const char_type* __s1, const char_type* __s2, size_t __n)
{
*************** namespace std
*** 75,80 ****
--- 78,84 ----
return 0;
}
+ ///
static size_t
length(const char_type* __s)
{
*************** namespace std
*** 83,88 ****
--- 87,93 ----
return (__p - __s);
}
+ ///
static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a)
{
*************** namespace std
*** 91,104 ****
--- 96,112 ----
return 0;
}
+ ///
static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n)
{ return (char_type*) memmove(__s1, __s2, __n * sizeof(char_type)); }
+ ///
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
{ return (char_type*) memcpy(__s1, __s2, __n * sizeof(char_type)); }
+ ///
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
{
*************** namespace std
*** 107,133 ****
return __s;
}
static char_type
to_char_type(const int_type& __c)
{ return char_type(__c); }
static int_type
to_int_type(const char_type& __c) { return int_type(__c); }
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
static int_type
eof() { return static_cast<int_type>(-1); }
static int_type
not_eof(const int_type& __c)
{ return eq_int_type(__c, eof()) ? int_type(0) : __c; }
};
! // 21.1.4 char_traits specializations
template<>
struct char_traits<char>
{
--- 115,147 ----
return __s;
}
+ ///
static char_type
to_char_type(const int_type& __c)
{ return char_type(__c); }
+ ///
static int_type
to_int_type(const char_type& __c) { return int_type(__c); }
+ ///
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
+ ///
static int_type
eof() { return static_cast<int_type>(-1); }
+ ///
static int_type
not_eof(const int_type& __c)
{ return eq_int_type(__c, eof()) ? int_type(0) : __c; }
};
! /// 21.1.4 char_traits specializations
! /// <char> specialization
template<>
struct char_traits<char>
{
*************** namespace std
*** 137,195 ****
typedef streamoff off_type;
typedef mbstate_t state_type;
static void
assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; }
static bool
eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; }
static bool
lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; }
static int
compare(const char_type* __s1, const char_type* __s2, size_t __n)
{ return memcmp(__s1, __s2, __n); }
static size_t
length(const char_type* __s)
{ return strlen(__s); }
static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a)
{ return static_cast<const char_type*>(memchr(__s, __a, __n)); }
static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n)
{ return static_cast<char_type*>(memmove(__s1, __s2, __n)); }
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
{ return static_cast<char_type*>(memcpy(__s1, __s2, __n)); }
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
{ return static_cast<char_type*>(memset(__s, __a, __n)); }
static char_type
to_char_type(const int_type& __c)
{ return static_cast<char_type>(__c); }
! // To keep both the byte 0xff and the eof symbol 0xffffffff
! // from ending up as 0xffffffff.
static int_type
to_int_type(const char_type& __c)
{ return static_cast<int_type>(static_cast<unsigned char>(__c)); }
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
static int_type
eof() { return static_cast<int_type>(EOF); }
static int_type
not_eof(const int_type& __c)
{ return (__c == eof()) ? 0 : __c; }
--- 151,222 ----
typedef streamoff off_type;
typedef mbstate_t state_type;
+ ///
static void
assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; }
+ ///
static bool
eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; }
+ ///
static bool
lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; }
+ ///
static int
compare(const char_type* __s1, const char_type* __s2, size_t __n)
{ return memcmp(__s1, __s2, __n); }
+ ///
static size_t
length(const char_type* __s)
{ return strlen(__s); }
+ ///
static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a)
{ return static_cast<const char_type*>(memchr(__s, __a, __n)); }
+ ///
static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n)
{ return static_cast<char_type*>(memmove(__s1, __s2, __n)); }
+ ///
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
{ return static_cast<char_type*>(memcpy(__s1, __s2, __n)); }
+ ///
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
{ return static_cast<char_type*>(memset(__s, __a, __n)); }
+ ///
static char_type
to_char_type(const int_type& __c)
{ return static_cast<char_type>(__c); }
! /// To keep both the byte 0xff and the eof symbol 0xffffffff
! /// from ending up as 0xffffffff.
static int_type
to_int_type(const char_type& __c)
{ return static_cast<int_type>(static_cast<unsigned char>(__c)); }
+ ///
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
+ ///
static int_type
eof() { return static_cast<int_type>(EOF); }
+ ///
static int_type
not_eof(const int_type& __c)
{ return (__c == eof()) ? 0 : __c; }
*************** namespace std
*** 197,202 ****
--- 224,231 ----
#ifdef _GLIBCPP_USE_WCHAR_T
+ /// 21.1.4 char_traits specializations
+ /// <wchar_t> specialization
template<>
struct char_traits<wchar_t>
{
*************** namespace std
*** 206,266 ****
--- 235,310 ----
typedef wstreampos pos_type;
typedef mbstate_t state_type;
+ ///
static void
assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; }
+ ///
static bool
eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; }
+ ///
static bool
lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; }
+ ///
static int
compare(const char_type* __s1, const char_type* __s2, size_t __n)
{ return wmemcmp(__s1, __s2, __n); }
+ ///
static size_t
length(const char_type* __s)
{ return wcslen(__s); }
+ ///
static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a)
{ return wmemchr(__s, __a, __n); }
+ ///
static char_type*
move(char_type* __s1, const char_type* __s2, int_type __n)
{ return wmemmove(__s1, __s2, __n); }
+ ///
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
{ return wmemcpy(__s1, __s2, __n); }
+ ///
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
{ return wmemset(__s, __a, __n); }
+ ///
static char_type
to_char_type(const int_type& __c) { return char_type(__c); }
+ ///
static int_type
to_int_type(const char_type& __c) { return int_type(__c); }
+ ///
static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
+ ///
static int_type
eof() { return static_cast<int_type>(WEOF); }
+ ///
static int_type
not_eof(const int_type& __c)
{ return eq_int_type(__c, eof()) ? 0 : __c; }
};
#endif //_GLIBCPP_USE_WCHAR_T
+ ///
template<typename _CharT, typename _Traits>
struct _Char_traits_match
{