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

0
10 comments

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.

0
Avatar
Permanently deleted user

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.

0

Abe,

you can configure the built-in templates so they suite your project. Does it solve the problem for you?

0
Avatar
Permanently deleted user

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

0

What kind of stuff do you have in your templates? Maybe there is some other way to do this.

0
Avatar
Permanently deleted user

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

0

OK,
Check out Preferences->Live Templates, they may be also useful in you case.

0
Avatar
Permanently deleted user

will do thx :)

0
Avatar
Permanently deleted user

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^

0

Please sign in to leave a comment.