Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341086 - Add a variable like 'base_filename' to the code template variables
Summary: Add a variable like 'base_filename' to the code template variables
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 7.0.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 8.0   Edit
Assignee: Anton Leherbauer CLA
QA Contact: Anton Leherbauer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-28 08:02 EDT by Dirk Wibben CLA
Modified: 2011-03-31 10:23 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wibben CLA 2011-03-28 08:02:04 EDT
Build Identifier: CDT 7.0.2.201102110609

Our coding standards require a 'namespace' identifier before every element (variables, constants, functions, macros, etc.), which consists of the basename of the C-file.
Example:

Test.c:

#define Test_OneMacro() (...)

unsigned char Test_OneVariable;

void Test_OneFunction(void);


I have coded several Editor-Templates for inserting/adding such elements, but what I miss in the list of available Variables is something like ${basefilename}. There is already ${file}, but this is alway expanded to 'Test.c'. What I would like to have is 'Test' WITHOUT the extention.
So far I use ${file}, but I always have to edit the inserted code afterwards to delete the extention.

Reproducible: Always
Comment 1 Anton Leherbauer CLA 2011-03-31 09:30:26 EDT
I'll add a variable named "file_base", because that's already available for file/code templates.
Comment 2 Dirk Wibben CLA 2011-03-31 09:48:39 EDT
That sounds great. Exactly what I was looking for.

THX a lot.
Comment 3 Anton Leherbauer CLA 2011-03-31 10:08:35 EDT
Committed.