Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Bug in CppBuilder module - SourceToObjName()
Bug in CppBuilder module - SourceToObjName() [message #58078] Tue, 08 February 2022 16:40 Go to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Using import.ext, with source files one level UP from package's one brings truncation to ObjName :

package:FoundationClasses
srcfile:/home/massimo/sources_TOOLS/UppOpenCascade2/_OCC_/OS D/OSD_File.cxx
srcfile trimmed:/home/massimo/sources_TOOLS/UppOpenCascade2/_OCC_/OS D/OSD_File.cxx
GetFileFolder(PackagePath(package)):/home/massimo/sources_TO OLS/UppOpenCascade2/FoundationClasses
q:62
r:.cxx

objname is returned as

'.cxx'

it should be something like

'_home_massimo_sources_TOOLS_UppOpenCascade2__OCC__OSD_OSD_F ile.cxx'

or, maybe

'_OCC__OSD_OSD_File.cxx'

but the latter could be problematic in some corner cases
Re: Bug in CppBuilder module - SourceToObjName() [message #58079 is a reply to message #58078] Tue, 08 February 2022 16:45 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
I'd suggest to replace it with this one...

String SourceToObjName(const String& package, const String& srcfile_)
{
	String srcfile = srcfile_;
	srcfile.TrimEnd(".cpp");
	srcfile.TrimStart(GetFileFolder(PackagePath(package)));
	String r;
	for(const char *s = ~srcfile; *s; s++)
		r.Cat(findarg(*s, '/', '\\') >= 0 ? '_' : *s);
	return r;
}
Previous Topic: TheIDE support for Visual Studio Build Tools 2022?
Next Topic: Installation problem
Goto Forum:
  


Current Time: Sat Jul 20 05:06:19 CEST 2024

Total time taken to generate the page: 0.02402 seconds