File tree Expand file tree Collapse file tree 1 file changed +26
-4
lines changed
Expand file tree Collapse file tree 1 file changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,28 @@ function main() {
161161main ();
162162```
163163
164+ ### Kotlin
165+
166+ ``` kotlin
167+ import com.kcl.api.API
168+ import com.kcl.api.execProgramArgs
169+
170+ val args = execProgramArgs { kFilenameList + = " schema.k" }
171+ val api = API ()
172+ val result = api.execProgram(args)
173+ ```
174+
175+ ### Swift
176+
177+ ``` swift
178+ import KclLib
179+
180+ let api = API ()
181+ var execArgs = ExecProgram_Args ()
182+ execArgs.kFilenameList .append (" schema.k" )
183+ let result = try api.execProgram (execArgs)
184+ ```
185+
164186### C++
165187
166188For CMake, you can use FetchContent to add KCL C++ Lib to your project.
@@ -199,12 +221,12 @@ Write the code
199221
200222int main ()
201223{
202- auto args = kcl_lib::ExecProgramArgs();
203- auto files = rust::Vec<rust::String>();
204- files.push_back(rust::String("../test_data/schema.k"));
205- args.k_filename_list = files;
224+ auto args = kcl_lib::ExecProgramArgs {
225+ .k_filename_list = { "../test_data/schema.k" },
226+ };
206227 auto result = kcl_lib::exec_program(args);
207228 std::cout << result.yaml_result.c_str() << std::endl;
229+ return 0;
208230}
209231```
210232
You can’t perform that action at this time.
0 commit comments