summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-02-25 18:07:33 +0100
committerDavid Tardon <dtardon@redhat.com>2016-02-25 18:12:15 +0100
commit8f29d140538ca4a960fd563713d5bbe5c3543879 (patch)
tree6837e7f229c01e6e58f0ac125e98c2572399ec35
parent81698ba9c2c7d967d32bc1af9183a2b6d711b8b2 (diff)
add skeleton C602 parser
-rw-r--r--src/lib/C602Header.cpp31
-rw-r--r--src/lib/C602Header.h35
-rw-r--r--src/lib/C602Parser.cpp30
-rw-r--r--src/lib/C602Parser.h34
-rw-r--r--src/lib/Makefile.am4
5 files changed, 134 insertions, 0 deletions
diff --git a/src/lib/C602Header.cpp b/src/lib/C602Header.cpp
new file mode 100644
index 0000000..fd8df8d
--- /dev/null
+++ b/src/lib/C602Header.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 "C602Header.h"
+
+namespace libsw602
+{
+
+C602Header::C602Header()
+ : m_valid(false)
+{
+}
+
+void C602Header::construct(librevenge::RVNGInputStream &/*input*/)
+{
+}
+
+bool C602Header::isValid() const
+{
+ return m_valid;
+}
+
+} // namespace libsw602
+
+/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
diff --git a/src/lib/C602Header.h b/src/lib/C602Header.h
new file mode 100644
index 0000000..414213f
--- /dev/null
+++ b/src/lib/C602Header.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_C602HEADER_H
+#define INCLUDED_C602HEADER_H
+
+#include <librevenge-stream/librevenge-stream.h>
+
+namespace libsw602
+{
+
+class C602Header
+{
+public:
+ C602Header();
+
+ void construct(librevenge::RVNGInputStream &input);
+
+ bool isValid() const;
+
+private:
+ bool m_valid;
+};
+
+} // namespace libsw602
+
+#endif // INCLUDED_C602HEADER_H
+
+/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
diff --git a/src/lib/C602Parser.cpp b/src/lib/C602Parser.cpp
new file mode 100644
index 0000000..a06078f
--- /dev/null
+++ b/src/lib/C602Parser.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 "C602Parser.h"
+
+namespace libsw602
+{
+
+C602Parser::C602Parser(boost::shared_ptr<librevenge::RVNGInputStream> input)
+ : SW602SpreadsheetParser(input)
+ , m_header()
+{
+}
+
+void C602Parser::parse(librevenge::RVNGSpreadsheetInterface * /*documentInterface*/)
+{
+ m_header.construct(*getInput());
+ if (!m_header.isValid())
+ throw ParseException();
+}
+
+}
+
+/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
diff --git a/src/lib/C602Parser.h b/src/lib/C602Parser.h
new file mode 100644
index 0000000..e011ea1
--- /dev/null
+++ b/src/lib/C602Parser.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_C602_PARSER_H
+#define INCLUDED_C602_PARSER_H
+
+#include "C602Header.h"
+#include "SW602Parser.h"
+
+namespace libsw602
+{
+
+class C602Parser : public SW602SpreadsheetParser
+{
+public:
+ explicit C602Parser(boost::shared_ptr<librevenge::RVNGInputStream> input);
+
+ virtual void parse(librevenge::RVNGSpreadsheetInterface *documentInterface);
+
+private:
+ C602Header m_header;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index caa81e6..3944e68 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -12,6 +12,10 @@ libsw602_@SW602_MAJOR_VERSION@_@SW602_MINOR_VERSION@_la_LIBADD = $(REVENGE_LIBS
libsw602_@SW602_MAJOR_VERSION@_@SW602_MINOR_VERSION@_la_DEPENDENCIES = @LIBSW602_WIN32_RESOURCE@
libsw602_@SW602_MAJOR_VERSION@_@SW602_MINOR_VERSION@_la_LDFLAGS = $(version_info) -export-dynamic -no-undefined
libsw602_@SW602_MAJOR_VERSION@_@SW602_MINOR_VERSION@_la_SOURCES = \
+ C602Header.cpp \
+ C602Header.h \
+ C602Parser.cpp \
+ C602Parser.h \
SW602Cell.cpp \
SW602Cell.h \
SW602Chart.cpp \