Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » How to insert a function comment with params and return?
How to insert a function comment with params and return? [message #147527] Sun, 26 June 2005 11:43 Go to next message
Eclipse UserFriend
Originally posted by: bandrews.nospam_bphnx.com

Hi All,

In the JDT, I can just type /** and ENTER above a method and a
multi-line comment is automatically created with parameters and a
return. Is there a way to do this in CDT? I know about the templates in
Preferences->C->Editor->Templates, but I cannot figure out how in the
world this works, and of course the help is no good. It says stuff like,
"Edit
Edits the code template that is selected in the list." That's nice, but
how does it help. The JDT is mostly intuitive and works.

If anyone can help, I would greatly appreciate it.

thanks,

Barry
Re: How to insert a function comment with params and return? [message #147566 is a reply to message #147527] Mon, 27 June 2005 03:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: plankton.softwitch.net

Barry Andrews wrote:
> Hi All,
>
> In the JDT, I can just type /** and ENTER above a method and a
> multi-line comment is automatically created with parameters and a
> return. Is there a way to do this in CDT? I know about the templates in
> Preferences->C->Editor->Templates, but I cannot figure out how in the
> world this works, and of course the help is no good. It says stuff like,
> "Edit
> Edits the code template that is selected in the list." That's nice, but
> how does it help. The JDT is mostly intuitive and works.
>
> If anyone can help, I would greatly appreciate it.
>
> thanks,
>
> Barry

sorry, actually I dont know about formal commenting rule of C/C++.
anyway, what you want is Java Doclet feature, and It is not implemented
on C/C++ yet. actually, in JAVA 5.0, JavaDoc works with Java-Annotation
Technology.

and Code Formatter and Template features of CDT still in development.
I hope it will be good infomation for you.

Jiyul
Re: How to insert a function comment with params and return? [message #147574 is a reply to message #147566] Mon, 27 June 2005 09:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bandrews.nospam_bphnx.com

Well... I don't think there is a FORMAL commenting rule for C++. I have
seen different projects use different formats.

We typically do it something like this.

//////////////////////////////////////////////////////////// ///////
// Function : MyClass::MyFunc
// Description : Does something useful hopefully.
// Parameters : const QString& name
// int zipCode
// Return : void
//////////////////////////////////////////////////////////// ///////


So are you saying that eventually with the CDT templates feature I would
be able to specify the above template maybe like this:


//////////////////////////////////////////////////////////// ///////
// Function : ${class}::${function_name}
// Description :
// Parameters : ${parameters}
// Return : ${return}
//////////////////////////////////////////////////////////// ///////


and then invoke it by typing // and enter above a function?


many thanks,

Barry





jiyul wrote:
> Barry Andrews wrote:
>
>> Hi All,
>>
>> In the JDT, I can just type /** and ENTER above a method and a
>> multi-line comment is automatically created with parameters and a
>> return. Is there a way to do this in CDT? I know about the templates
>> in Preferences->C->Editor->Templates, but I cannot figure out how in
>> the world this works, and of course the help is no good. It says stuff
>> like, "Edit
>> Edits the code template that is selected in the list." That's nice,
>> but how does it help. The JDT is mostly intuitive and works.
>>
>> If anyone can help, I would greatly appreciate it.
>>
>> thanks,
>>
>> Barry
>
>
> sorry, actually I dont know about formal commenting rule of C/C++.
> anyway, what you want is Java Doclet feature, and It is not implemented
> on C/C++ yet. actually, in JAVA 5.0, JavaDoc works with Java-Annotation
> Technology.
>
> and Code Formatter and Template features of CDT still in development.
> I hope it will be good infomation for you.
>
> Jiyul
Re: How to insert a function comment with params and return? [message #147615 is a reply to message #147527] Mon, 27 June 2005 13:34 Go to previous message
Eclipse UserFriend
Barry,
I've been using Doxygen to generate JavaDoc-like HTML docs. It can also
generate some simple class diagrams. Like you, I haven't been able to
autogenerate the comment stub, but that may be in the latest I-build.

Regards,

Mark


Barry Andrews wrote:
> Hi All,
>
> In the JDT, I can just type /** and ENTER above a method and a
> multi-line comment is automatically created with parameters and a
> return. Is there a way to do this in CDT? I know about the templates in
> Preferences->C->Editor->Templates, but I cannot figure out how in the
> world this works, and of course the help is no good. It says stuff like,
> "Edit
> Edits the code template that is selected in the list." That's nice, but
> how does it help. The JDT is mostly intuitive and works.
>
> If anyone can help, I would greatly appreciate it.
>
> thanks,
>
> Barry
Previous Topic:Irreversible crash after 2 days of proper use
Next Topic:Previous Declaration of
Goto Forum:
  


Current Time: Mon Jun 09 07:56:28 EDT 2025

Powered by FUDForum. Page generated in 0.03488 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top