Support for simple upper case
For c header files i use include guards like
#ifndef HEADER_H #define HEADER_H ... #endif
HEADER_H is typically the corresponding header filename in uppercase.
Sometimes I have some software module with numbers. In that case the upperCase implementation does not work, because i get blanks then:
e.g. for header1.h i would get: #ifndef HEADER 1_H
which will not work. I'd like to have an option to just get the characters uppercase without separation of words.
Currently as a workaround i use upperSnakeCase, but then i get HEADER_1_H (However I'd prefer HEADER1_H)
Could you post a specific template, input, and expected output so I can make sure I’m understanding the issue?
I might not be understanding but I wonder if you can write the template so the .h/_h is not part of the input?
Thanks!
On Jan 11, 2019, at 2:49 AM, MGoesswein [email protected] wrote:
For c header files i use include guards like
#ifndef HEADER_H #define HEADER_H ... #endif
HEADER_H is typically the corresponding header filename in uppercase.
Sometimes I have some software module with numbers. In that case the upperCase implementation does not work, because i get blanks then:
e.g. for header1.h i would get: #ifndef HEADER 1_H
which will not work. I'd like to have an option to just get the characters uppercase without separation of words.
Currently as a workaround i use upperSnakeCase, but then i get HEADER_1_H (However I'd prefer HEADER1_H)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
You can find a demo in the attached zip File. If I use MyHeader1 as input (name), then i get "MY HEADER 1" for upperCase and "MY_HEADER_1" as upperSnakeCase. Actually i use upperSnakeCase, it works technically for the include guards, but the common conventions for include guards of c/c++ header files is to use just uppercase of the filename ("MYHEADER1"). Of course we need some different conversion name for that like simpleUpperCase or something like that to get the desired output (it shall be just the name in uppercase without further modifications).
To solve this problem it seems like we need to be able to chain transforms together. So upperCase followed by a new transform of "alphanumeric" to strip out all but letters and numbers.
Or like you said add a new transform for this specific case.
Would be open to either solution preferring the chain version... obviously more work though.