# How good is RDoc at documenting "raw" C++ code?

**URL:** <https://www.ruby-forum.com/t/how-good-is-rdoc-at-documenting-raw-c-code/67695>\
**Category:** Ruby\
**Created:** [September 6, 2006, 3:08am UTC](https://www.ruby-forum.com/t/how-good-is-rdoc-at-documenting-raw-c-code/67695 "2006-09-06T03:08:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/u/MSEdward_SEdS_Bora)\
**Post date:** [September 6, 2006, 3:08am UTC](https://www.ruby-forum.com/t/how-good-is-rdoc-at-documenting-raw-c-code/67695/1 "2006-09-06T03:08:56Z")

</div>

Just out of curiosity, if I have some fairly well constructed C++ code,  
how good a job of document generation can I expect to get from RDoc with  
no modifications to the code?

---

<div class="post-metadata">

**Author:** ![MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/u/MSEdward_SEdS_Bora)\
**Post date:** [September 6, 2006, 6:01am UTC](https://www.ruby-forum.com/t/how-good-is-rdoc-at-documenting-raw-c-code/67695/2 "2006-09-06T06:01:12Z")

</div>

Le 6 sept. 06 Ã 03:01, M. Edward (Ed) Borasky a Ã©crit :

> Just out of curiosity, if I have some fairly well constructed C++  
> code,  
> how good a job of document generation can I expect to get from RDoc  
> with  
> no modifications to the code?

see [http://thoraval.yvon.free.fr/RAliasFile/](http://thoraval.yvon.free.fr/RAliasFile/) for an example (still  
alpha), here is my C :

//  
// RAliasFile.c  
//  
/\*

- Resolve an alias file returning the path of alias target from
- alias path.
- Provides additionnal info on both the alias file itself and
- the target file/folder.
- 
- Print-out version number :
- RAliasFile.version
- 
- Typical use from Ruby :
- raf=RAliasFile.new(“/absolute/path/to/alias/file”)
- 
- raf.alias\_path # =\> returns the given input alias path
- raf.path\_exists? # =\> returns true if the alias path does  
exists on the file system, false otherwise
- raf.is\_alias\_file? # =\> returns true if the alias is truly an  
alias file one, false otherwise
- raf.is\_alias\_broken? # =\> returns true if alias is broken, false  
otherwise
- raf.resolved\_path # =\> returns the path of the alias target
- raf.was\_aliased? # =\> returns true if the alias is a correct  
alias file, false otherwise
- raf.is\_folder\_alias? # =\> returns true if the target of the  
alias is a folder, false otherwise
- raf.is\_file\_alias? # =\> returns true if the target of the  
alias is a file, false otherwise  
\*/

#include \<CoreFoundation/CoreFoundation.h\>  
#include \<Carbon/Carbon.h\>  
#include \<CFURL.h\>  
#include \<ruby.h\>

VALUE cRAliasFile;

/\*

- Initialize all internal variables  
_/  
VALUE m\_raliasfile\_init(int argc, VALUE_ argv, VALUE self)

[…]

/\*

- Sets alias path to alias\_path  
\*/  
VALUE m\_set\_alias\_path(VALUE self, VALUE alias\_path) {  
rb\_iv\_set(self, “@alias\_path”, alias\_path);  
}

/\*

- returns true if the path given for the alias file is on the file  
system, false otherwise  
\*/  
VALUE m\_path\_exists(VALUE self) {  
return rb\_iv\_get(self, “@path\_exists”);  
}

[…]

---

<div class="post-metadata">

**Author:** ![MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/u/MSEdward_SEdS_Bora)\
**Post date:** [September 6, 2006, 9:37am UTC](https://www.ruby-forum.com/t/how-good-is-rdoc-at-documenting-raw-c-code/67695/3 "2006-09-06T09:37:26Z")

</div>

On Sep 5, 2006, at 8:50 PM, Yvon T. wrote:

> - Sets alias path to alias\_path  
> \*/  
> VALUE m\_set\_alias\_path(VALUE self, VALUE alias\_path) {  
> rb\_iv\_set(self, “@alias\_path”, alias\_path);  
> }

Don’t forget call-seq:

something like

call-seq:  
some\_object.alias\_path(alias) → alias

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)

---

<div class="post-metadata">

**Author:** ![MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/u/MSEdward_SEdS_Bora)\
**Post date:** [September 6, 2006, 6:38pm UTC](https://www.ruby-forum.com/t/how-good-is-rdoc-at-documenting-raw-c-code/67695/4 "2006-09-06T18:38:31Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

M. Edward (Ed) Borasky wrote:

> Just out of curiosity, if I have some fairly well constructed C++ code,  
> how good a job of document generation can I expect to get from RDoc with  
> no modifications to the code?

Doxygen is better suited for this task:  
[http://www.stack.nl/~dimitri/doxygen/](http://www.stack.nl/~dimitri/doxygen/)  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFE/vlZmV9O7RYnKMcRAug2AJ4szOAeYl8de1KPhZGs35Gdb+PJvwCdEXzE  
HtgaQZUYOtCLXK+1nkjuxIw=  
=RO8u  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/u/MSEdward_SEdS_Bora)\
**Post date:** [September 6, 2006, 10:37am UTC](https://www.ruby-forum.com/t/how-good-is-rdoc-at-documenting-raw-c-code/67695/5 "2006-09-06T10:37:32Z")

</div>

Le 6 sept. 06 Ã 09:33, Eric H. a Ã©crit :

> Don’t forget call-seq:
> 
> something like
> 
> call-seq:  
> some\_object.alias\_path(alias) -\> alias

fine thanxs, i’ll modify that asap, to be the clearest as possible ))

---

<div class="post-metadata">

**Author:** ![MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/u/MSEdward_SEdS_Bora)\
**Post date:** [September 6, 2006, 7:26pm UTC](https://www.ruby-forum.com/t/how-good-is-rdoc-at-documenting-raw-c-code/67695/6 "2006-09-06T19:26:39Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

Yvon T. wrote:

> Le 6 sept. 06 ï¿½ 18:38, Suraj N. Kurapati a ï¿½crit :
> 
> > Doxygen is better suited for this task:  
> > [http://www.stack.nl/~dimitri/doxygen/](http://www.stack.nl/~dimitri/doxygen/)
> 
> however, it seems to me, they are not speaking about ruby ???

Correct, they are not speaking of documenting Ruby. Instead, they  
are speaking of using RDoc on C++ code.

Doxygen is better suited for C and C++.  
RDoc is better suited for Ruby.  
-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFE/wLomV9O7RYnKMcRAlhOAJ9OYrL+dqL7STvU2Cv7ziBAJv2DEgCfcArF  
1OAY8YaWhyz9ngcZ2Ee10c4=  
=cgK4  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/u/MSEdward_SEdS_Bora)\
**Post date:** [September 6, 2006, 7:04pm UTC](https://www.ruby-forum.com/t/how-good-is-rdoc-at-documenting-raw-c-code/67695/7 "2006-09-06T19:04:36Z")

</div>

Le 6 sept. 06 Ã 18:38, Suraj N. Kurapati a Ã©crit :

> Doxygen is better suited for this task:  
> [http://www.stack.nl/~dimitri/doxygen/](http://www.stack.nl/~dimitri/doxygen/)

however, it seems to me, they are not speaking about ruby ???

---

<div class="post-metadata">

**Author:** ![MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@MSEdward\_SEdS\_Bora](https://www.ruby-forum.com/u/MSEdward_SEdS_Bora)\
**Post date:** [September 7, 2006, 5:01am UTC](https://www.ruby-forum.com/t/how-good-is-rdoc-at-documenting-raw-c-code/67695/8 "2006-09-07T05:01:36Z")

</div>

Suraj N. Kurapati wrote:

> RDoc is better suited for Ruby.  
> Yeah … I have Doxygen installed. I suspect RDoc will do just fine on  
> “vanilla C” code, but I also suspect C++ will break it.
