summaryrefslogtreecommitdiffabout
path: root/include/sitecing/file_factory.h
authorMichael Krelin <hacker@klever.net>2005-01-29 21:21:05 (UTC)
committer Michael Krelin <hacker@klever.net>2005-01-29 21:21:05 (UTC)
commitce1f37aae46ea95020d7b865f7a80e8abdfad0d8 (patch) (side-by-side diff)
tree4964383ab8cd7e6d8ea821f1a615d1bbcf98dad8 /include/sitecing/file_factory.h
parent3c75c860fc1ad5b3f5185e23ec6f438dd2528958 (diff)
downloadsitecing-ce1f37aae46ea95020d7b865f7a80e8abdfad0d8.zip
sitecing-ce1f37aae46ea95020d7b865f7a80e8abdfad0d8.tar.gz
sitecing-ce1f37aae46ea95020d7b865f7a80e8abdfad0d8.tar.bz2
initial commit into repository0.0
Diffstat (limited to 'include/sitecing/file_factory.h') (more/less context) (ignore whitespace changes)
-rw-r--r--include/sitecing/file_factory.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/include/sitecing/file_factory.h b/include/sitecing/file_factory.h
new file mode 100644
index 0000000..7ec82da
--- a/dev/null
+++ b/include/sitecing/file_factory.h
@@ -0,0 +1,64 @@
+#ifndef __SITECING_FILE_FACTORY_H
+#define __SITECING_FILE_FACTORY_H
+
+#include <string>
+#include <list>
+
+/**
+ * @file
+ * @brief the file_factory class declaration.
+ */
+
+namespace sitecing {
+ using namespace std;
+
+ /**
+ * The factory class. Does the job similar to that which is done by make
+ * utility.
+ */
+ class file_factory {
+ public:
+ /**
+ * The recursion depth.
+ */
+ int depth;
+ /**
+ * The list of files type. The list of strings, in fact.
+ */
+ typedef list<string> file_list_t;
+
+ file_factory()
+ : depth(0) { }
+
+ /**
+ * Fetch depndencies for the given file.
+ * @param dst destination file.
+ * @param deps where to put dependencies to.
+ */
+ virtual void get_dependencies(const string& dst,file_list_t& deps) = 0;
+ /**
+ * Check if the destination is up to day.
+ * @param the destination file.
+ * @param deps if the deps pointer is non there, the dependencies
+ * retrieved will be stored there.
+ * @return true if yes.
+ * @see get_dependencies()
+ */
+ virtual bool is_uptodate(const string& dst,file_list_t* deps=0);
+ /**
+ * Build the file requested.
+ * @param dst the file requested.
+ */
+ virtual void build(const string& dst) = 0;
+ /**
+ * Make the file requested, which means: build it, unless it's
+ * uptodate.
+ * @see is_uptodate()
+ * @see build()
+ */
+ virtual void make(const string& dst);
+ };
+
+}
+
+#endif /* __SITECING_FILE_FACTORY_H */