ctkCmdLineModuleDefaultPathBuilder.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef __ctkCmdLineModuleDefaultPathBuilder_h
  16. #define __ctkCmdLineModuleDefaultPathBuilder_h
  17. #include "ctkCommandLineModulesCoreExport.h"
  18. #include <QStringList>
  19. #include <QScopedPointer>
  20. class ctkCmdLineModuleDefaultPathBuilderPrivate;
  21. /**
  22. * \class ctkCmdLineModuleDefaultPathBuilder
  23. * \brief Builds up a list of directory paths to search for command line modules.
  24. *
  25. * Unfinished:
  26. *
  27. * <pre>
  28. * Implements the following basic strategy, depending on which boolean flags are on:
  29. * By default they are all off, as directory scanning is often time consuming.
  30. *
  31. * 1. CTK_MODULE_LOAD_PATH environment variable
  32. * 2. Home directory
  33. * 3. Home directory / cli-modules
  34. * 4. Current working directory
  35. * 5. Current working directory / cli-modules
  36. * 6. Application directory
  37. * 7. Application directory / cli-modules
  38. * </pre>
  39. *
  40. * \author m.clarkson@ucl.ac.uk
  41. */
  42. class CTK_CMDLINEMODULECORE_EXPORT ctkCmdLineModuleDefaultPathBuilder
  43. {
  44. public:
  45. ctkCmdLineModuleDefaultPathBuilder();
  46. ~ctkCmdLineModuleDefaultPathBuilder();
  47. virtual void setLoadFromHomeDir(bool doLoad);
  48. virtual void setLoadFromCurrentDir(bool doLoad);
  49. virtual void setLoadFromApplicationDir(bool doLoad);
  50. virtual void setLoadFromCtkModuleLoadPath(bool doLoad);
  51. virtual QStringList build() const;
  52. private:
  53. QScopedPointer<ctkCmdLineModuleDefaultPathBuilderPrivate> d;
  54. Q_DISABLE_COPY(ctkCmdLineModuleDefaultPathBuilder)
  55. };
  56. #endif