cmSourceFile.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2000 National Library of Medicine
  8. All rights reserved.
  9. See COPYRIGHT.txt for copyright details.
  10. =========================================================================*/
  11. #ifndef cmSourceFile_h
  12. #define cmSourceFile_h
  13. #include "cmStandardIncludes.h"
  14. /** \class cmSourceFile
  15. * \brief Represent a class loaded from a makefile.
  16. *
  17. * cmSourceFile is represents a class loaded from
  18. * a makefile.
  19. */
  20. class cmSourceFile
  21. {
  22. public:
  23. /**
  24. * Construct instance as a concrete class with both a
  25. * .h and .cxx file.
  26. */
  27. cmSourceFile()
  28. {
  29. m_AbstractClass = false;
  30. m_HeaderFileOnly = false;
  31. m_WrapExclude = false;
  32. }
  33. /**
  34. * Set the name of the file, given the directory
  35. * the file should be in. Various extensions are tried on
  36. * the name (e.g., .cxx, .cpp) in the directory to find the actual file.
  37. */
  38. void SetName(const char* name, const char* dir);
  39. /**
  40. * Set the name of the file, given the directory the file should be in. IN
  41. * this version the extesion is provided in the call. This is useful for
  42. * generated files that do not exist prior to the build.
  43. */
  44. void SetName(const char* name, const char* dir, const char *ext,
  45. bool headerFileOnly);
  46. /**
  47. * Print the structure to std::cout.
  48. */
  49. void Print() const;
  50. /**
  51. * Indicate whether the class is abstract (non-instantiable).
  52. */
  53. bool IsAnAbstractClass() const { return m_AbstractClass; }
  54. bool GetIsAnAbstractClass() const { return m_AbstractClass; }
  55. void SetIsAnAbstractClass(bool f) { m_AbstractClass = f; }
  56. /**
  57. * Indicate whether the class should not be wrapped
  58. */
  59. bool GetWrapExclude() const { return m_WrapExclude; }
  60. void SetWrapExclude(bool f) { m_WrapExclude = f; }
  61. /**
  62. * Indicate whether this class is defined with only the header file.
  63. */
  64. bool IsAHeaderFileOnly() const { return m_HeaderFileOnly; }
  65. bool GetIsAHeaderFileOnly() const { return m_HeaderFileOnly; }
  66. void SetIsAHeaderFileOnly(bool f) { m_HeaderFileOnly = f; }
  67. /**
  68. * The full path to the file.
  69. */
  70. std::string GetFullPath() const {return m_FullPath;}
  71. void SetFullPath(const char *name) {m_FullPath = name;}
  72. /**
  73. * The file name associated with stripped off directory and extension.
  74. * (In most cases this is the name of the class.)
  75. */
  76. std::string GetSourceName() const {return m_SourceName;}
  77. void SetSourceName(const char *name) {m_SourceName = name;}
  78. /**
  79. * The file name associated with stripped off directory and extension.
  80. * (In most cases this is the name of the class.)
  81. */
  82. std::string GetSourceExtension() const {return m_SourceExtension;}
  83. void SetSourceExtension(const char *name) {m_SourceExtension = name;}
  84. /**
  85. * Return the vector that holds the list of dependencies
  86. */
  87. const std::vector<std::string> &GetDepends() const {return m_Depends;}
  88. std::vector<std::string> &GetDepends() {return m_Depends;}
  89. private:
  90. bool m_AbstractClass;
  91. bool m_WrapExclude;
  92. bool m_HeaderFileOnly;
  93. std::string m_FullPath;
  94. std::string m_SourceName;
  95. std::string m_SourceExtension;
  96. std::vector<std::string> m_Depends;
  97. };
  98. #endif