-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update readme.md
- Loading branch information
Showing
10 changed files
with
148 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,14 @@ | |
</CommandLineArgument> | ||
<CommandLineArgument | ||
argument = "Connect demo.dxfeed.com:7300 TimeAndSale "ipf[https://demo:[email protected]/ipf?TYPE=STOCK&compression=zip],APPL" -p monitoring.stat=1s" | ||
isEnabled = "NO"> | ||
</CommandLineArgument> | ||
<CommandLineArgument | ||
argument = "qds connect demo.dxfeed.com:7300 Quote AAPL,IBM" | ||
isEnabled = "NO"> | ||
</CommandLineArgument> | ||
<CommandLineArgument | ||
argument = "qds "connect "dxlink:wss://demo.dxfeed.com/dxlink-ws" Quote AAPL" -p dxfeed.experimental.dxlink.enable=true,scheme=ext:resource:dxlink.xml " | ||
isEnabled = "YES"> | ||
</CommandLineArgument> | ||
<CommandLineArgument | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// NativeQdsUtils.swift | ||
// DXFeedFramework | ||
// | ||
// Created by Aleksey Kosylo on 05.12.23. | ||
// | ||
|
||
import Foundation | ||
@_implementationOnly import graal_api | ||
|
||
class NativeQdsUtils { | ||
static func execute(_ parameters: [String]) throws { | ||
let thread = currentThread() | ||
let cStrings = parameters.map { str in | ||
str.toCStringRef() as UnsafePointer<CChar> | ||
} | ||
let classes = UnsafeMutablePointer<UnsafePointer<CChar>?> | ||
.allocate(capacity: parameters.count) | ||
var iterator = classes | ||
for code in parameters { | ||
iterator.initialize(to: code.toCStringRef()) | ||
iterator = iterator.successor() | ||
} | ||
|
||
let list = UnsafeMutablePointer<dxfg_string_list>.allocate(capacity: 1) | ||
list.pointee.size = Int32(parameters.count) | ||
list.pointee.elements = classes | ||
_ = try ErrorCheck.nativeCall(thread, dxfg_Tools_main(thread, list)) | ||
|
||
classes.deinitialize(count: parameters.count) | ||
classes.deallocate() | ||
list.deinitialize(count: 1) | ||
list.deallocate() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// QdsUtils.swift | ||
// DXFeedFramework | ||
// | ||
// Created by Aleksey Kosylo on 05.12.23. | ||
// | ||
|
||
import Foundation | ||
|
||
public class QdsUtils { | ||
public static func execute(_ parameters: [String]) throws { | ||
try NativeQdsUtils.execute(parameters) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// | ||
// QdsTool.swift | ||
// Tools | ||
// | ||
// Created by Aleksey Kosylo on 05.12.23. | ||
// | ||
|
||
import Foundation | ||
import DXFeedFramework | ||
|
||
class QdsTool: ToolsCommand { | ||
var isTools: Bool = true | ||
var cmd = "Qds" | ||
var shortDescription = "A collection of tools ported from the Java qds-tools." | ||
|
||
var fullDescription = | ||
""" | ||
Qds | ||
======= | ||
Usage: | ||
Qds <arg> [<options>] | ||
Where: | ||
value pos. 0 Required. | ||
-p, --properties Comma-separated list of properties (key-value pair separated by an equals sign). | ||
""" | ||
|
||
private lazy var arguments: Arguments = { | ||
do { | ||
let arguments = try Arguments(ProcessInfo.processInfo.arguments, requiredNumberOfArguments: 1) | ||
return arguments | ||
} catch { | ||
print(fullDescription) | ||
exit(0) | ||
} | ||
}() | ||
|
||
func execute() { | ||
do { | ||
try arguments.properties.forEach { key, value in | ||
try SystemProperty.setProperty(key, value) | ||
} | ||
try QdsUtils.execute(arguments.qdsCommandLine ?? [String]()) | ||
} catch { | ||
print("Qds tool error: \(error)") | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters