I prefer this way, too. (Also, .h for C++ headers, not .hpp). -----Original Message----- From: gmpi-bounce@xxxxxxxxxxxxx [mailto:gmpi-bounce@xxxxxxxxxxxxx] On Behalf Of Koen Tanghe Sent: Sunday, March 06, 2005 4:49 PM To: gmpi@xxxxxxxxxxxxx Subject: [gmpi] Re: conventions opinions On Sunday, March 06, 2005 3:09 AM [GMT+1=CET], Tim Hockin <xxxthockin@xxxxxxxxxxxxx> wrote: > Opinion time. > > > I'm organizing files. How do we want to name files? > > If I have a class Foo, does it go in Foo.cpp, foo.cpp, or something else? Personally, I tend to do this: - put the class definition in a file called Foo.h - put the class implementation in a file called Foo.cpp With the following two exceptions (that might not be necessary here, I don't know): - inline functions: put inline function implementations in a file called Foo.inl, and #include this at the bottom of the Foo.h file - template functions: put template function implementations in a file called Foo.tpl, and #include this at the bottom of the Foo.h file This is because they have to be defined in every translation unit that uses them. (I have also used .cpp for template function implementations, but that was just because some compilers wouldn't do the syntax highlighting on .tpl files. You can usually change that somehow nowadays.) > If I have a class BarInterface, does it go in BarInterface.cpp, > bar_interface.cpp, barinterface.cpp, or something else? Since the class name is BarInterface, the implementation file would be BarInterface.cpp. My 2 cents, Koen ---------------------------------------------------------------------- Generalized Music Plugin Interface (GMPI) public discussion list Participation in this list is contingent upon your abiding by the following rules: Please stay on topic. You are responsible for your own words. Please respect your fellow subscribers. Please do not redistribute anyone else's words without their permission. Archive: http://www.freelists.org/archives/gmpi Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe ---------------------------------------------------------------------- Generalized Music Plugin Interface (GMPI) public discussion list Participation in this list is contingent upon your abiding by the following rules: Please stay on topic. You are responsible for your own words. Please respect your fellow subscribers. Please do not redistribute anyone else's words without their permission. Archive: http://www.freelists.org/archives/gmpi Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe