Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marshal non-const char* as StringBuilder #508

Open
ddobrev opened this issue Jun 30, 2015 · 2 comments
Open

Marshal non-const char* as StringBuilder #508

ddobrev opened this issue Jun 30, 2015 · 2 comments

Comments

@ddobrev
Copy link
Contributor

ddobrev commented Jun 30, 2015

There may be some gotchas such as ANSI/Unicode so some reading is needed but this can and should be done.

@genuinelucifer
Copy link
Contributor

@ddobrev char* is NOT always meant to work as placeholder for a string. So how can it be differentiated if it is meant to be pointer (hence better a 'ref char') or a string (so 'StringBuilder').
In my opinion, it would however be better to marshal std::string as StringBuilder...

@ddobrev
Copy link
Contributor Author

ddobrev commented Jul 18, 2015

It's impossible to determine. So we have to use the solution which works in both cases and that is StringBuilder because in the case of a pointer to a char it would simply be a StringBuilder with a single character.
std::string represented with a StringBuilder might or might not be a good idea but in any case it's unrelated to the current issue. Also it's quite difficult because std::string is a typedef to a template type and we don't have proper support for templates yet. So if you want to develop your idea, please file another issue.

@ddobrev ddobrev changed the title Marshal (non-const) char* as StringBuilder Marshal non-const char* as StringBuilder Aug 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants