summaryrefslogtreecommitdiff
path: root/libs/IO/include
diff options
context:
space:
mode:
authorgeronimo <geronimo013@gmx.de>2012-07-30 09:12:30 +0200
committergeronimo <geronimo013@gmx.de>2012-07-30 09:12:30 +0200
commit2331befb330683d0e5459f9ca2d522f2f06c3d7e (patch)
treee95c3c4e40d57cbcf6af16d2736f34dce0279c4b /libs/IO/include
parent570a18b0d0a9a00b240504ac949214d6cc96949b (diff)
downloadcmp-2331befb330683d0e5459f9ca2d522f2f06c3d7e.tar.gz
cmp-2331befb330683d0e5459f9ca2d522f2f06c3d7e.tar.bz2
worked out commandreader
Diffstat (limited to 'libs/IO/include')
-rw-r--r--libs/IO/include/CommandReader.h49
-rw-r--r--libs/IO/include/ConfigReader.h3
-rw-r--r--libs/IO/include/FileReader.h11
-rw-r--r--libs/IO/include/FileRepresentation.h12
-rw-r--r--libs/IO/include/LineReader.h10
-rw-r--r--libs/IO/include/Reader.h41
6 files changed, 107 insertions, 19 deletions
diff --git a/libs/IO/include/CommandReader.h b/libs/IO/include/CommandReader.h
new file mode 100644
index 0000000..e54a64c
--- /dev/null
+++ b/libs/IO/include/CommandReader.h
@@ -0,0 +1,49 @@
+/**
+ * ======================== legal notice ======================
+ *
+ * File: CommandReader.h
+ * Created: 30. Juli 2012, 06:42
+ * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
+ * Project: libIO: classes for files, filesystem and input/output
+ *
+ * CMP - compound media player
+ *
+ * is a client/server mediaplayer intended to play any media from any workstation
+ * without the need to export or mount shares. cmps is an easy to use backend
+ * with a (ready to use) HTML-interface. Additionally the backend supports
+ * authentication via HTTP-digest authorization.
+ * cmpc is a client with vdr-like osd-menues.
+ *
+ * Copyright (c) 2012 Reinhard Mantey, some rights reserved!
+ * published under Creative Commons by-sa
+ * For details see http://creativecommons.org/licenses/by-sa/3.0/
+ *
+ * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp
+ *
+ * --------------------------------------------------------------
+ */
+#ifndef COMMANDREADER_H
+#define COMMANDREADER_H
+
+#include <Reader.h>
+#include <vector>
+#include <string>
+
+class cCommandReader : public cReader {
+public:
+ cCommandReader(const char *cmd);
+ virtual ~cCommandReader();
+
+ void AddCommandParameter(const char *Param);
+
+protected:
+ virtual bool Open(void);
+ virtual void Close(void);
+
+private:
+ pid_t pid;
+ std::vector<std::string> args;
+ };
+
+#endif /* COMMANDREADER_H */
+
diff --git a/libs/IO/include/ConfigReader.h b/libs/IO/include/ConfigReader.h
index f3aa5eb..6d0cd30 100644
--- a/libs/IO/include/ConfigReader.h
+++ b/libs/IO/include/ConfigReader.h
@@ -29,8 +29,7 @@
#include <string>
class cLineReader;
-class cConfigReader
-{
+class cConfigReader {
public:
typedef std::tuple <std::string, std::string> ConfigEntry;
diff --git a/libs/IO/include/FileReader.h b/libs/IO/include/FileReader.h
index 31cb7d6..816b140 100644
--- a/libs/IO/include/FileReader.h
+++ b/libs/IO/include/FileReader.h
@@ -25,18 +25,19 @@
#ifndef FILEREADER_H
#define FILEREADER_H
+#include <Reader.h>
+
class cFile;
-class cFileReader
-{
+class cFileReader : public cReader {
public:
cFileReader(cFile *Input);
virtual ~cFileReader();
- int Read(char *buf, int bufSize);
- void Close();
+protected:
+ virtual bool Open(void);
+ virtual void Close(void);
private:
- int fd;
cFile *file;
};
diff --git a/libs/IO/include/FileRepresentation.h b/libs/IO/include/FileRepresentation.h
index 8bc9d9b..2c2db5a 100644
--- a/libs/IO/include/FileRepresentation.h
+++ b/libs/IO/include/FileRepresentation.h
@@ -1,25 +1,25 @@
/**
* ======================== legal notice ======================
- *
+ *
* File: FileRepresentation.h
* Created: 21. Juli 2012, 12
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
* Project: libIO: classes for files, filesystem and input/output
- *
+ *
* CMP - compound media player
- *
+ *
* is a client/server mediaplayer intended to play any media from any workstation
* without the need to export or mount shares. cmps is an easy to use backend
* with a (ready to use) HTML-interface. Additionally the backend supports
* authentication via HTTP-digest authorization.
* cmpc is a client with vdr-like osd-menues.
- *
+ *
* Copyright (c) 2012 Reinhard Mantey, some rights reserved!
* published under Creative Commons by-sa
* For details see http://creativecommons.org/licenses/by-sa/3.0/
- *
+ *
* The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp
- *
+ *
* --------------------------------------------------------------
*/
#ifndef FILEREPRESENTATION_H
diff --git a/libs/IO/include/LineReader.h b/libs/IO/include/LineReader.h
index 8b8b754..3de64dc 100644
--- a/libs/IO/include/LineReader.h
+++ b/libs/IO/include/LineReader.h
@@ -25,19 +25,17 @@
#ifndef LINEREADER_H
#define LINEREADER_H
-
-class cFileReader;
-class cLineReader
-{
+class cReader;
+class cLineReader {
public:
- cLineReader(cFileReader *FileReader);
+ cLineReader(cReader *Reader);
virtual ~cLineReader();
const char *ReadLine(void);
void Close(void);
private:
- cFileReader *reader;
+ cReader *reader;
int bytesRead;
int off;
int bufSize;
diff --git a/libs/IO/include/Reader.h b/libs/IO/include/Reader.h
new file mode 100644
index 0000000..bc346a6
--- /dev/null
+++ b/libs/IO/include/Reader.h
@@ -0,0 +1,41 @@
+/**
+ * ======================== legal notice ======================
+ *
+ * File: Reader.h
+ * Created: 30. Juli 2012, 06:44
+ * Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
+ * Project: libIO: classes for files, filesystem and input/output
+ *
+ * CMP - compound media player
+ *
+ * is a client/server mediaplayer intended to play any media from any workstation
+ * without the need to export or mount shares. cmps is an easy to use backend
+ * with a (ready to use) HTML-interface. Additionally the backend supports
+ * authentication via HTTP-digest authorization.
+ * cmpc is a client with vdr-like osd-menues.
+ *
+ * Copyright (c) 2012 Reinhard Mantey, some rights reserved!
+ * published under Creative Commons by-sa
+ * For details see http://creativecommons.org/licenses/by-sa/3.0/
+ *
+ * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp
+ *
+ * --------------------------------------------------------------
+ */
+#ifndef READER_H
+#define READER_H
+
+class cReader {
+public:
+ cReader();
+ virtual ~cReader();
+ virtual int Read(char *buf, int bufSize);
+
+protected:
+ virtual bool Open(void) = 0;
+ virtual void Close(void) = 0;
+ int fd;
+ };
+
+#endif /* READER_H */
+