Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/dvi/dvilib/dl-loader.hh
diff options
context:
space:
mode:
authorSøren Sandmann <sandmann@redhat.com>2004-12-21 23:57:26 (GMT)
committer Søren Sandmann Pedersen <ssp@src.gnome.org>2004-12-21 23:57:26 (GMT)
commit4296951e94a43c723e9522b588cab178eb66d144 (patch)
tree63ba229741d10df67fe87f24b6241903e16e9764 /dvi/dvilib/dl-loader.hh
parent3e73e947a3a8c03da8f35f52e2a42ba066e2be2a (diff)
New directory with the beginning of a .dvi backend.
Tue Dec 21 18:55:06 2004 Søren Sandmann <sandmann@redhat.com> * dvi/*: New directory with the beginning of a .dvi backend.
Diffstat (limited to 'dvi/dvilib/dl-loader.hh')
-rwxr-xr-xdvi/dvilib/dl-loader.hh59
1 files changed, 59 insertions, 0 deletions
diff --git a/dvi/dvilib/dl-loader.hh b/dvi/dvilib/dl-loader.hh
new file mode 100755
index 0000000..f0ac956
--- /dev/null
+++ b/dvi/dvilib/dl-loader.hh
@@ -0,0 +1,59 @@
+#ifndef DL_LOADER_HH
+#define DL_LOADER_HH
+
+#include <string>
+#include <cstdio>
+#include <vector>
+
+#include "dl-refcounted.hh"
+
+namespace DviLib {
+
+ class AbstractLoader : public RefCounted {
+ public:
+ virtual int get_uint8 () = 0;
+ virtual int get_uint16 ();
+ virtual int get_uint24 ();
+ virtual int get_uint32 ();
+
+ virtual int get_int8 () = 0;
+ virtual int get_int16 ();
+ virtual int get_int24 ();
+ virtual int get_int32 ();
+
+ virtual string get_string8 ();
+ virtual string get_string16 ();
+ virtual string get_string24 ();
+ virtual string get_string32 ();
+
+ virtual void skip_string8 ();
+ virtual void skip_string16 ();
+ virtual void skip_string24 ();
+ virtual void skip_string32 ();
+
+ virtual void goto_from_start (int i) = 0;
+ virtual void goto_from_end (int i) = 0;
+ virtual void goto_from_current (int i) = 0;
+
+ virtual void skip_n (int n);
+ virtual string get_n (int n);
+ virtual void get_n (int n, unsigned char *v);
+
+ virtual ~AbstractLoader() {};
+ };
+
+ class FileLoader : public AbstractLoader {
+ FILE *f;
+ string filename;
+ public:
+ FileLoader (const string &name);
+ virtual int get_int8 ();
+ virtual int get_uint8 ();
+ virtual void goto_from_start (int i);
+ virtual void goto_from_end (int i);
+ virtual void goto_from_current (int i);
+
+ virtual ~FileLoader ();
+ };
+}
+#endif // DL_LOADER_HH