Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 341086

Summary: Add a variable like 'base_filename' to the code template variables
Product: [Tools] CDT Reporter: Dirk Wibben <dirk.wibben>
Component: cdt-editorAssignee: Anton Leherbauer <aleherb+eclipse>
Status: RESOLVED FIXED QA Contact: Anton Leherbauer <aleherb+eclipse>
Severity: enhancement    
Priority: P3 CC: cdtdoug
Version: 7.0.2   
Target Milestone: 8.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.