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

10 comments
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

Abe,

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

0
Comment actions Permalink

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
Comment actions Permalink

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

0
Comment actions Permalink

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
Comment actions Permalink

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

0
Comment actions Permalink

will do thx :)

0
Comment actions Permalink

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.