Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 1614: Move Implementation & IPP files
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

MrDoomMaster
Tomato Guru

251 Posts

Posted - Oct 29 2007 :  1:49:41 PM  Show Profile  Reply with Quote
IDE: Visual Studio 2005

Assume the following two files:

foo.h
foo.ipp

In foo.h, I have the following code:

#ifndef FOO_H
#define FOO_H

template< typename T >
class foo
{
public:
	void SomeMember()
	{
		// Do stuff
	}
};

#include "foo.ipp"

#endif // FOO_H


Now assume that the IPP is empty. When you right click on member SomeMember(), the refactoring option "Move implementation to source file" is unavailable. If you rename foo.ipp to foo.cpp, it becomes available.

Expected behavior:
"Move Implementation" refactoring option should recognize IPP files as source files and thus be available.

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Oct 29 2007 :  3:03:33 PM  Show Profile  Reply with Quote
Why should Move Implementation to Source File recognise a IPP file? Alt-o does not recognise an IPP file, and I am not getting any syntax highlighting, no context and no definition field either in this file. As far as the IDE and VA are concerned, this is not a code file.

Have you modified your registry to make this a known code file?

zen is the art of being at one with the two'ness
Go to Top of Page

MrDoomMaster
Tomato Guru

251 Posts

Posted - Oct 29 2007 :  4:19:07 PM  Show Profile  Reply with Quote
quote:
Originally posted by feline

Why should Move Implementation to Source File recognise a IPP file? Alt-o does not recognise an IPP file, and I am not getting any syntax highlighting, no context and no definition field either in this file. As far as the IDE and VA are concerned, this is not a code file.

Have you modified your registry to make this a known code file?



I have not modified my registry. I didn't modify anything to make this work, it just works. Alt+O works (it takes me from the H file to the IPP file) and syntax highlighting works too. As far as I'm concerned, every part of VAX treats IPP as a file with C++ source in it except for "Move Implementation". "Create Implementation" also does not recognize it, as it creates the implementation for template classes in the same H file and not in the IPP (However this is an off topic issue).
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Oct 29 2007 :  6:06:55 PM  Show Profile  Reply with Quote
*puzzled*

Can you download this C++ console project, and see what you see when you open it please?

http://forum.wholetomato.com/colin/forumimages/ipp_files.zip

This contains a .H and .IPP pair of files. The IPP file contains invalid C++ code, includes a header file that does not exist, and the project compiles perfectly on my machine.

As far as the IDE and VA are concerned the IPP file is a plane TXT file.


Create Implementation placing implementations for template class member functions into the header file is by design, since you need to #include the implementation for the code to compile. So it is either place the implementation into the header file, or #include the cpp file.

zen is the art of being at one with the two'ness
Go to Top of Page

hotzenplotz
Senior Member

Austria
34 Posts

Posted - Nov 01 2007 :  11:46:58 PM  Show Profile  Reply with Quote
Usually you include the ipp file in the last line of your hpp file ;)

Use the source, Luke!
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Nov 02 2007 :  09:05:07 AM  Show Profile  Reply with Quote
That would solve the "how do I include this" problem, but it isn't going to help much with the fact that both the IDE and VA believe that IPP files are really TXT files in disguise - well that's what they believe on my system anyway.

I know I can add custom C++ extensions, there is an FAQ for this, but by default my system does not know about IPP files.

zen is the art of being at one with the two'ness
Go to Top of Page

tailsu
Senior Member

37 Posts

Posted - Nov 05 2007 :  03:35:45 AM  Show Profile  Reply with Quote
IPP stands for implementation++. Some boost libraries use them. Even though the IDE doesn't highlight them, the debugger is able to step through them. They're kind of a pain in the neck.

There is another problem with extensionless files. For example the vector header is highlighted just because it's in the system include paths. We have extensionless headers that aren't there (namely the google hash set library). VA X is having hard time parsing them. It doesn't even show them in the #include listbox.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Nov 05 2007 :  08:09:46 AM  Show Profile  Reply with Quote
Try turning on:

VA Options -> Projects -> Extensions -> Parse files without extensions as headers

this should help.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000