p2ruby 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +27 -0
- data/HISTORY +7 -0
- data/LICENSE +20 -0
- data/README.rdoc +24 -0
- data/Rakefile +42 -0
- data/VERSION +1 -0
- data/bin/olegen.rb +368 -0
- data/features/p2ruby.feature +9 -0
- data/features/step_definitions/p2ruby_steps.rb +0 -0
- data/features/support/env.rb +10 -0
- data/features/support/world.rb +12 -0
- data/lib/extension.rb +19 -0
- data/lib/ole20110223-013209.rb +1677 -0
- data/lib/p2ruby/application.rb +111 -0
- data/lib/p2ruby/base.rb +59 -0
- data/lib/p2ruby/connection.rb +250 -0
- data/lib/p2ruby/data_stream.rb +215 -0
- data/lib/p2ruby/library.rb +24 -0
- data/lib/p2ruby/message.rb +150 -0
- data/lib/p2ruby/message_factory.rb +70 -0
- data/lib/p2ruby/record.rb +104 -0
- data/lib/p2ruby/router.rb +45 -0
- data/lib/p2ruby/table_set.rb +166 -0
- data/lib/p2ruby.rb +156 -0
- data/lib/version.rb +8 -0
- data/lib/win32ole-pr.rb +5540 -0
- data/spec/encoding_spec.rb +15 -0
- data/spec/p2ruby/application_spec.rb +35 -0
- data/spec/p2ruby/connection_spec.rb +293 -0
- data/spec/p2ruby/data_stream_spec.rb +218 -0
- data/spec/p2ruby/library_spec.rb +42 -0
- data/spec/p2ruby/message_factory_spec.rb +69 -0
- data/spec/p2ruby/message_spec.rb +159 -0
- data/spec/p2ruby/record_spec.rb +85 -0
- data/spec/p2ruby/router_spec.rb +54 -0
- data/spec/p2ruby/table_set_spec.rb +132 -0
- data/spec/p2ruby_spec.rb +46 -0
- data/spec/spec_helper.rb +78 -0
- data/tasks/common.rake +18 -0
- data/tasks/doc.rake +14 -0
- data/tasks/gem.rake +40 -0
- data/tasks/git.rake +34 -0
- data/tasks/spec.rake +16 -0
- data/tasks/version.rake +71 -0
- metadata +149 -0
@@ -0,0 +1,150 @@
|
|
1
|
+
module P2
|
2
|
+
# Represents P2 Message
|
3
|
+
# ������ ������������ ��� �������� ���������. ��� ���� �� ��������� ��� �������� ���������
|
4
|
+
# ����������� �� ������ ������ ��������� �� ��������� (�������� � P2ClientGate.ini),
|
5
|
+
# � ������������� ����� ������� ���������, ����������� �� ��������� ������.
|
6
|
+
# ���� ��������� ������������ ������ ����� ���������, ������� ��� ������������� �������
|
7
|
+
# ������� ���������������� ini-����, ���������� ����� �����.
|
8
|
+
#
|
9
|
+
class Message < Base
|
10
|
+
CLSID = '{A9A6C936-5A12-4518-9A92-90D75B41AF18}'
|
11
|
+
PROGID = 'P2ClientGate.P2BLMessage.1'
|
12
|
+
|
13
|
+
def initialize opts = {}
|
14
|
+
super opts
|
15
|
+
end
|
16
|
+
|
17
|
+
# analyses message as a server reply, returns result text
|
18
|
+
def parse_reply(encode = nil)
|
19
|
+
category = self.Field["P2_Category"]
|
20
|
+
type = self.Field["P2_Type"]
|
21
|
+
|
22
|
+
res = "Reply category: #{category}, type #{type}. " +
|
23
|
+
if category == "FORTS_MSG" && type == 101
|
24
|
+
code = self.Field["code"]
|
25
|
+
if code == 0
|
26
|
+
"Adding order Ok, Order_id: #{self.Field["order_id"]}."
|
27
|
+
else
|
28
|
+
"Adding order fail, logic error: #{self.Field["message"]}"
|
29
|
+
end
|
30
|
+
elsif category == "FORTS_MSG" && type == 100
|
31
|
+
"Adding order fail, system level error: " +
|
32
|
+
"#{self.Field["code"]} #{self.Field["message"]}"
|
33
|
+
else
|
34
|
+
"Unexpected MQ message recieved."
|
35
|
+
end
|
36
|
+
|
37
|
+
if encode
|
38
|
+
res.force_encoding('IBM866').encode(encode, :undef => :replace)
|
39
|
+
else
|
40
|
+
res
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# Auto-generated OLE methods:
|
45
|
+
|
46
|
+
# property BSTR Name
|
47
|
+
# ��� ��������� - �������� ini-�����
|
48
|
+
def Name()
|
49
|
+
@ole._getproperty(1, [], [])
|
50
|
+
end
|
51
|
+
|
52
|
+
# property UI4 Id
|
53
|
+
def Id()
|
54
|
+
@ole._getproperty(2, [], [])
|
55
|
+
end
|
56
|
+
|
57
|
+
# property BSTR Version
|
58
|
+
def Version()
|
59
|
+
@ole._getproperty(3, [], [])
|
60
|
+
end
|
61
|
+
|
62
|
+
# property BSTR DestAddr
|
63
|
+
# ����� ����������.
|
64
|
+
def DestAddr()
|
65
|
+
@ole._getproperty(4, [], [])
|
66
|
+
end
|
67
|
+
|
68
|
+
# property VOID DestAddr
|
69
|
+
# ����� ����������.
|
70
|
+
def DestAddr=(val)
|
71
|
+
@ole._setproperty(4, [val], [VT_BSTR])
|
72
|
+
end
|
73
|
+
|
74
|
+
# property VARIANT Field
|
75
|
+
# ��������, ����������� ���� ���������. ��� ��������� �� ����� ���� ��������
|
76
|
+
# ��� ������ ��� ��������. � ����������� ��������� �������������� ��������� ����:
|
77
|
+
# ? P2_From � ��������� ���� � ����������� ���������.
|
78
|
+
# ? P2_To � ��������� ���� � ���������� ���������.
|
79
|
+
# ? P2_Type � ������ ����� � ��� ���������.
|
80
|
+
# ? P2_SendId � ������ ���� � ������������� ���������� ���������.
|
81
|
+
# ? P2_ReplyId � ������ ���� � ������ �� ������������� ������������� ���������.
|
82
|
+
# ? P2_Category � ��������� ���� � ��������� ���������.
|
83
|
+
# ? P2_Body � ���� ���������� ����� � ���� ���������.
|
84
|
+
# ������������ ����� ��������� ���� ���� � ���������.
|
85
|
+
# � ��������� ���� ����� ���������� ��� � ���� ���������, ��������, ����������������
|
86
|
+
# � ���������������� ����, ��� � ���������� �� ����� � ���� Body. ����� ���������
|
87
|
+
# �������� � ini-����� (�� ��������� P2ClientGate.ini). �� ��������� ����� ���������
|
88
|
+
# ������ ��� ����� �� � ������ message. ����� ��������� ������������� ���������
|
89
|
+
# ������, ������������� � �����. ��� �������� ����� ��������� ������������� �����������
|
90
|
+
# �������� �������� ���� �� ���������. �������� �� ��������� ������������� �������������
|
91
|
+
# � ��������� ��� ��� ��������. ��� ��������� �� �������� ������ ��� ��� ���� ���������.
|
92
|
+
# ������ ��������: field=<��� ����>,<���>,,<�������� �� ���������>.
|
93
|
+
# BSTR name [IN]
|
94
|
+
def Field
|
95
|
+
@_Field ||= OLEProperty.new(@ole, 5, [VT_BSTR], [VT_BSTR, VT_VARIANT])
|
96
|
+
end
|
97
|
+
|
98
|
+
# I8 FieldAsLONGLONG: property FieldAsULONGLONG
|
99
|
+
# ������ �������� ����, ����������������� � LONGLONG � ��������� ������� ��������.
|
100
|
+
# ������� ��� ����� ���� u1, u2, u4, u8, i1, i2, i4, i8, a, d, s, t, f.
|
101
|
+
# BSTR name [IN]
|
102
|
+
def FieldAsLONGLONG
|
103
|
+
@_FieldAsLONGLONG ||= OLEProperty.new(@ole, 10, [VT_BSTR], [VT_BSTR, VT_I8])
|
104
|
+
end
|
105
|
+
|
106
|
+
# method IP2BLMessage Send
|
107
|
+
# �������� ��������� ���� Send.
|
108
|
+
# IP2Connection conn [IN]
|
109
|
+
# UI4 timeout [IN]
|
110
|
+
# [out,retval] IP2BLMessage** reply);
|
111
|
+
def Send(conn, timeout)
|
112
|
+
conn = conn.respond_to?(:ole) ? conn.ole : conn
|
113
|
+
reply = @ole._invoke(6, [conn, timeout], [VT_BYREF|VT_DISPATCH, VT_UI4])
|
114
|
+
P2::Message.new :ole => reply
|
115
|
+
end
|
116
|
+
|
117
|
+
# method VOID Post
|
118
|
+
# �������� ��������� ���� Post.
|
119
|
+
# IP2Connection conn [IN]
|
120
|
+
def Post(conn)
|
121
|
+
@ole._invoke(7, [conn], [VT_BYREF|VT_DISPATCH])
|
122
|
+
end
|
123
|
+
|
124
|
+
# method VOID SendAsync
|
125
|
+
# ����������� �������� ��������� ���� Send (��� ���������� ������).
|
126
|
+
# � conn � ��������� �� ��������� ����������;
|
127
|
+
# � timeout � ������� � �������������, � ������� �������� ��������� �������� ���������;
|
128
|
+
# � event � ��������� �� ��������� ��������� ������ (��������� IP2AsyncMessageEvents).
|
129
|
+
# IP2Connection conn [IN]
|
130
|
+
# UI4 timeout [IN]
|
131
|
+
# DISPATCH event [IN]
|
132
|
+
def SendAsync(conn, timeout, event)
|
133
|
+
@ole._invoke(8, [conn, timeout, event], [VT_BYREF|VT_DISPATCH, VT_UI4, VT_DISPATCH])
|
134
|
+
end
|
135
|
+
|
136
|
+
# method VOID SendAsync2
|
137
|
+
# ����������� �������� ��������� ���� Send. ������� � ���������� � ������ SendAsync.
|
138
|
+
# � ��� ������������ ������ ��������� ��������� ������ (��������� IP2AsyncSendEvent2),
|
139
|
+
# � ����� ���������� �������������� ��������, ��� ��������� ������� ���� ����������
|
140
|
+
# �� ��������� ���������.
|
141
|
+
# IP2Connection conn [IN]
|
142
|
+
# UI4 timeout [IN]
|
143
|
+
# DISPATCH event [IN]
|
144
|
+
# I8 event_param [IN]
|
145
|
+
def SendAsync2(conn, timeout, event, event_param)
|
146
|
+
@ole._invoke(9, [conn, timeout, event, event_param], [VT_BYREF|VT_DISPATCH, VT_UI4, VT_DISPATCH, VT_I8])
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end # module P2
|
150
|
+
|
@@ -0,0 +1,70 @@
|
|
1
|
+
module P2
|
2
|
+
# Represents P2 Message Factory
|
3
|
+
# ������ ������������ ��� �������� ���������. ��� ���� �� ��������� ��� �������� ���������
|
4
|
+
# ����������� �� ������ ������ ��������� �� ��������� (�������� � P2ClientGate.ini),
|
5
|
+
# � ������������� ����� ������� ���������, ����������� �� ��������� ������.
|
6
|
+
# ���� ��������� ������������ ������ ����� ���������, ������� ��� ������������� �������
|
7
|
+
# ������� ���������������� ini-����, ���������� ����� �����.
|
8
|
+
#
|
9
|
+
class MessageFactory < Base
|
10
|
+
CLSID = '{501786DA-CA02-45C1-B815-1C58C383265D}'
|
11
|
+
PROGID = 'P2ClientGate.P2BLMessageFactory.1'
|
12
|
+
|
13
|
+
def initialize opts = {}
|
14
|
+
# # First we need to obtain Application instance... Yes, it IS freaking weird.
|
15
|
+
error "Connection/Application should be created first" unless P2::Application.instance
|
16
|
+
|
17
|
+
@ini = Pathname(opts[:ini] || "./p2fortsgate_messages.ini")
|
18
|
+
error "Wrong ini file name" unless @ini.expand_path.exist?
|
19
|
+
|
20
|
+
super opts
|
21
|
+
|
22
|
+
@ole.Init @ini.to_s, "Not used"
|
23
|
+
end
|
24
|
+
|
25
|
+
# Creates wrapped OLE Message object (by name or options Hash)
|
26
|
+
def message *args
|
27
|
+
case args.size
|
28
|
+
when 1
|
29
|
+
if args.last.is_a? Hash
|
30
|
+
opts = args.last
|
31
|
+
name = opts[:name]
|
32
|
+
else
|
33
|
+
opts = {}
|
34
|
+
name = args.last
|
35
|
+
end
|
36
|
+
when 2
|
37
|
+
opts = args.last
|
38
|
+
name = args.first
|
39
|
+
else
|
40
|
+
raise ArgumentError.new
|
41
|
+
end
|
42
|
+
message = name ? CreateMessageByName(name) : CreateMessageById(opts[:id])
|
43
|
+
P2::Message.new opts.merge(:ole => message)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Auto-generated OLE methods:
|
47
|
+
|
48
|
+
# method VOID Init - ������������� �������.
|
49
|
+
# BSTR struct_file [IN] � ����, ���������� ����� ���������.
|
50
|
+
# BSTR sign_file [IN] � �� ������������.
|
51
|
+
def Init(struct_file, sign_file)
|
52
|
+
@ole._invoke(1, [struct_file, sign_file], [VT_BSTR, VT_BSTR])
|
53
|
+
end
|
54
|
+
|
55
|
+
# method IP2BLMessage CreateMessageByName - �������� ��������� �� �����.
|
56
|
+
# !!! creates raw (unwrapped) OLE message objects
|
57
|
+
# BSTR msg_name [IN]
|
58
|
+
# [out,retval] IP2BLMessage** newMsg)
|
59
|
+
def CreateMessageByName(msg_name)
|
60
|
+
@ole._invoke(2, [msg_name], [VT_BSTR])
|
61
|
+
end
|
62
|
+
|
63
|
+
# method IP2BLMessage CreateMessageById
|
64
|
+
# UI4 msg_id [IN]
|
65
|
+
def CreateMessageById(msg_id)
|
66
|
+
@ole._invoke(3, [msg_id], [VT_UI4])
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
end # module P2
|
@@ -0,0 +1,104 @@
|
|
1
|
+
module P2
|
2
|
+
|
3
|
+
# Represents single Table Record.
|
4
|
+
# ������ ������������ ��� ������ � ��������.
|
5
|
+
#
|
6
|
+
class Record < Base
|
7
|
+
CLSID = '{76033FC9-8BB0-4415-A785-9BF86AAF4E99}'
|
8
|
+
PROGID = nil
|
9
|
+
|
10
|
+
include Enumerable
|
11
|
+
|
12
|
+
def initialize opts = {}
|
13
|
+
super opts
|
14
|
+
end
|
15
|
+
|
16
|
+
# Record text representation
|
17
|
+
def to_s
|
18
|
+
each.join '|' || ''
|
19
|
+
end
|
20
|
+
|
21
|
+
# Access Record's fields by either name or index, encoding is
|
22
|
+
# converted to Windows-1251
|
23
|
+
def [] id
|
24
|
+
case id
|
25
|
+
when Integer
|
26
|
+
GetValAsStringByIndex(id)
|
27
|
+
else
|
28
|
+
GetValAsString(id.to_s)
|
29
|
+
end.force_encoding('IBM866').encode('CP1251', :undef => :replace)
|
30
|
+
end
|
31
|
+
|
32
|
+
# Yields all fields (basis for mixed in Enumerable methods)
|
33
|
+
def each
|
34
|
+
if block_given?
|
35
|
+
(0...Count()).each { |i| yield self[i] }
|
36
|
+
else
|
37
|
+
(0...Count()).map { |i| self[i] }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# Auto-generated OLE methods:
|
42
|
+
|
43
|
+
# property UI4 Count
|
44
|
+
def Count()
|
45
|
+
_getproperty(1, [], [])
|
46
|
+
end
|
47
|
+
|
48
|
+
# method BSTR GetValAsString
|
49
|
+
# BSTR field_name [IN]
|
50
|
+
def GetValAsString(field_name)
|
51
|
+
_invoke(2, [field_name], [VT_BSTR])
|
52
|
+
end
|
53
|
+
|
54
|
+
# method BSTR GetValAsStringByIndex
|
55
|
+
# UI4 field_index [IN]
|
56
|
+
def GetValAsStringByIndex(field_index)
|
57
|
+
_invoke(3, [field_index], [VT_UI4])
|
58
|
+
end
|
59
|
+
|
60
|
+
# method I4 GetValAsLong
|
61
|
+
# BSTR field_name [IN]
|
62
|
+
def GetValAsLong(field_name)
|
63
|
+
_invoke(4, [field_name], [VT_BSTR])
|
64
|
+
end
|
65
|
+
|
66
|
+
# method I4 GetValAsLongByIndex
|
67
|
+
# UI4 field_index [IN]
|
68
|
+
def GetValAsLongByIndex(field_index)
|
69
|
+
_invoke(5, [field_index], [VT_UI4])
|
70
|
+
end
|
71
|
+
|
72
|
+
# method I2 GetValAsShort
|
73
|
+
# BSTR field_name [IN]
|
74
|
+
def GetValAsShort(field_name)
|
75
|
+
_invoke(6, [field_name], [VT_BSTR])
|
76
|
+
end
|
77
|
+
|
78
|
+
# method I2 GetValAsShortByIndex
|
79
|
+
# UI4 field_index [IN]
|
80
|
+
def GetValAsShortByIndex(field_index)
|
81
|
+
_invoke(7, [field_index], [VT_UI4])
|
82
|
+
end
|
83
|
+
|
84
|
+
# method VARIANT GetValAsVariant
|
85
|
+
# BSTR field_name [IN]
|
86
|
+
def GetValAsVariant(field_name)
|
87
|
+
_invoke(8, [field_name], [VT_BSTR])
|
88
|
+
end
|
89
|
+
|
90
|
+
# method VARIANT GetValAsVariantByIndex
|
91
|
+
# UI4 field_index [IN]
|
92
|
+
def GetValAsVariantByIndex(field_index)
|
93
|
+
_invoke(9, [field_index], [VT_UI4])
|
94
|
+
end
|
95
|
+
|
96
|
+
# HRESULT GetRec
|
97
|
+
# OLE_HANDLE p_val [OUT]
|
98
|
+
def GetRec(p_val)
|
99
|
+
keep_lastargs _invoke(1610678272, [p_val], [VT_BYREF|VT_BYREF|VT_DISPATCH])
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end # module P2
|
103
|
+
|
104
|
+
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module P2
|
2
|
+
# Represents external Driver for P2 Router server app
|
3
|
+
class Router
|
4
|
+
ROUTER_TITLE = Regexp.new('P2MQRouter - ')
|
5
|
+
include P2
|
6
|
+
|
7
|
+
def self.find
|
8
|
+
router = WinGui::App.find :title => ROUTER_TITLE
|
9
|
+
router ? new(:app => router) : nil
|
10
|
+
end
|
11
|
+
|
12
|
+
attr_reader :opts, :app
|
13
|
+
|
14
|
+
def initialize opts = {}
|
15
|
+
@opts = opts.dup
|
16
|
+
if @opts[:app]
|
17
|
+
@app = @opts[:app]
|
18
|
+
else
|
19
|
+
@opts[:ini] = Pathname(@opts[:ini] || @opts[:ini_file] || "./client_router.ini")
|
20
|
+
error "Wrong ini file name" unless @opts[:ini].expand_path.exist? || @opts[:args]
|
21
|
+
|
22
|
+
@opts[:title] ||= ROUTER_TITLE
|
23
|
+
@opts[:path] ||= @opts[:dir] && @opts[:dir] + 'P2MQRouter.exe'
|
24
|
+
@opts[:args] ||= "/ini:#{@opts[:ini]}"
|
25
|
+
@opts[:timeout] ||= 3
|
26
|
+
|
27
|
+
@app = WinGui::App.launch(:dir => @opts[:dir],
|
28
|
+
:path => @opts[:path],
|
29
|
+
:args => @opts[:args],
|
30
|
+
:title => @opts[:title],
|
31
|
+
:timeout => @opts[:timeout])
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def method_missing *args
|
36
|
+
@app.send *args
|
37
|
+
end
|
38
|
+
|
39
|
+
def title
|
40
|
+
@app.main_window.title
|
41
|
+
end
|
42
|
+
|
43
|
+
end # class Router
|
44
|
+
end # module P2
|
45
|
+
|
@@ -0,0 +1,166 @@
|
|
1
|
+
module P2
|
2
|
+
|
3
|
+
# Represents TableSet.
|
4
|
+
# ������ ������������ ��� ������ � ���������� ������ ����������.
|
5
|
+
# ������ TableSet �������� ���� ������������ ��������� � IP2TableSet.
|
6
|
+
# ������ ������ ������������ ����������� ���������� ������������ � ���.
|
7
|
+
#
|
8
|
+
class TableSet < Base
|
9
|
+
CLSID = '{C52E4892-894B-4C03-841F-97E893F7BCAE}'
|
10
|
+
PROGID = 'P2ClientGate.P2TableSet.1'
|
11
|
+
|
12
|
+
# include Enumerable
|
13
|
+
|
14
|
+
def initialize opts = {}
|
15
|
+
super(opts) do
|
16
|
+
if opts[:ini] && opts[:scheme]
|
17
|
+
InitFromIni2(opts[:ini], opts[:scheme])
|
18
|
+
elsif opts[:ini]
|
19
|
+
InitFromIni(opts[:ini], '')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# # Record text representation
|
25
|
+
# def to_s
|
26
|
+
# each.join '|' || ''
|
27
|
+
# end
|
28
|
+
#
|
29
|
+
# # Access Record's fields by either name or index, encoding is
|
30
|
+
# # converted to Windows-1251
|
31
|
+
# def [] id
|
32
|
+
# case id
|
33
|
+
# when Integer
|
34
|
+
# GetValAsStringByIndex(id)
|
35
|
+
# else
|
36
|
+
# GetValAsString(id.to_s)
|
37
|
+
# end.force_encoding('IBM866').encode('CP1251', :undef => :replace)
|
38
|
+
# end
|
39
|
+
#
|
40
|
+
# # Yields all fields (basis for mixed in Enumerable methods)
|
41
|
+
# def each
|
42
|
+
# if block_given?
|
43
|
+
# (0...Count()).each { |i| yield self[i] }
|
44
|
+
# else
|
45
|
+
# (0...Count()).map { |i| self[i] }
|
46
|
+
# end
|
47
|
+
# end
|
48
|
+
#
|
49
|
+
|
50
|
+
# Auto-generated OLE methods:
|
51
|
+
|
52
|
+
# property I4 Count - ��������� ����� ������, ������������ � ����� ����������.
|
53
|
+
def Count()
|
54
|
+
@ole._getproperty(7, [], [])
|
55
|
+
end
|
56
|
+
|
57
|
+
# property I4 LifeNum � ����� ����� ����� ���� ������.
|
58
|
+
def LifeNum()
|
59
|
+
@ole._getproperty(11, [], [])
|
60
|
+
end
|
61
|
+
|
62
|
+
# property VOID LifeNum � ����� ����� ����� ���� ������.
|
63
|
+
def LifeNum=(val)
|
64
|
+
@ole._setproperty(11, [val], [VT_I4])
|
65
|
+
end
|
66
|
+
|
67
|
+
# property BSTR FieldList
|
68
|
+
# ����� ����� �� �������� �������. ��������� ��� ������� ����� �������� ������,
|
69
|
+
# � ������� ������������� ��� ���� � ���� �������.
|
70
|
+
# BSTR table_name [IN]
|
71
|
+
def FieldList
|
72
|
+
@_FieldList ||= OLEProperty.new(@ole, 4, [VT_BSTR], [VT_BSTR, VT_BSTR])
|
73
|
+
end
|
74
|
+
|
75
|
+
# I8 rev: property Rev
|
76
|
+
# ������������ �������� ���������� ���� rev (revision) � �������. ���� rev �
|
77
|
+
# ������������� ��������� ������ � �������. ������ ������������� ������������
|
78
|
+
# ��� ������������ ��������������� ������ � ��������� �� � ���������� �����.
|
79
|
+
# ��������� ����� rev �������� �������� � ������ ����� �������. ��� ��������
|
80
|
+
# � ��������� ������ ���� rev ������������� ��������, ������� �������������
|
81
|
+
# �������� ���� rev � �������.
|
82
|
+
#
|
83
|
+
# �������� ���������, ��� ������ ���� ��������, ��� � �������� ���. �����������
|
84
|
+
# �������� �������� ��������� ������������ ��������� ������ �� ��������� ������,
|
85
|
+
# ������� � ������������ �������� ���������. ��� ����� ������� � ������ ��������
|
86
|
+
# ��� ��������� ������ ������ �������� ���������, � ����� ���������� ������ TableSet
|
87
|
+
# � IP2DataStream ��� �������� ������ ������. � ��������� ��������� ��������, �
|
88
|
+
# ������� �������� ��������� �������� � �������, ������� �������� ��� �����������
|
89
|
+
# �������.
|
90
|
+
#
|
91
|
+
# BSTR table_name [IN]
|
92
|
+
def Rev
|
93
|
+
@_rev ||= OLEProperty.new(@ole, 5, [VT_BSTR], [VT_BSTR, VT_I8])
|
94
|
+
end
|
95
|
+
|
96
|
+
alias rev Rev
|
97
|
+
|
98
|
+
# property BSTR FieldTypes
|
99
|
+
# ???????? Not documected.............
|
100
|
+
# BSTR table_name [IN]
|
101
|
+
def FieldTypes
|
102
|
+
@_FieldTypes ||= OLEProperty.new(@ole, 9, [VT_BSTR], [VT_BSTR, VT_BSTR])
|
103
|
+
end
|
104
|
+
|
105
|
+
# method VOID InitFromIni
|
106
|
+
# ������������� ������� � �������� �� ini-����� ���������� ����� ����������.
|
107
|
+
# ��� ����� (CustReplScheme) ������ ������� � ����. ���� ������������ ���������
|
108
|
+
# �����, �� �������� ���������� ����� �� ���������.
|
109
|
+
#
|
110
|
+
# BSTR struct_file [IN] � ����, ���������� ���������� ����� ����������.
|
111
|
+
# BSTR sign_file [IN] � �� ������������.
|
112
|
+
def InitFromIni(struct_file, sign_file)
|
113
|
+
@ole._invoke(1, [struct_file.to_s, sign_file.to_s], [VT_BSTR, VT_BSTR])
|
114
|
+
end
|
115
|
+
|
116
|
+
# method VOID InitFromIni2
|
117
|
+
# ������������� ������� � �������� �� ini-����� ���������� ����� ����������.
|
118
|
+
# � ������� �� ������ InitFromIni ������ ������� ��������� ������� � �����
|
119
|
+
# ini-����� ��������� ���� ��� ������ ������� ���������� � �����������
|
120
|
+
# ����������� ������ ���� �����.
|
121
|
+
#
|
122
|
+
# BSTR ini_file_name [IN] � ����, ���������� ���������� ����� ����������.
|
123
|
+
# BSTR scheme_name [IN] � ��� ���������� ����� ����������.
|
124
|
+
def InitFromIni2(ini_file_name, scheme_name)
|
125
|
+
@ole._invoke(10, [ini_file_name.to_s, scheme_name.to_s], [VT_BSTR, VT_BSTR])
|
126
|
+
end
|
127
|
+
|
128
|
+
# method VOID InitFromDB
|
129
|
+
# BSTR connect_string [IN]
|
130
|
+
# BSTR sign_file [IN]
|
131
|
+
def InitFromDB(connect_string, sign_file)
|
132
|
+
@ole._invoke(2, [connect_string.to_s, sign_file.to_s], [VT_BSTR, VT_BSTR])
|
133
|
+
end
|
134
|
+
|
135
|
+
# method VOID SetLifeNumToIni - ���������� ������ ����� ����� � ��� �����.
|
136
|
+
# BSTR ini_file_name [IN] � ����, ���������� ���������� ����� ����������.
|
137
|
+
def SetLifeNumToIni(ini_file_name)
|
138
|
+
@ole._invoke(12, [ini_file_name.to_s], [VT_BSTR])
|
139
|
+
end
|
140
|
+
|
141
|
+
# method VOID AddTable
|
142
|
+
# BSTR table_name [IN]
|
143
|
+
# BSTR fieldl_list [IN]
|
144
|
+
# UI8 rev [IN]
|
145
|
+
def AddTable(table_name, fieldl_list, rev)
|
146
|
+
@ole._invoke(3, [table_name, fieldl_list, rev], [VT_BSTR, VT_BSTR, VT_UI8])
|
147
|
+
end
|
148
|
+
|
149
|
+
# method VOID DeleteTable
|
150
|
+
# BSTR table_name [IN]
|
151
|
+
def DeleteTable(table_name)
|
152
|
+
@ole._invoke(6, [table_name], [VT_BSTR])
|
153
|
+
end
|
154
|
+
|
155
|
+
def NewEnum
|
156
|
+
@ole._invoke(8, [], [])
|
157
|
+
end
|
158
|
+
|
159
|
+
# HRESULT GetScheme
|
160
|
+
# OLE_HANDLE p_val [OUT]
|
161
|
+
def GetScheme(p_val)
|
162
|
+
keep_lastargs @ole._invoke(1610678272, [p_val], [VT_BYREF|VT_BYREF|VT_DISPATCH])
|
163
|
+
end
|
164
|
+
|
165
|
+
end
|
166
|
+
end # module P2
|