summaryrefslogtreecommitdiff
path: root/dxr3log.c
diff options
context:
space:
mode:
authoraustriancoder <austriancoder>2004-08-05 23:05:21 +0000
committeraustriancoder <austriancoder>2004-08-05 23:05:21 +0000
commitc47666d42f7972e1b51f9de61ce0fa27c72f3127 (patch)
treee34a87e37901b7f892fb6f330ccb15bcba30039b /dxr3log.c
downloadvdr-plugin-dxr3-c47666d42f7972e1b51f9de61ce0fa27c72f3127.tar.gz
vdr-plugin-dxr3-c47666d42f7972e1b51f9de61ce0fa27c72f3127.tar.bz2
initial import
Diffstat (limited to 'dxr3log.c')
-rw-r--r--dxr3log.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/dxr3log.c b/dxr3log.c
new file mode 100644
index 0000000..09f54c1
--- /dev/null
+++ b/dxr3log.c
@@ -0,0 +1,60 @@
+/*
+ * dxr3log.c
+ *
+ * Copyright (C) 2004 Christian Gmeiner
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * 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 Lesser 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.
+ *
+ */
+
+#include "dxr3log.h"
+
+// ==================================
+cLog::cLog()
+{
+ m_LogOpen = false;
+ m_ForeFlush = true;
+
+ Open("dxr3plugin.log");
+}
+
+// ==================================
+cLog::cLog(std::string Filename)
+{
+ m_LogOpen = false;
+ m_ForeFlush = true;
+
+ Open(Filename);
+}
+
+// ==================================
+void cLog::Open(std::string Filename)
+{
+ m_LogStream.open(Filename.c_str());
+ m_LogOpen = true;
+}
+
+// ==================================
+void cLog::Close()
+{
+ if (m_LogOpen)
+ {
+ // close file now
+ m_LogStream.flush();
+ m_LogStream.close();
+
+ m_LogOpen = false;
+ }
+}