glideapps / glideapps/quicktype

ts to C++ class template argument renamed

Open
#1,992 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
13.9k
Forks
1.2k
Avg merge
8h 53m
Merged PRs (30d)
369

Description

This is minimal example:

**temp.ts** :
```
export class StateInfo {
public state: T;'
public changeTime: number;
}

export enum xxx {
jam = "xx",
jest = "yy"
}
export enum www {
Disabled = 'asd',
Ok = 'qwe',
Error = 'zxc',
Maintenance = 'tyu',
}
export class foo {

public state: StateInfo;
}
export class woo {

public test2: StateInfo;

}
```
I execute command:
`quicktype -s typescript -l c++ --namespace exampleNS -o results.hpp --include-location local-include --code-format with-getter-setter --hide-null-optional --no-boost --member-style camel-case --source-style multi-source --src temp.ts
`
and received this list of generated files:
```
Foo.hpp
Generators.hpp
helper.hpp
PurpleStateInfoT.hpp
results.hpp
StateInfoT.hpp
StateInfoWww.hpp
StateInfoXxx.hpp
Woo.hpp
Www.hpp

```

**PurpleStateInfoT.hpp :**
```
// To parse this JSON data, first install
//
// json.hpp https://github.com/nlohmann/json
//
// Then include this file, and then do
//
// PurpleStateInfoT.hpp data = nlohmann::json::parse(jsonString);

#pragma once

#include "json.hpp"
#include "helper.hpp"

namespace exampleNS {
using nlohmann::json;

enum class PurpleStateInfoT : int { XX, YY };
}
```

Enum xxx was renamed to PurpleStateInfoT.
it's affects only first template argument class in the row. As you can see the second one is named properly.
So generated files name depend on the order of classes definition

I expect to have same class name after translation

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.