Skip to content

Commit b8eeb88

Browse files
authored
Merge pull request #1090 from thewtex/create-binary-file
create-itk-wasm support for BinaryFile, TextFile
2 parents 8880d58 + 212d57d commit b8eeb88

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

packages/core/typescript/create-itk-wasm/src/generate/pipeline.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ function cxxType(optionKind: string, optionType: string): string {
240240
return 'itk::wasm::InputBinaryStream'
241241
case 'TextStream':
242242
return 'itk::wasm::InputTextStream'
243+
case 'BinaryFile':
244+
return 'std::string'
245+
case 'TextFile':
246+
return 'std::string'
243247
case 'JsonCompatible':
244248
return 'itk::wasm::InputTextStream'
245249
case 'string':
@@ -274,6 +278,10 @@ function cxxType(optionKind: string, optionType: string): string {
274278
return 'itk::wasm::OutputBinaryStream'
275279
case 'TextStream':
276280
return 'itk::wasm::OutputTextStream'
281+
case 'BinaryFile':
282+
return 'std::string'
283+
case 'TextFile':
284+
return 'std::string'
277285
case 'JsonCompatible':
278286
return 'itk::wasm::OutputTextStream'
279287
case 'string':
@@ -335,6 +343,12 @@ function optionTypeSizeName(
335343
case 'TextStream':
336344
result += `->type_name("${typeNamePrefix}TEXT_STREAM")`
337345
break
346+
case 'BinaryStream':
347+
result += `->type_name("${typeNamePrefix}BINARY_FILE")`
348+
break
349+
case 'TextStream':
350+
result += `->type_name("${typeNamePrefix}TEXT_FILE")`
351+
break
338352
case 'JsonCompatible':
339353
result += `->type_name("${typeNamePrefix}JSON")`
340354
break

packages/core/typescript/create-itk-wasm/src/inquire/option-specs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async function editIndexOptionSpecs(
6464
{
6565
type: 'list',
6666
name: 'type',
67-
message: 'Type',
67+
message: 'Type:',
6868
choices: typeChoices,
6969
prefix,
7070
askAnswered,

packages/core/typescript/create-itk-wasm/src/parse-cli-args.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ function optionSpecParser(
5757
}
5858

5959
if (spec.length > 5) {
60-
result.itemsExpectedMin = parseInt(spec[6])
60+
result.itemsExpectedMin = parseInt(spec[5])
6161
} else {
6262
result.itemsExpectedMin = 1
6363
}
6464

6565
if (spec.length > 6) {
66-
result.itemsExpectedMax = parseInt(spec[7])
66+
result.itemsExpectedMax = parseInt(spec[6])
6767
} else {
6868
result.itemsExpectedMax = 1
6969
}

0 commit comments

Comments
 (0)