CLion has file template to generate C++ Class, which generates source file and header. In my project I have handler classes that have same code part, and i want to generate them by file templates. And templates that i created can't do this:
Set file names for class MyHandlerClass i want my_handler_class.cpp and .hpp
From one class name i want to generate 2 files header and source, don't know how to do that.
- I also want to have string like MyClass -> my-class, found function
$lowercaseAndDash($NAME)
but don't know why its not works
I have template for header:
#pragma once
// includes
namespace handlers {
class ${NAME}: public Parent {
public:
// methods
};
}
I tried to solve first problem by setting the file name like this: #set ($FILE_NAME = "test_class.hpp")
. But i don't know hot to set CamelCase to snake, and this don't works.
Also find in docs function to snake case, but its not works for me in file template.