Rev 1604 | Rev 1609 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1604 | Rev 1608 | ||
|---|---|---|---|
| Line 32... | Line 32... | ||
| 32 | logging::Logger System::LOG("vm::plugin::System"); |
32 | logging::Logger System::LOG("vm::plugin::System"); |
| 33 | 33 | ||
| 34 | System::System() |
34 | System::System() |
| 35 | { |
35 | { |
| 36 | this->name_ = "system"; |
36 | this->name_ = "system"; |
| 37 | - | ||
| 38 | this->ImportFunction("Start"); |
- | |
| 39 | 37 | ||
| 40 | this->ExportFunction("Log", System::Export_Log); |
38 | this->ExportFunction("Log", System::Export_Log); |
| 41 | this->ExportFunction("LoadScript", System::Export_LoadScript); |
39 | this->ExportFunction("LoadScript", System::Export_LoadScript); |
| 42 | this->ExportFunction("Execute", System::Export_Execute); |
40 | this->ExportFunction("Execute", System::Export_Execute); |
| 43 | } |
41 | } |
| 44 | 42 | ||
| 45 | System::~System() |
43 | System::~System() |
| 46 | { |
44 | { |
| 47 | 45 | ||
| 48 | } |
46 | } |
| 49 | 47 | ||
| 50 | void System::InitializeDone() |
48 | void System::InitializeDone() |
| 51 | { |
49 | { |
| 52 | Plugin::InitializeDone(); |
50 | Plugin::InitializeDone(); |
| 53 | 51 | ||
| - | 52 | this->ImportFunction("Start"); |
|
| - | 53 | ||
| 54 | this->Call("Start", ArgumentListPointer(new ArgumentList)); |
54 | this->Call(0, "Start", ArgumentListPointer(new ArgumentList)); |
| 55 | } |
55 | } |
| 56 | 56 | ||
| 57 | Value System::Export_Log(const v8::Arguments& args) |
57 | Value System::Export_Log(const v8::Arguments& args) |
| 58 | { |
58 | { |
| 59 | if (args.Length() < 1) |
59 | if (args.Length() < 1) |
| Line 77... | Line 77... | ||
| 77 | LOG.Error("To few arguments."); |
77 | LOG.Error("To few arguments."); |
| 78 | } |
78 | } |
| 79 | 79 | ||
| 80 | v8::String::AsciiValue str(args[0]); |
80 | v8::String::AsciiValue str(args[0]); |
| 81 | 81 | ||
| 82 | return v8::Boolean::New(Manager::Instance()-> |
82 | return v8::Boolean::New(Manager::Instance()->LoadScript(*str)); |
| 83 | } |
83 | } |
| 84 | 84 | ||
| 85 | Value System::Export_Execute(const v8::Arguments& args) |
85 | Value System::Export_Execute(const v8::Arguments& args) |
| 86 | { |
86 | { |
| 87 | LOG.Debug(std::string(__FUNCTION__) + " called!"); |
87 | LOG.Debug(std::string(__FUNCTION__) + " called!"); |