I have a library of functions contained in a delphi unit which we shall call UtilitiesU. Some of these functions are just helper functions that are only used inside UtilitiesU. I would like to limit the scope of these functions to UtilitiesU. These are the methods that I know of for doing this:
- Remove the declaration from the interface and move the function before its dependents in the implementation - messy, counter-intuitive order of function definitions, not always possible if there is e.g. mutual dependency
- Put all the functions into a static class (ala Java) and make them public or private as appropriate - too much boilerplate, convoluted
- Declare the helper functions local to the functions in which they are used - same problems as point 1
Ideally, I would like to do it the C/C++ way - that is, declare them as static in the implementation section. Is this possible? Is there a better way?