libcellml icon indicating copy to clipboard operation
libcellml copied to clipboard

Static typeAsString() enough?

Open agarny opened this issue 2 years ago • 1 comments

We have PR #1131 that adds some static typeAsString() methods wherever needed. This is all good for people who want to retrieve a string version of a given type, but having used those methods a few times now, I find them a bit frustrating to use. In my use case, I just need to retrieve the type as a string of, say, a variable. So, I wish I could just do something like: var->typeAsString() rather than have to do AnalyserVariable::typeAsString(var->type()).

So, in addition to our static typeAsString() methods, I would very much like to see a typeAsString() that returns the object's type as a string. Views? @hsorby @nickerso

agarny avatar Mar 02 '23 23:03 agarny

I'm a bit worried about this being a gateway to people then asking for typeFromString API which I think is not something we want to do. The AnalyserVariable::typeAsString(var->type()) function is convenience for GUI widgets like comboboxes/selects.

hsorby avatar Mar 06 '23 22:03 hsorby