Skip to content

Commit

Permalink
Integrate doxygen into makedict.
Browse files Browse the repository at this point in the history
git-svn-id: https://xdxf.svn.sourceforge.net/svnroot/xdxf/trunk@42 9cfc4783-1b1d-0410-aaba-dcc21bd7f26c
  • Loading branch information
Dushistov committed Dec 18, 2006
1 parent 1b2b895 commit 32ee7e7
Show file tree
Hide file tree
Showing 16 changed files with 281 additions and 11 deletions.
180 changes: 180 additions & 0 deletions Doxyfile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# Doxyfile 0.1

#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = makedict
PROJECT_NUMBER = @VERSION@
OUTPUT_DIRECTORY = docs/api
OUTPUT_LANGUAGE = English
EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = YES
FULL_PATH_NAMES = NO
STRIP_FROM_PATH =
INTERNAL_DOCS = NO
STRIP_CODE_COMMENTS = YES
CASE_SENSE_NAMES = YES
SHORT_NAMES = NO
HIDE_SCOPE_NAMES = NO
VERBATIM_HEADERS = YES
SHOW_INCLUDE_FILES = YES
JAVADOC_AUTOBRIEF = YES
INHERIT_DOCS = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 8
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
ALIASES =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = YES
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_FORMAT =
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = src
FILE_PATTERNS = *.c *.h *.cpp *.hpp
RECURSIVE = YES
#EXCLUDE = test

# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories.

EXCLUDE_PATTERNS = Makefile.* ChangeLog CHANGES CHANGES.* README \
README.* *.png AUTHORS DESIGN DESIGN.* *.desktop \
DESKTOP* COMMENTS HOWTO magic NOTES TODO THANKS

# The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see
# the \include command).

EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = NO
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT =
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT =
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT =
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = YES
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = YES
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = "DBUS_BEGIN_DECLS=" \
"DBUS_END_DECLS=" \
"DOXYGEN_SHOULD_SKIP_THIS" \
"_DBUS_DEFINE_GLOBAL_LOCK(name)=" \
"_DBUS_GNUC_PRINTF(from,to)="
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
PERL_PATH =
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HAVE_DOT = NO
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
TEMPLATE_RELATIONS = YES
HIDE_UNDOC_RELATIONS = YES
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 640
MAX_DOT_GRAPH_HEIGHT = 1024
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
SUBDIRS = m4 src docs tests mvsc

ACLOCAL_AMFLAGS = -I m4

all-local: Doxyfile
2 changes: 1 addition & 1 deletion config.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* config.h. Generated by configure. */
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */

/* Define to 1 if you have the <expat.h> header file. */
Expand Down
32 changes: 32 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ AC_PROG_MAKE_SET
AC_PROG_RANLIB
AM_PATH_PYTHON

AC_ARG_ENABLE(doxygen-docs, AS_HELP_STRING([--enable-doxygen-docs],[build DOXYGEN documentation (requires Doxygen)]),enable_doxygen_docs=$enableval,enable_doxygen_docs=auto)

dnl ================================================================
dnl Gettext stuff.
dnl ================================================================
Expand All @@ -30,6 +32,35 @@ dnl ================================================================
#AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
#AM_ICONV

### Doxygen Documentation

AC_PATH_PROG(DOXYGEN, doxygen, no)

AC_MSG_CHECKING([whether to build Doxygen documentation])

if test x$DOXYGEN = xno ; then
have_doxygen=no
else
have_doxygen=yes
fi

if test x$enable_doxygen_docs = xauto ; then
if test x$have_doxygen = xno ; then
enable_doxygen_docs=no
else
enable_doxygen_docs=yes
fi
fi
if test x$enable_doxygen_docs = xyes; then
if test x$have_doxygen = xno; then
AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found])
fi
fi

AM_CONDITIONAL(MAKEDICT_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
AC_MSG_RESULT(yes)


AC_FUNC_MMAP

AC_CHECK_LIB(z,zlibVersion,LIBS="$LIBS -lz",[AC_MSG_ERROR([zlib not found])])
Expand All @@ -43,6 +74,7 @@ AC_SUBST(MAKEDICT_LIBS)
AC_SUBST(MAKEDICT_CFLAGS)

AC_OUTPUT([
Doxyfile
Makefile
m4/Makefile
src/Makefile
Expand Down
4 changes: 3 additions & 1 deletion src/charset_conv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#include <iconv.h>
#include <string>

//wrapper for iconv usage
/**
* Wrapper for iconv usage.
*/
class CharsetConv {
public:
CharsetConv() { cd_ = iconv_t(-1); }
Expand Down
4 changes: 4 additions & 0 deletions src/connector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include "parser.hpp"
#include "generator.hpp"

/**
* Implementation of IParserDictOps and IGeneratorDictOps
* to fast pass information from parser to generator.
*/
class Connector : public IParserDictOps, public IGeneratorDictOps {
public:
Connector(GeneratorBase& generator, const std::string& workdir):
Expand Down
17 changes: 11 additions & 6 deletions src/dictd_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@


//#define DEBUG

namespace dictd {
/**
* Temporary repository for dictionary.
*/
class dictionary {
public:
explicit dictionary(const std::string& tmpfilename);
Expand All @@ -55,15 +58,16 @@ class dictionary {
};
std::vector<key> keylist;
};

void dictionary::add_article(const std::string& keyval, const std::string& data)
}
void dictd::dictionary::add_article(const std::string& keyval,
const std::string& data)
{
keylist.push_back(key(keyval, datafile.tell(), data.length()));
if (!datafile.write(data.c_str(), data.length()))
StdErr << _("WARRNING: dictionary::add_article: write failed\n");
}

dictionary::dictionary(const std::string& tmpfilename)
dictd::dictionary::dictionary(const std::string& tmpfilename)
{
datafilename=tmpfilename;
datafile.reset(fopen(tmpfilename.c_str(), "w+b"));
Expand All @@ -72,7 +76,8 @@ dictionary::dictionary(const std::string& tmpfilename)
datafilename.c_str());
}

void dictionary::get_article(size_t i, std::string &key, std::string& data)
void dictd::dictionary::get_article(size_t i, std::string &key,
std::string& data)
{
if (i>=keylist.size())
return;
Expand All @@ -86,7 +91,7 @@ void dictionary::get_article(size_t i, std::string &key, std::string& data)
StdErr << _("WARRNING: dictionary::get_article: read failed\n");
}

dictionary::~dictionary()
dictd::dictionary::~dictionary()
{
remove(datafilename.c_str());
}
Expand Down
5 changes: 5 additions & 0 deletions src/file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
#include <cstdio>
#include <string>

/**
* Wrapper around FILE, because of std::fstream can not
* exactly explain what error happened, but there is guarantee
* that errno contains error for FILE functions.
*/
class File {
public:
File(FILE *stream = NULL, bool close_on_exit = true) :
Expand Down
12 changes: 11 additions & 1 deletion src/generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ typedef std::vector<std::string> StringList;

class GeneratorBase;

/**
* Interface for exchange information between dictionary parsers
* and generators.
*/
class IGeneratorDictOps {
public:
IGeneratorDictOps(GeneratorBase& generator) :
Expand Down Expand Up @@ -65,7 +69,10 @@ class IGeneratorDictOps {
void sample(StringList& keys, std::vector<std::string>::size_type n);
};


/**
* Implementation of IGeneratorDictOps to pass internal
* represantation of dictionary through pipe.
*/
class GeneratorDictPipeOps : public IGeneratorDictOps {
public:
GeneratorDictPipeOps(File& in, GeneratorBase& generator);
Expand Down Expand Up @@ -108,6 +115,9 @@ class GeneratorDictPipeOps : public IGeneratorDictOps {
static void XMLCALL xml_char_data(void *, const XML_Char *, int);
};

/**
* Base class for write dictionary generators.
*/
class GeneratorBase {
public:
GeneratorBase(bool enc_key);
Expand Down
3 changes: 3 additions & 0 deletions src/log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

#include <glib.h>

/**
* Encapsulate logging mechanizm.
*/
class Logger {
public:
Logger(gint level = 2);
Expand Down
4 changes: 3 additions & 1 deletion src/makedict.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@

//#define DEBUG


/**
* Main class.
*/
class MakeDict {
public:
MakeDict() {}
Expand Down
3 changes: 3 additions & 0 deletions src/mapfile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# include "resource.hpp"
#endif

/**
* Wrapper around mmap and its analogs.
*/
class MapFile {
public:
char *cur;
Expand Down
Loading

0 comments on commit 32ee7e7

Please sign in to comment.