Subversion Repositories HomeAutomation

Rev

Rev 1656 | Rev 1679 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1656 Rev 1657
Line 22... Line 22...
22
 
22
 
23
#include <v8-debug.h>
23
#include <v8-debug.h>
24
#include <stdio.h>
24
#include <stdio.h>
25
 
25
 
26
#include "vm/Manager.h"
26
#include "vm/Manager.h"
-
 
27
#include "common/common.h"
27
 
28
 
28
namespace atom {
29
namespace atom {
29
namespace vm {
30
namespace vm {
30
namespace plugin {
31
namespace plugin {
31
 
32
 
Line 35... Line 36...
35
{
36
{
36
    this->name_ = "system";
37
    this->name_ = "system";
37
   
38
   
38
    this->ExportFunction("Require",    System::Export_Require);
39
    this->ExportFunction("Require",    System::Export_Require);
39
    this->ExportFunction("Execute",    System::Export_Execute);
40
    this->ExportFunction("Execute",    System::Export_Execute);
-
 
41
    this->ExportFunction("ToHex",      System::Export_ToHex);
40
}
42
}
41
 
43
 
42
System::~System()
44
System::~System()
43
{
45
{
44
 
46
 
Line 110... Line 112...
110
    }
112
    }
111
   
113
   
112
    pclose(pipe);
114
    pclose(pipe);
113
   
115
   
114
    return v8::String::New(output_buffer.data());
116
    return v8::String::New(output_buffer.data());
-
 
117
}
-
 
118
 
-
 
119
Value System::Export_ToHex(const v8::Arguments& args)
-
 
120
{
-
 
121
    v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext());
-
 
122
   
-
 
123
    //LOG.Debug(std::string(__FUNCTION__) + " called!");
-
 
124
   
-
 
125
    if (args.Length() < 1)
-
 
126
    {
-
 
127
        LOG.Error(std::string(__FUNCTION__) + ": To few arguments.");
-
 
128
        return v8::Boolean::New(false);
-
 
129
    }
-
 
130
   
-
 
131
    return v8::String::New(common::ToHex(args[0]->Uint32Value()).data());
115
}
132
}
116
   
133
 
117
}; // namespace plugin
134
}; // namespace plugin
118
}; // namespace vm
135
}; // namespace vm
119
}; // namespace atom
136
}; // namespace atom