summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2009-12-29 20:35:01 +0100
committerAndreas Baumann <abaumann@yahoo.com>2009-12-29 20:35:01 +0100
commitf96501285780ccbb47c1ac43133f12491f2e0410 (patch)
tree07062b1811be66d4f86dab7b233aa52afbb5d6d2
parent2073349325c7b216e43e9ea5f9cb89198b5d51b9 (diff)
downloadcrawler-f96501285780ccbb47c1ac43133f12491f2e0410.tar.gz
crawler-f96501285780ccbb47c1ac43133f12491f2e0410.tar.bz2
more reading and abstract interfacing
-rw-r--r--src/Crawler.cpp5
-rw-r--r--src/Frontier.hpp5
-rw-r--r--src/GNUmakefile6
-rw-r--r--src/HTTPFetcher.hpp4
-rw-r--r--src/Processor.hpp11
-rw-r--r--src/URL.hpp11
-rw-r--r--src/URLFilter.hpp11
-rw-r--r--src/Url.hpp7
8 files changed, 49 insertions, 11 deletions
diff --git a/src/Crawler.cpp b/src/Crawler.cpp
new file mode 100644
index 0000000..07bfd4b
--- /dev/null
+++ b/src/Crawler.cpp
@@ -0,0 +1,5 @@
+#include "Frontier.hpp"
+
+int main( void ) {
+ return 0;
+}
diff --git a/src/Frontier.hpp b/src/Frontier.hpp
index 1b7d6da..d21f773 100644
--- a/src/Frontier.hpp
+++ b/src/Frontier.hpp
@@ -1,9 +1,12 @@
#ifndef __FRONTIER_H
#define __FRONTIER_H
+#include "URL.hpp"
+
class Frontier {
public:
- virtual Url getNextUrl( ) = 0;
+ virtual URL getNextUrl( ) = 0;
+ virtual void addUrl( const URL &url ) = 0;
};
#endif
diff --git a/src/GNUmakefile b/src/GNUmakefile
index c73bca3..6b30e1d 100644
--- a/src/GNUmakefile
+++ b/src/GNUmakefile
@@ -2,13 +2,15 @@ TOPDIR = ..
SUBDIRS =
-INCLUDE_DIRS =
+INCLUDE_DIRS = \
+ -I.
INCLUDE_LDFLAGS =
INCLUDE_LIBS =
-CPP_BINS =
+CPP_BINS = \
+ Crawler$(EXE)
OBJS =
diff --git a/src/HTTPFetcher.hpp b/src/HTTPFetcher.hpp
index ae9f80e..3d8e051 100644
--- a/src/HTTPFetcher.hpp
+++ b/src/HTTPFetcher.hpp
@@ -1,7 +1,9 @@
#ifndef __HTTPFETCHER_H
#define __HTTPFETCHER_H
-class HTTPFetcher {
+#include <Fetcher.hpp>
+
+class HTTPFetcher : public Fetcher {
};
#endif
diff --git a/src/Processor.hpp b/src/Processor.hpp
new file mode 100644
index 0000000..6cbf667
--- /dev/null
+++ b/src/Processor.hpp
@@ -0,0 +1,11 @@
+#ifndef __PROCESSOR_H
+#define __PROCESSOR_H
+
+#include "RewindInputStream.hpp"
+
+class Processor {
+ public:
+ virtual process( RewindInputStream &s ) = 0;
+};
+
+#endif
diff --git a/src/URL.hpp b/src/URL.hpp
new file mode 100644
index 0000000..acdf5b7
--- /dev/null
+++ b/src/URL.hpp
@@ -0,0 +1,11 @@
+#ifndef __URL_H
+#define __URL_H
+
+#include <string>
+
+using namespace std;
+
+class URL : public string {
+};
+
+#endif
diff --git a/src/URLFilter.hpp b/src/URLFilter.hpp
new file mode 100644
index 0000000..3f7c59e
--- /dev/null
+++ b/src/URLFilter.hpp
@@ -0,0 +1,11 @@
+#ifndef __URLFILTER_H
+#define __URLFILTER_H
+
+#include "URL.hpp"
+
+class URLFilter {
+ public:
+ virtual filter( const URL &url ) = 0;
+};
+
+#endif
diff --git a/src/Url.hpp b/src/Url.hpp
deleted file mode 100644
index b6c009c..0000000
--- a/src/Url.hpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __URL_H
-#define __URL_H
-
-class Url {
-};
-
-#endif