diff --git a/darkice/trunk/src/Config.cpp b/darkice/trunk/src/Config.cpp
index c942149..2f89e31 100644
--- a/darkice/trunk/src/Config.cpp
+++ b/darkice/trunk/src/Config.cpp
@@ -9,33 +9,21 @@
Author : $Author$
Location : $Source$
- Abstract :
-
- A configuration file representation. The file is of the syntax:
-
- # this is a whole line comment
- key = value
- an ugly key name = long value # this end is a comment too
-
- also empty lines are ignored and all white space is removed
- from the front and end of keys / values
-
Copyright notice:
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA.
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
------------------------------------------------------------------------------*/
@@ -172,6 +160,9 @@ Config :: read ( istream & is ) throw ( Exception )
$Source$
$Log$
+ Revision 1.2 2000/11/13 18:46:50 darkeye
+ added kdoc-style documentation comments
+
Revision 1.1 2000/11/08 17:29:50 darkeye
added configuration file reader
diff --git a/darkice/trunk/src/Config.h b/darkice/trunk/src/Config.h
index 0ac1c27..f13740a 100644
--- a/darkice/trunk/src/Config.h
+++ b/darkice/trunk/src/Config.h
@@ -9,40 +9,21 @@
Author : $Author$
Location : $Source$
- Abstract :
-
- A configuration file representation. The file is of the syntax:
-
- [section1]
- # this is a whole line comment
- key = value
- an ugly key name = long value # this end is a comment too
-
- [section2]
- # this is a whole line comment in section 2
- key = value
- an ugly key name = long value # this end is a comment too
-
-
- also empty lines are ignored and all white space is removed
- from the front and end of keys / values
-
Copyright notice:
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA.
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
------------------------------------------------------------------------------*/
#ifndef CONFIG_H
@@ -72,17 +53,50 @@
/* =============================================================== data types */
-/*------------------------------------------------------------------------------
- *
- *----------------------------------------------------------------------------*/
+/**
+ * A configuration file representation. The file is of the syntax:
+ *
+ *
+ * [section1]
+ * # this is a whole line comment
+ * key = value
+ * an ugly key name = long value # this end is a comment too
+ *
+ * [section2]
+ * # this is a whole line comment in section 2
+ * key = value
+ * an ugly key name = long value # this end is a comment too
+ *
+ *
+ * also empty lines are ignored and all white space is removed
+ * from the front and end of keys / values
+ *
+ * Knwon problem: you can't use '#' in any part of a key / value pair
+ *
+ * @author $Author$
+ * @version $Revision$
+ */
class Config : public virtual Referable
{
private:
+ /**
+ * Type declaration of the hash table type.
+ */
typedef hash_map TableType;
+
+ /**
+ * Hash table holding the configuration sections.
+ *
+ * @see ConfigSection
+ */
TableType table;
-
+ /**
+ * Hash table holding the configuration sections.
+ *
+ * @see ConfigSection
+ */
string currentSection;
@@ -91,26 +105,41 @@ class Config : public virtual Referable
public:
+ /**
+ * Default constructor.
+ *
+ * @exception Exception
+ */
inline
Config ( void ) throw ( Exception )
{
}
-
+ /**
+ * Constructor based on an input stream.
+ *
+ * @param is configuration will be read from this input stream
+ * until end of stream is reached.
+ * @exception Exception
+ */
inline
Config ( istream & is ) throw ( Exception )
{
read( is );
}
-
+ /**
+ * Destructor.
+ *
+ * @exception Exception
+ */
inline virtual
~Config ( void ) throw ( Exception )
{
}
-/*
+/* TODO
inline
Config ( const Config & di ) throw ( Exception )
@@ -124,6 +153,12 @@ class Config : public virtual Referable
}
*/
+ /**
+ * Delete the configuration information stored in the object.
+ * Resets the object to a clean state.
+ *
+ * @exception Exception
+ */
inline virtual void
reset ( void ) throw ( Exception )
{
@@ -131,15 +166,33 @@ class Config : public virtual Referable
currentSection = "";
}
-
+ /**
+ * Read a line of confiugration information.
+ *
+ * @param line the line to read.
+ * @return true if the line was correct, false otherwise.
+ * @exception Exception
+ */
virtual bool
addLine ( const char * line ) throw ( Exception );
-
+ /**
+ * Read a line of confiugration information.
+ *
+ * @param line the line to read.
+ * @return true if the line was correct, false otherwise.
+ * @exception Exception
+ */
virtual void
read ( istream & is ) throw ( Exception );
-
+ /**
+ * Get a ConfigSection by name.
+ *
+ * @param key the name of the ConfigSection
+ * @return the ConfigSection requested, or NULL if it doesn't exists.
+ * @exception Exception
+ */
virtual const ConfigSection *
get ( const char * key ) const throw ( Exception );
};
@@ -160,6 +213,9 @@ class Config : public virtual Referable
$Source$
$Log$
+ Revision 1.3 2000/11/13 18:46:50 darkeye
+ added kdoc-style documentation comments
+
Revision 1.2 2000/11/09 22:07:19 darkeye
added constructor with istream
diff --git a/darkice/trunk/src/ConfigSection.cpp b/darkice/trunk/src/ConfigSection.cpp
index 9ed0b3c..4ac69c9 100644
--- a/darkice/trunk/src/ConfigSection.cpp
+++ b/darkice/trunk/src/ConfigSection.cpp
@@ -9,33 +9,21 @@
Author : $Author$
Location : $Source$
- Abstract :
-
- A configuration file representation. The file is of the syntax:
-
- # this is a whole line comment
- key = value
- an ugly key name = long value # this end is a comment too
-
- also empty lines are ignored and all white space is removed
- from the front and end of keys / values
-
Copyright notice:
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA.
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
------------------------------------------------------------------------------*/
@@ -180,6 +168,9 @@ ConfigSection :: addLine ( const char * line ) throw ( Exception )
$Source$
$Log$
+ Revision 1.3 2000/11/13 18:46:50 darkeye
+ added kdoc-style documentation comments
+
Revision 1.2 2000/11/09 22:08:17 darkeye
added function getForSure
diff --git a/darkice/trunk/src/ConfigSection.h b/darkice/trunk/src/ConfigSection.h
index 23b2827..da553e8 100644
--- a/darkice/trunk/src/ConfigSection.h
+++ b/darkice/trunk/src/ConfigSection.h
@@ -9,33 +9,21 @@
Author : $Author$
Location : $Source$
- Abstract :
-
- A configuration file representation. The file is of the syntax:
-
- # this is a whole line comment
- key = value
- an ugly key name = long value # this end is a comment too
-
- also empty lines are ignored and all white space is removed
- from the front and end of keys / values
-
Copyright notice:
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA.
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
------------------------------------------------------------------------------*/
#ifndef CONFIG_SECTION_H
@@ -62,39 +50,65 @@
/* =============================================================== data types */
-/*------------------------------------------------------------------------------
- *
- *----------------------------------------------------------------------------*/
+/**
+ * A configuration file representation. The file is of the syntax:
+ *
+ *
+ * # this is a whole line comment
+ * key = value
+ * an ugly key name = long value # this end is a comment too
+ *
+ *
+ * also empty lines are ignored and all white space is removed
+ * from the front and end of keys / values
+ *
+ * Knwon problem: you can't use '#' in any part of a key / value pair
+ *
+ * @author $Author$
+ * @version $Revision$
+ */
class ConfigSection : public virtual Referable
{
private:
+ /**
+ * Type of the hash table used in this class.
+ */
typedef hash_map TableType;
+
+ /**
+ * Hash table holding the configuration information.
+ */
TableType table;
- void
- init ( void ) throw ( Exception );
-
-
protected:
public:
+ /**
+ * Default constructor.
+ *
+ * @exception Exception
+ */
inline
ConfigSection ( void ) throw ( Exception )
{
}
-
+ /**
+ * Destructor.
+ *
+ * @exception Exception
+ */
inline virtual
~ConfigSection ( void ) throw ( Exception )
{
}
-/*
+/* TODO
inline
ConfigSection ( const ConfigSection & di ) throw ( Exception )
@@ -108,15 +122,38 @@ class ConfigSection : public virtual Referable
}
*/
+ /**
+ * Add a key / value pair to the configuration information.
+ *
+ * @param key the key to add the value by
+ * @param value the value to add for the key
+ * @return true if adding was successful, false otherwise
+ * @exception Exception
+ */
virtual bool
add ( const char * key,
const char * value ) throw ( Exception );
-
+ /**
+ * Get a value for a key.
+ *
+ * @param key the key to get the value for
+ * @return the value for the key, or NULL if the key doesn't exist.
+ * @exception Exception
+ */
virtual const char *
get ( const char * key ) const throw ( Exception );
-
+ /**
+ * Get a value for a key, or throw an Exception.
+ *
+ * @param key the key to get the value for
+ * @param message1 message part 1 of the Exception to be thrown.
+ * @param message2 message part 2 of the Exception to be thrown.
+ * @param code error code of the Exception to be thrown.
+ * @return the value for the key. The return value is never NULL.
+ * @exception Exception
+ */
virtual const char *
getForSure ( const char * key,
const char * message1 = 0,
@@ -124,7 +161,13 @@ class ConfigSection : public virtual Referable
int code = 0 ) const
throw ( Exception );
-
+ /**
+ * Add a line of configuration information.
+ *
+ * @param line the line to add.
+ * @return true if a new key was added, false otherwise.
+ * @exception Exception
+ */
virtual bool
addLine ( const char * line ) throw ( Exception );
};
@@ -145,6 +188,9 @@ class ConfigSection : public virtual Referable
$Source$
$Log$
+ Revision 1.3 2000/11/13 18:46:50 darkeye
+ added kdoc-style documentation comments
+
Revision 1.2 2000/11/09 22:08:17 darkeye
added function getForSure
diff --git a/darkice/trunk/src/Connector.cpp b/darkice/trunk/src/Connector.cpp
index efca964..4391a8b 100644
--- a/darkice/trunk/src/Connector.cpp
+++ b/darkice/trunk/src/Connector.cpp
@@ -9,26 +9,21 @@
Author : $Author$
Location : $Source$
- Abstract :
-
- Connects a source to a sink
-
Copyright notice:
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA.
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
------------------------------------------------------------------------------*/
@@ -333,8 +328,11 @@ Connector :: close ( void ) throw ( Exception )
$Source$
$Log$
- Revision 1.1 2000/11/05 10:05:49 darkeye
- Initial revision
+ Revision 1.2 2000/11/13 18:46:50 darkeye
+ added kdoc-style documentation comments
+
+ Revision 1.1.1.1 2000/11/05 10:05:49 darkeye
+ initial version
------------------------------------------------------------------------------*/
diff --git a/darkice/trunk/src/Connector.h b/darkice/trunk/src/Connector.h
index 957fa49..cfc310b 100644
--- a/darkice/trunk/src/Connector.h
+++ b/darkice/trunk/src/Connector.h
@@ -9,26 +9,21 @@
Author : $Author$
Location : $Source$
- Abstract :
-
- Connects a source to a sink
-
Copyright notice:
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA.
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
------------------------------------------------------------------------------*/
#ifndef CONNECTOR_H
@@ -55,30 +50,56 @@
/* =============================================================== data types */
-/*------------------------------------------------------------------------------
- *
- *----------------------------------------------------------------------------*/
+/**
+ * Connects a source to one or more sinks.
+ *
+ * @author $Author$
+ * @version $Revision$
+ */
class Connector : public virtual Referable
{
private:
+ /**
+ * The source to read from.
+ */
Ref