C++ automatic header on emacs - c++

I would like to have a header template for some of my c++ files, edited with Emacs. What I need is a header with the following information:
*/
|-------------------------------------------------------------------
|
| Project: Name_of_proyect
|
| Created on:
|
| Last Modified:
|
| Author: author_name
|
|-------------------------------------------------------------------
*/
I would like to specify the project's and author's name on the template and the dates of creation and last modification to be updated automatically. How can I do this?

You can use library header2.el to do what you want. You can customize the header in various ways. See Emacs Wiki page Automatic File Headers for more information.

I'm using built-in autoinsert package with some customization. Full config is available here. The customization implements replacement of date, header file name, etc.
My templates you can find here.

Related

How to use documentation template from another project

I'm using enterprise architect 15 to generate documentation via Publish/Report Builder/Generate documentation. There, I see I can use templates:
I want to use a template that I used in another project, but it's unclear to me how to properly export it from another project and import into this one.
You can export and import templates using the Reference Data Import/Export feature.
Export
Configure | Model | Transfer | Export Reference Data
Select the the templates you want to export.
Import
Configure | Model | Transfer | Import Reference Data
Make sure to select the Document Templates dataset to import.
MDG file
An alternative to this import/export is to include the templates in an MDG technology file. See the manual for more info.

Qt Creator placeholders

I found out that Qt Creator can insert a license template header when creating a new file and fill certain placeholders automatically like file name and year:
/**
#file %FILENAME%
Copyright (c) %YEAR%
*/
Are these placeholders documented anywhere ? Maybe in some kind of a list ?
PS: Under this bug report (QTCREATORBUG-14726) Tobias Hunger commented that a new macro style of this format: %{CurrentDate:FORMATSTRING} is being used. But I can't find a documentation for this either!
I can't see anything where there is a license file already stored, but on Qt website it says this:
Adding a License Header Template for C++ Code
A file containing a license header for C++ can be specified under Tools > Options > C++ > License Template. It may contain special placeholders enclosed in %% that are replaced when generating a new file:
%YEAR%: Year
%MONTH%: Month
%DAY%: Day of the month
%DATE%: Date
%USER%: Username
%FILENAME%: File name
%CLASS%: Class name (if applicable)
%$VARIABLE%: Contents of environment variable VARIABLE.
which can be set in:
Tools->Options...->C++->File Naming
After some digging around the issue mention in the OP the following seems to work with QtCreator 4.2.0:
%{Cpp:License:FileName}
%{Env:<Environmentalvar>} E.g: %{Env:PATH}
%{CurrentDate:yyyy-MM-dd}
%{Cpp:License:ClassName}
From the QtCreator Sources. It would be nice to get this properly documented.

Is there any way to have the line comment shortcut add a space after // in WebStorm?

When using the shortcut for commenting a line of code (command / on a Mac), the code line gets a // added in front of it. (Pointing out the obvious for topic clarification).
Stylistically I would like to add a space between the // and the start of some code that I'm commenting out. i.e. make the comment leader when added // function foo() { rather than //function foo() { which is the default.
What I can't find is how to change this setting in JetBrains WebStorm (I've already tried trolling their website and the preferences etc with no success) - I've also run many searches (my google-foo is terrible!) but have yet to find how to change this setting.
Anybody know how (or if?) this setting can be changed?
As far as I'm aware it's not possible.
https://youtrack.jetbrains.com/issue/IDEA-141701 -- watch this ticket (star/vote/comment) to get notified on progress.
UPDATE (20th April, 2016)
It's now implemented and available as of 2016.1 version.
Settings/Preferences | Code Style -- It was implemented for these languages (not sure about any other):
Java -- Java | Code Generation | Comment Code
JavaScript/TypeScript -- JavaScript | Other | Comment Code
PHP -- PHP | Other | Comment Code
I highlight the code that I want to comment out and use tab to indent, and then cmd + / to add "//"

How can I change the template comment on new file creation?

When I create a new javascript file, a template like comment is added at the top of the file that looks like this:
/**
* Created by User on 2015-03-29.
*/
I would like to modify this template, but I cannot for the life of me figure out how.
In the settings page, I have tried searching for 'IDE settings', 'File and Coding Template' (as it would be in PHPStorm, I believe), 'Copyright' (as in IntelliJ), 'header', 'template', 'comment' and different combinations of those terms. But none of these terms result in anything relevant. And searching on google is difficult, because most links take you to PHPStorm or IntelliJ help docs.
Maybe my google-fu is off today...
Settings (Preferences on Mac) | Editor | File and Code Templates | Templates -- you need JavaScript File entry.
And searching on google is difficult, because most links take you to PHPStorm or IntelliJ help docs.
Well ... PhpStorm = WebStorm + PHP + Databases -- in terms of settings it is exactly the same... (comparable builds of course)
P.S.
In previous versions (WebStorm v8, PhpStorm v8.0.1 and older, IntelliJ v13) all Settings were in single column but separated in 2 groups: "Project Settings" on top and then "IDE Settings" on the bottom of the list. In current versions all settings are mixed together using collapsible tree structure and you have to look for special icon next to the settings section name -- it will tell if you this is an IDE wide setting or project specific.

Doxygen how to separate classes by path?

So how exactly does one separate classes by path in Doxygen? I have tried with groups and sections,but for some reason, it would always combine classes with same name.
Current file structure is as following:
Trunk
|
+-> Client -> DemoClass.h
|
+-> Server -> DemoClass.h
|
+-> Shared -> OtherClass.h
Problem is I don't want a 1x DemoClass in doxygen that contains all the functions combined i want 2 seperate sections/class as in Server/DemoClass, Client/DemoClass.
This is a known limitation, see bullet 4 of http://www.doxygen.org/manual/trouble.html.
I recommend to make separate projects, one for the server and one for the client, as they can never be legally in one executable anyway, or use namespaces.
File names can be the same, that's not a problem.