author | Michael Krelin <hacker@klever.net> | 2005-01-29 21:21:05 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2005-01-29 21:21:05 (UTC) |
commit | ce1f37aae46ea95020d7b865f7a80e8abdfad0d8 (patch) (unidiff) | |
tree | 4964383ab8cd7e6d8ea821f1a615d1bbcf98dad8 /lib/acomponent.cc | |
parent | 3c75c860fc1ad5b3f5185e23ec6f438dd2528958 (diff) | |
download | sitecing-ce1f37aae46ea95020d7b865f7a80e8abdfad0d8.zip sitecing-ce1f37aae46ea95020d7b865f7a80e8abdfad0d8.tar.gz sitecing-ce1f37aae46ea95020d7b865f7a80e8abdfad0d8.tar.bz2 |
initial commit into repository0.0
-rw-r--r-- | lib/acomponent.cc | 47 |
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 @@ | |||
1 | #ifdef USE_PCH | ||
2 | #include "pch.h" | ||
3 | #else | ||
4 | #include <cstdarg> | ||
5 | #include <fstream> | ||
6 | #include <konforka/exception.h> | ||
7 | using namespace std; | ||
8 | #include "sitecing/acomponent.h" | ||
9 | #endif | ||
10 | |||
11 | namespace sitecing { | ||
12 | |||
13 | acomponent::acomponent() | ||
14 | : __SCIF(NULL) { | ||
15 | } | ||
16 | acomponent::~acomponent() { | ||
17 | } | ||
18 | |||
19 | void acomponent::__set_interface(sitecing_interface* scif) { | ||
20 | sitecing_interface *o = __SCIF; | ||
21 | __SCIF = scif; | ||
22 | if(o!=scif) { | ||
23 | __on_change_interface(o); | ||
24 | __do_imports(); | ||
25 | __on_imports(); | ||
26 | } | ||
27 | } | ||
28 | |||
29 | void acomponent::__on_change_interface(sitecing_interface *oscif) { } | ||
30 | void acomponent::__do_imports() { } | ||
31 | void acomponent::__on_imports() { } | ||
32 | |||
33 | void acomponent::run(int _magic,...) { | ||
34 | va_list va; | ||
35 | va_start(va,_magic); | ||
36 | main(_magic,va); | ||
37 | va_end(va); | ||
38 | } | ||
39 | |||
40 | |||
41 | void acomponent::pass_file_through(const char *fn) { | ||
42 | ifstream ifs(fn,ios::in|ios::binary); | ||
43 | if(!ifs) | ||
44 | throw konforka::exception(CODEPOINT,"failed to open file"); | ||
45 | (*(__SCIF->out)) << ifs.rdbuf(); | ||
46 | } | ||
47 | } | ||