preliminary work on parser class
Change-Id: I792fd2a0f08f5383574f583b55e867056db36efe
diff --git a/webvttparser.cpp b/webvttparser.cpp
index 97ba3be..6b25757 100644
--- a/webvttparser.cpp
+++ b/webvttparser.cpp
@@ -11,5 +11,13 @@
{
}
+Parser::Parser(IReader* p) :
+ m_pReader(p)
+{
+}
+
+Parser::~Parser()
+{
+}
} //end namespace WebvttParser
diff --git a/webvttparser.hpp b/webvttparser.hpp
index aea6bdf..f6bfa86 100644
--- a/webvttparser.hpp
+++ b/webvttparser.hpp
@@ -9,12 +9,50 @@
protected:
IReader();
virtual ~IReader();
-
+
public:
virtual int Read(char& c) = 0;
};
+class Parser
+{
+private:
+ Parser(const Parser&);
+ Parser& operator=(const Parser&);
+
+public:
+ Parser(IReader*);
+ ~Parser();
+
+ int Parse();
+
+ //need to know kind:
+ // caption, description, metadata, etc
+ // is this a webvtt stream?
+ //
+ //cue identifier
+ //timestamp (or defaults?) + cue settings
+ //payload
+ // preserve each line
+
+ //machine states:
+ // parsing stream id ("webvtt")
+ // parsing file-wide metadata
+ // parsing cue
+ //
+ //within cue:
+ // parsing line
+ // is this a cue identifier or timestamp line?
+ //
+ // parsing cue id
+ // parsing timestamp
+ // parsing lines, looking for end-of-cue
+
+private:
+ IReader* const m_pReader;
+
+};
} //end namespace WebvttParser