How to structure private and public API in C++ (header files)

Viewed 3741

I am currently developing an API and I now find useful to have an explicit split in my directory tree in order to separate public header files and private header and source files. This way, it is going to be easier to build both the public and the development (private) package for my SDK. I have now in mind two different options:

1)
.../LibName/Class.h
.../LibName/private/ClassImpl.h
.../LibName/private/LibName/ClassImpl.cpp

2)
.../public/LibName/Class.h
.../private/LibName/ClassImpl.h
.../private/LibName/ClassImpl.cpp

It would be nice to have files organized in the way 'Libname/FileName' at least for the public files, because this is the way include directives are in my code:

#include "LibName/FileName.h"

What do you think is the best option to organize the headers for an API? One of these two or maybe some other?

Thank you

1 Answers
Related