1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmSourceFile.h,v $
6 Date: $Date: 2002-06-28 14:18:28 $
7 Version: $Revision: 1.8 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmSourceFile_h
18 #define cmSourceFile_h
20 #include "cmStandardIncludes.h"
22 /** \class cmSourceFile
23 * \brief Represent a class loaded from a makefile.
25 * cmSourceFile is represents a class loaded from
32 * Construct instance as a concrete class with both a
37 m_AbstractClass
= false;
38 m_HeaderFileOnly
= false;
39 m_WrapExclude
= false;
43 * Set the name of the file, given the directory the file should be
44 * in. The various extensions provided are tried on the name
45 * (e.g., cxx, cpp) in the directory to find the actual file.
47 void SetName(const char* name
, const char* dir
,
48 const std::vector
<std::string
>& sourceExts
,
49 const std::vector
<std::string
>& headerExts
);
52 * Set the name of the file, given the directory the file should be in. IN
53 * this version the extension is provided in the call. This is useful for
54 * generated files that do not exist prior to the build.
56 void SetName(const char* name
, const char* dir
, const char *ext
,
60 * Print the structure to std::cout.
65 * Indicate whether the class is abstract (non-instantiable).
67 bool IsAnAbstractClass() const { return m_AbstractClass
; }
68 bool GetIsAnAbstractClass() const { return m_AbstractClass
; }
69 void SetIsAnAbstractClass(bool f
) { m_AbstractClass
= f
; }
72 * Indicate whether the class should not be wrapped
74 bool GetWrapExclude() const { return m_WrapExclude
; }
75 void SetWrapExclude(bool f
) { m_WrapExclude
= f
; }
78 * Indicate whether this class is defined with only the header file.
80 bool IsAHeaderFileOnly() const { return m_HeaderFileOnly
; }
81 bool GetIsAHeaderFileOnly() const { return m_HeaderFileOnly
; }
82 void SetIsAHeaderFileOnly(bool f
) { m_HeaderFileOnly
= f
; }
85 * The full path to the file.
87 const std::string
&GetFullPath() const {return m_FullPath
;}
88 void SetFullPath(const char *name
) {m_FullPath
= name
;}
91 * The file name associated with stripped off directory and extension.
92 * (In most cases this is the name of the class.)
94 const std::string
&GetSourceName() const {return m_SourceName
;}
95 void SetSourceName(const char *name
) {m_SourceName
= name
;}
98 * The file name associated with stripped off directory and extension.
99 * (In most cases this is the name of the class.)
101 const std::string
&GetSourceExtension() const {return m_SourceExtension
;}
102 void SetSourceExtension(const char *name
) {m_SourceExtension
= name
;}
105 * Return the vector that holds the list of dependencies
107 const std::vector
<std::string
> &GetDepends() const {return m_Depends
;}
108 std::vector
<std::string
> &GetDepends() {return m_Depends
;}
110 ///! Set/Get per file compiler flags
111 void SetCompileFlags(const char* f
) { m_CompileFlags
= f
;}
112 const char* GetCompileFlags() const { return m_CompileFlags
.size() ? m_CompileFlags
.c_str(): 0; }
114 bool m_AbstractClass
;
116 bool m_HeaderFileOnly
;
117 std::string m_CompileFlags
;
118 std::string m_FullPath
;
119 std::string m_SourceName
;
120 std::string m_SourceExtension
;
121 std::vector
<std::string
> m_Depends
;