summaryrefslogtreecommitdiff
path: root/mg_tools.h
diff options
context:
space:
mode:
authorLarsAC <LarsAC@e10066b5-e1e2-0310-b819-94efdf66514b>2005-01-07 18:43:03 +0000
committerLarsAC <LarsAC@e10066b5-e1e2-0310-b819-94efdf66514b>2005-01-07 18:43:03 +0000
commit0756ae40d68d403082c86adef042a4c0daba219f (patch)
tree6ca3220de192057fc48a22a616445ff8a759c6d5 /mg_tools.h
parent1823baf159eaa175dd0e5c7ef46fdeeabe92d779 (diff)
downloadvdr-plugin-muggle-0756ae40d68d403082c86adef042a4c0daba219f.tar.gz
vdr-plugin-muggle-0756ae40d68d403082c86adef042a4c0daba219f.tar.bz2
Merged branch osd_extensions back to main trunk
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@324 e10066b5-e1e2-0310-b819-94efdf66514b
Diffstat (limited to 'mg_tools.h')
-rw-r--r--mg_tools.h85
1 files changed, 36 insertions, 49 deletions
diff --git a/mg_tools.h b/mg_tools.h
index dda574b..95d4663 100644
--- a/mg_tools.h
+++ b/mg_tools.h
@@ -1,4 +1,4 @@
-/*! \file muggle_tools.h
+/*! \file mg_tools.h
* \ingroup muggle
* \brief A few utility functions for standalone and plugin messaging for the vdr muggle plugindatabase
*
@@ -6,7 +6,7 @@
* \date $Date$
* \author Ralf Klueber, Lars von Wedel, Andreas Kellner
* \author file owner: $Author$
- *
+ *
*/
/* makes sure we don't use the same declarations twice */
@@ -17,36 +17,21 @@
#include <string>
#include <mysql.h>
-#define STANDALONE 1 // what's this?
-
+#define STANDALONE 1 // what's this?
-/*! \brief mySql helper function to execute read queries
- * \ingroup muggle
- *
- * \todo Could be a member of mgDatabase?
- */
-MYSQL_RES* mgSqlReadQuery( MYSQL *db, const char *fmt, ... );
-
-/*! \brief mySql helper function to execute write queries
- * \ingroup muggle
+/*!
+ * \brief Logging utilities
*
- * \todo Could be a member of mgDatabase?
- */
-void mgSqlWriteQuery( MYSQL *db, const char *fmt, ... );
-
-
-/*!
- * \brief Logging utilities
- *
* \todo these could be static members in the mgLog class
* \todo code of these functions should be compiled conditionally
*/
//@{
-void mgSetDebugLevel(int new_level);
-void mgDebug(int level, const char *fmt, ...);
-void mgDebug( const char *fmt, ... );
-void mgWarning(const char *fmt, ...);
-void mgError(const char *fmt, ...);
+void mgSetDebugLevel (int new_level);
+void mgDebug (int level, const char *fmt, ...);
+void mgDebug (const char *fmt, ...);
+void mgWarning (const char *fmt, ...);
+//! \todo mgError should display the message on the OSD. How?
+void mgError (const char *fmt, ...);
//@}
#ifdef DEBUG
@@ -63,38 +48,40 @@ void mgError(const char *fmt, ...);
/*! \brief simplified logging class
* \ingroup muggle
- *
+ *
* Create a local instance at the beginning of the method
* and entering/leaving the function will be logged
* as constructors/destructors are called.
*/
class mgLog
{
- public:
- enum
- {
- LOG, WARNING, ERROR, FATAL
- } mgLogLevel;
+ public:
+ enum
+ {
+ LOG, WARNING, ERROR, FATAL
+ } mgLogLevel;
- std::ostream& getStream()
- {
- return std::cout;
- }
-
- mgLog( std::string methodname ) : m_methodname( methodname )
- {
- getStream() << m_methodname << " entered" << std::endl;
- };
+ std::ostream & getStream ()
+ {
+ return std::cout;
+ }
- ~mgLog()
- {
- getStream() << m_methodname << " terminated" << std::endl;
- }
+ mgLog (std::string methodname):m_methodname (methodname)
+ {
+ getStream () << m_methodname << " entered" << std::endl;
+ };
- private:
-
- std::string m_methodname;
+ ~mgLog ()
+ {
+ getStream () << m_methodname << " terminated" << std::endl;
+ }
+
+ private:
+
+ std::string m_methodname;
};
-#endif /* _MUGGLE_TOOLS_H */
+std::string trim(std::string const& source, char const* delims = " \t\r\n");
+
+#endif /* _MUGGLE_TOOLS_H */