summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-02-25 18:05:04 +0100
committerDavid Tardon <dtardon@redhat.com>2016-02-25 18:05:04 +0100
commit81698ba9c2c7d967d32bc1af9183a2b6d711b8b2 (patch)
treee6681af405a2801602d8f4fd7b0fb9193f6678c2
parent85eaf29e1798c98c2703dbabad818001c5a6ab00 (diff)
add skeleton T602 parser
-rw-r--r--src/lib/Makefile.am4
-rw-r--r--src/lib/SW602Document.cpp2
-rw-r--r--src/lib/T602Header.cpp31
-rw-r--r--src/lib/T602Header.h35
-rw-r--r--src/lib/T602Parser.cpp30
-rw-r--r--src/lib/T602Parser.h34
6 files changed, 136 insertions, 0 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index d36d8af..caa81e6 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -64,6 +64,10 @@ libsw602_@SW602_MAJOR_VERSION@_@SW602_MINOR_VERSION@_la_SOURCES = \
SW602TextListener.h \
SW602Types.cpp \
SW602Types.h \
+ T602Header.cpp \
+ T602Header.h \
+ T602Parser.cpp \
+ T602Parser.h \
WinText602Header.cpp \
WinText602Header.h \
WinText602Parser.cpp \
diff --git a/src/lib/SW602Document.cpp b/src/lib/SW602Document.cpp
index 038bd1f..d18fac6 100644
--- a/src/lib/SW602Document.cpp
+++ b/src/lib/SW602Document.cpp
@@ -16,6 +16,8 @@
#include <librevenge-stream/librevenge-stream.h>
+#include "T602Header.h"
+#include "T602Parser.h"
#include "WinText602Header.h"
#include "WinText602Parser.h"
diff --git a/src/lib/T602Header.cpp b/src/lib/T602Header.cpp
new file mode 100644
index 0000000..454e21e
--- /dev/null
+++ b/src/lib/T602Header.cpp
@@ -0,0 +1,31 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * This file is part of the libsw602 project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "T602Header.h"
+
+namespace libsw602
+{
+
+T602Header::T602Header()
+ : m_valid(false)
+{
+}
+
+void T602Header::construct(librevenge::RVNGInputStream &/*input*/)
+{
+}
+
+bool T602Header::isValid() const
+{
+ return m_valid;
+}
+
+} // namespace libsw602
+
+/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
diff --git a/src/lib/T602Header.h b/src/lib/T602Header.h
new file mode 100644
index 0000000..da5dd65
--- /dev/null
+++ b/src/lib/T602Header.h
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * This file is part of the libsw602 project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_T602HEADER_H
+#define INCLUDED_T602HEADER_H
+
+#include <librevenge-stream/librevenge-stream.h>
+
+namespace libsw602
+{
+
+class T602Header
+{
+public:
+ T602Header();
+
+ void construct(librevenge::RVNGInputStream &input);
+
+ bool isValid() const;
+
+private:
+ bool m_valid;
+};
+
+} // namespace libsw602
+
+#endif // INCLUDED_T602HEADER_H
+
+/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
diff --git a/src/lib/T602Parser.cpp b/src/lib/T602Parser.cpp
new file mode 100644
index 0000000..9c0d77b
--- /dev/null
+++ b/src/lib/T602Parser.cpp
@@ -0,0 +1,30 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * This file is part of the libsw602 project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "T602Parser.h"
+
+namespace libsw602
+{
+
+T602Parser::T602Parser(boost::shared_ptr<librevenge::RVNGInputStream> input)
+ : SW602TextParser(input)
+ , m_header()
+{
+}
+
+void T602Parser::parse(librevenge::RVNGTextInterface * /*documentInterface*/)
+{
+ m_header.construct(*getInput());
+ if (!m_header.isValid())
+ throw ParseException();
+}
+
+}
+
+/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
diff --git a/src/lib/T602Parser.h b/src/lib/T602Parser.h
new file mode 100644
index 0000000..e7d9ab8
--- /dev/null
+++ b/src/lib/T602Parser.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * This file is part of the libsw602 project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_T602_PARSER_H
+#define INCLUDED_T602_PARSER_H
+
+#include "SW602Parser.h"
+#include "T602Header.h"
+
+namespace libsw602
+{
+
+class T602Parser : public SW602TextParser
+{
+public:
+ explicit T602Parser(boost::shared_ptr<librevenge::RVNGInputStream> input);
+
+ virtual void parse(librevenge::RVNGTextInterface *documentInterface);
+
+private:
+ T602Header m_header;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=2 softtabstop=2 expandtab: */