FIX: stupid pb fixed (close to being medieval'ed by The Ken)
[cmake.git] / Source / cmSourceFile.h
blob4a6d67c9f7f08bfb043627d35e4cca598909241a
1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmSourceFile.h,v $
5 Language: C++
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
26 * a makefile.
28 class cmSourceFile
30 public:
31 /**
32 * Construct instance as a concrete class with both a
33 * .h and .cxx file.
35 cmSourceFile()
37 m_AbstractClass = false;
38 m_HeaderFileOnly = false;
39 m_WrapExclude = false;
42 /**
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);
51 /**
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,
57 bool headerFileOnly);
59 /**
60 * Print the structure to std::cout.
62 void Print() const;
64 /**
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; }
71 /**
72 * Indicate whether the class should not be wrapped
74 bool GetWrapExclude() const { return m_WrapExclude; }
75 void SetWrapExclude(bool f) { m_WrapExclude = f; }
77 /**
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; }
84 /**
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;}
90 /**
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;}
97 /**
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; }
113 private:
114 bool m_AbstractClass;
115 bool m_WrapExclude;
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;
124 #endif