c++ - Get file directory in Apache Velocity Template Language -
clion uses apache's velocity template language (vtl) create templates c++ , c files. on clion's (https://www.jetbrains.com/help/clion/file-template-variables.html) bunch of variables can used listed.
i wondering however, if possible use directory c++ file created variable in 1 of templates? i'm asking because structure source files in java/package-type fashion.
all files in "utils" directory part of "utils" namespace, packages in "ui" directory part of "ui" namespace etc...
so wondering if there's way me obtain parent directory of file can use in template? (maybe setting variable in cmakelists.txt
?)
here's example of i'd achieve
#parse("c file header.h") #[[#ifndef]]# ${include_guard} #[[#define]]# ${include_guard} ${namespaces_open} namespace ${cwd} class ${name} { }; ${namespaces_close} #[[#endif]]# //${include_guard}
where ${cwd}
represents folder file in.
the ${namespace_open}
, ${namespace_close}
directives seem purely symbolic clion, websites lists "indicates beginning/end of namespace block created during refactoring."
Comments
Post a Comment