C++ File Templates creating the header and cpp file in one go
i created 2 file templates.
one for a header and one for a cpp
but i dont want to have to add them seprately. is there a way to link them so when one is created the second will be added also?
thx
Please sign in to leave a comment.
There is a built-in C++ file template that created both, cpp and h files for you. You can configure the template in AppCode->Settings->File Templates->Templates.
You can also create C++ files with New->File from Xcode Template.
Yes thx there is a template already builtin.
i have also built my own set of h and cpp files. which have a lot more in them relevent to my current project. i would link to link my h and cpp file so i only have to add one and get both like the native template.
Abe,
you can configure the built-in templates so they suite your project. Does it solve the problem for you?
alas no i have more than one template. as it stands i have 3 for the first section of the project. thats 3 sets of headers and cpp files 6 file templates.
as the project grows i hope to expand the set possibly up to nine. so it would be good if i can pair them up.
thx for any advice
What kind of stuff do you have in your templates? Maybe there is some other way to do this.
i can just create the 2 files file sepratly but i thought you might have a caommand similer to #parse('some header file') but say #useInlude("include template name")
the classes i have are made up of a few headers and a bunch of methods which will always be the same. so a template is ideal. dont get me wrong it works now i just have to create the header and the cpp seprate.
cheers
OK,
Check out Preferences->Live Templates, they may be also useful in you case.
will do thx :)
agreed.. there is a need to defined new class template as a set of h and cpp files!
one class template is not good enough for professional projects.
^bump up^
Here is a request for this feature: http://youtrack.jetbrains.com/issue/IDEA-91565