From d5548a3f135ff120c6fa8c6742d23e4e31a75647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Fri, 18 Sep 2009 11:41:30 +0000 Subject: [PATCH] improved doxygen --- doc/makefile.am | 2 +- src/cryptoki.hxx | 28 +++++++++++++++++++++++++++- src/openssl.hxx | 17 +++++++++++++++++ src/overview.doc | 23 +++++++++++++++++++++++ src/pcsc.hxx | 29 +++++++++++++++++++++++++++-- 5 files changed, 95 insertions(+), 4 deletions(-) create mode 100644 src/overview.doc diff --git a/doc/makefile.am b/doc/makefile.am index 3352823..9298df2 100644 --- a/doc/makefile.am +++ b/doc/makefile.am @@ -10,7 +10,7 @@ SUBDIRS = examples develdir = ${pkgdatadir}/doc devel_DATA = html/index.html -ALL_SRC = ${top_srcdir}/src/*.[ch]xx +ALL_SRC = ${top_srcdir}/src/*.[ch]xx ${top_srcdir}/src/*.doc #${top_srcdir}/test/*.[ch]xx DIRS = html diff --git a/src/cryptoki.hxx b/src/cryptoki.hxx index 57aec45..a2f3d3e 100644 --- a/src/cryptoki.hxx +++ b/src/cryptoki.hxx @@ -23,7 +23,13 @@ #include // debug -//! C++ Wrapper around Cryptoki API +/*! @defgroup gcryptoki C++ Wrapper around Cryptoki API */ +//@{ +/*! @defgroup cryptokilib Cryptoki C++ Library */ +/*! @defgroup cryptokitypes Cryptoki C++ Types and Auxiliary */ +/*! @defgroup cryptokiexceptions Cryptoki Exceptions */ + +//! @see gcryptoki namespace cryptoki { #ifndef CRYPTOKI_FN_LOG @@ -37,6 +43,9 @@ namespace cryptoki { #define UNDEF_CRYPTOKI_FN_LOG #endif + //! @addtogroup cryptokitypes + //@{ + static const std::string LETTER_CHARS ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); static const std::string NUMBER_CHARS @@ -95,7 +104,13 @@ namespace cryptoki { #define CRYPTOKI_TO_VECTOR(ARRAY) \ toVector(ARRAY) + //@} + //============================================================================ + /*! @addtogroup cryptokiexceptions */ + //@{ + + //---------------------------------------------------------------------------- class exception: public std::exception { public: exception(const std::string& reason) throw(): @@ -122,6 +137,10 @@ namespace cryptoki { exception("smardcard access error:\n"+reason) { } }; + //@} + + /*! @addtogroup cryptokitypes */ + //@{ class Slot; typedef std::vector SlotList; @@ -585,6 +604,11 @@ namespace cryptoki { CK_VERSION libraryVersion; }; + //@} + + /*! @addtogroup cryptokilib */ + //@{ + //! to be instanciated before first use class Init { @@ -1751,6 +1775,7 @@ namespace cryptoki { //@} }; + //@} #ifdef UNDEF_CRYPTOKI_FN_LOG // cleanup if it was set in here #undef CRYPTOKI_FN_LOG @@ -1758,4 +1783,5 @@ namespace cryptoki { #endif } +//@} #endif diff --git a/src/openssl.hxx b/src/openssl.hxx index 5f0f05d..5cbc1e0 100644 --- a/src/openssl.hxx +++ b/src/openssl.hxx @@ -16,10 +16,20 @@ #include #include +/*! @defgroup gopenssl C++ Wrapper around OpenSSL API */ +//@{ +//! @defgroup openssllib OpenSSL C++ Library +//! @defgroup opensslexceptions OpenSSL Exceptions + +//! @see gopenssl namespace openssl { //============================================================================ + //! @addtogroup opensslexceptions + //@{ + + //---------------------------------------------------------------------------- class exception: public std::exception { public: exception(const std::string& reason) throw(): @@ -126,6 +136,10 @@ namespace openssl { bio_error("connection failed to: "+hostPort) { } }; + //@} + + //! @addtogroup openssllib + //@{ //============================================================================ class Init { @@ -275,6 +289,9 @@ namespace openssl { ::BIO* _bio; }; + //@} + } +//@} #endif diff --git a/src/overview.doc b/src/overview.doc new file mode 100644 index 0000000..79440e6 --- /dev/null +++ b/src/overview.doc @@ -0,0 +1,23 @@ +/*! @file + + @id $Id$ +*/ +// 1 2 3 4 5 6 7 8 +// 45678901234567890123456789012345678901234567890123456789012345678901234567890 + +/*! @mainpage + + There are three namespaces which correspond to the three modules + that are implemented here: + + - @ref gpcsc + - @ref gcryptoki + - @ref gopenssl + + All these three libraries deal with hardware token cryptografy and + all three libraries are implemented in ugliest C manner. The + warpper cares about memory- and resource-management and implements + a simple and easy C++ interface, including exceptions for error + handling. + + */ diff --git a/src/pcsc.hxx b/src/pcsc.hxx index 09c4ca4..b706134 100644 --- a/src/pcsc.hxx +++ b/src/pcsc.hxx @@ -49,8 +49,10 @@ #include #include -//! This library is a C++ wrapper to the awful pcsc-lite interface. -/*! The reason for this wrapper is to get a nice object oriented +/*! @defgroup gpcsc C++ Wrapper around pcsc-lite API + + This library is a C++ wrapper to the awful pcsc-lite interface. + The reason for this wrapper is to get a nice object oriented interface written in C++ manner and using standard types and so to avoid the ugly M$-C-quirks. This interface is memory clean. @todo: Not implemented, not supported: @@ -64,8 +66,17 @@ required. If you need something that is not yet supported, please let me know, what you need and why. Then I'll add it so that it best fits the common needs. */ +//@{ +/*! @defgroup pcsclib PCSC C++ Library */ +/*! @defgroup pcsctypes PCSC Types and Auxiliary */ +/*! @defgroup pcscexceptions PCSC Exceptions */ + +//! @see gpcsc namespace pcsc { + //! @addtogroup pcsctypes + //@{ + std::string hex(const std::string& data) { std::stringstream res; for (std::string::const_iterator it(data.begin()); it!=data.end(); ++it) @@ -74,7 +85,13 @@ namespace pcsc { return res.str(); } + //@} + //============================================================================ + //! @addtogroup pcsclib + //@{ + + //---------------------------------------------------------------------------- class exception: public std::exception { public: exception(const std::string& reason) throw(): _what("pcsc: "+reason) {} @@ -99,7 +116,11 @@ namespace pcsc { exception("smardcard access error:\n"+reason) { } }; + //@} + //! @addtogroup pcsclib + //@{ + //============================================================================ class Connection { @@ -695,5 +716,9 @@ namespace pcsc { }; + //@} + } +//@} + #endif