summaryrefslogtreecommitdiffabout
path: root/lib/acomponent.cc
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 /lib/acomponent.cc
parent3c75c860fc1ad5b3f5185e23ec6f438dd2528958 (diff)
downloadsitecing-ce1f37aae46ea95020d7b865f7a80e8abdfad0d8.zip
sitecing-ce1f37aae46ea95020d7b865f7a80e8abdfad0d8.tar.gz
sitecing-ce1f37aae46ea95020d7b865f7a80e8abdfad0d8.tar.bz2
initial commit into repository0.0
Diffstat (limited to 'lib/acomponent.cc') (more/less context) (show whitespace changes)
-rw-r--r--lib/acomponent.cc47
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/acomponent.cc b/lib/acomponent.cc
new file mode 100644
index 0000000..8dfeee4
--- a/dev/null
+++ b/lib/acomponent.cc
@@ -0,0 +1,47 @@
+#ifdef USE_PCH
+ #include "pch.h"
+#else
+ #include <cstdarg>
+ #include <fstream>
+ #include <konforka/exception.h>
+ using namespace std;
+ #include "sitecing/acomponent.h"
+#endif
+
+namespace sitecing {
+
+ acomponent::acomponent()
+ : __SCIF(NULL) {
+ }
+ acomponent::~acomponent() {
+ }
+
+ void acomponent::__set_interface(sitecing_interface* scif) {
+ sitecing_interface *o = __SCIF;
+ __SCIF = scif;
+ if(o!=scif) {
+ __on_change_interface(o);
+ __do_imports();
+ __on_imports();
+ }
+ }
+
+ void acomponent::__on_change_interface(sitecing_interface *oscif) { }
+ void acomponent::__do_imports() { }
+ void acomponent::__on_imports() { }
+
+ void acomponent::run(int _magic,...) {
+ va_list va;
+ va_start(va,_magic);
+ main(_magic,va);
+ va_end(va);
+ }
+
+
+ void acomponent::pass_file_through(const char *fn) {
+ ifstream ifs(fn,ios::in|ios::binary);
+ if(!ifs)
+ throw konforka::exception(CODEPOINT,"failed to open file");
+ (*(__SCIF->out)) << ifs.rdbuf();
+ }
+}