[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kdoc
Subject:    RE: Parsing empty defines from class names
From:       Mike Davis <mdavis () xcaliber ! com>
Date:       2000-08-23 7:55:50
[Download RAW message or body]

Pass the source code through the gnu compiler. KDOC has a command line
option for it. If you're developing under NT then you can get a copy of
cygwin to help you to do this from http://www.cygnus.com/cygwin/.

Personally I copy the includes over to Linux and run kdoc there.

FYI, my DLL export defines look like...

#if defined( WIN32 ) && defined( USE_DLL )
	#ifdef DLL_COMPILE
		#define DLL_EXPORT __declspec(dllexport)
		#define DLL_TEMPLATE_EXPORT
	#else
		#define DLL_EXPORT __declspec(dllimport)
		#define DLL_TEMPLATE_EXPORT extern
	#endif
#else
	#define DLL_EXPORT
	#define DLL_TEMPLATE_EXPORT
#endif

class DLL_EXPORT MyClass:public SomeOtherClass
{
  ...
};


Note the default behaviour is to just define the pre-processor values so
that they get thrown away.

-----Original Message-----
From: Guillaume, Caumon (caum) [mailto:caum@chevron.com]
Sent: Wednesday, August 23, 2000 12:26 AM
To: 'Jason Dryer'; kdoc
Subject: RE: Parsing empty defines from class names


Hi, 


in my version (quite an old one), I have a function ' sub readCxxLine'  in
bin/kdoc. 
You can try to add:

$p = ~ s#[ ]PS_DECL_SNM_[a-zA-Z]*##g;

just before the lines:
	$p = ~ s#//.*$##g;			# C++ comment
	$p = ~ s#/\*(?!\*).*?\*/##g;		# C comment

Hope that helps,

	Guillaume.

> -----Original Message-----
> From:	Jason Dryer [SMTP:Jason.Dryer@wcom.com]
> Sent:	Tuesday, August 22, 2000 3:04 PM
> To:	kdoc
> Subject:	Parsing empty defines from class names
> 
> Hi,
> 
> The project I work on uses an object-to-relational mapping product
> called Persistence, which generates classes which map server objects
> into a relational database.  The problem I'm having with kdoc and the
> generated code is that the generated code includes a define immediately
> after the class keyword, like this:
> 
> #if !defined(PS_DECL_SNM_Persistence)
> #       if defined(PS_DLL)
> #               if defined(PS_BUILD_SNM_Persistence)
> #                       define PS_DECL_SNM_Persistence
> __declspec(dllexport)
> #               elif defined(PS_IMPORT_SNM_Persistence)
> #                       define PS_DECL_SNM_Persistence
> __declspec(dllimport)
> #               else
> #                       define PS_DECL_SNM_Persistence
> #               endif
> #       else
> #               define PS_DECL_SNM_Persistence    //<<==== using this
> define
> #       endif
> #endif
> 
> class PS_DECL_SNM_Persistence thisClassName: public parentClassName
> 
> The kdoc parser reads the class name for the class to be the
> PS_DECL_SNM_Persistence define.  Not too large an issue to change for a
> single class, but I'm attempting to parse a good number of classes and
> they all get grouped into this "class".
> 
> Has anyone encountered this and found a workaround, or have other
> suggestions I can try?
> 
> Jason Dryer
> SNM Development
> Worldcom
> 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic