SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
DirectoryInfo.h
1 //=========================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //=========================================================================
10 // .NAME DirectoryInfo.h - represnts the directory structure of an Attribute Resource
11 // .SECTION Description
12 // DirectoryInfo is meant to store the directory structure associated with an
13 // attribute resource
14 // .SECTION See Also
15 /* Intended Use
16  A FileInfo instance represents the information found in an included attribute file
17  which includes the following:
18  - Catagories specified in the file
19  - The set of include files that file uses
20  - The default catagory that the file specified (if any)
21 
22  The DirectoryInfo is simply a vector of FileInfos. The IncludeIndex property
23  found in Attributes, Definitions, and View corresponds to an index into this
24  vector indicating that the instanced was read in from that file.
25 
26  The first index in the array is "special" in that it represents the ressource
27  itself. Any new Defintions, Attributes, or Views created after the resource
28  is loaded into memory will be considered part of that "file". This is why
29  the default value for the IncludeIndex Property is 0!
30 */
31 
32 #ifndef smtk_attribute_DirectoryInfo_h
33 #define smtk_attribute_DirectoryInfo_h
34 
35 #include "smtk/CoreExports.h"
36 #include "smtk/SystemConfig.h"
37 
38 #include <set>
39 #include <string>
40 #include <vector>
41 
42 namespace smtk
43 {
44 namespace attribute
45 {
46 
47 class SMTKCORE_EXPORT FileInfo
48 {
49 public:
50  FileInfo(const std::string& f)
51  : m_filename(f)
52  {
53  }
54  const std::string& filename() const { return m_filename; }
55  void appendInclude(const std::string& includeFile) { m_includes.push_back(includeFile); }
56  const std::vector<std::string>& includeFiles() const { return m_includes; }
57  void setCatagories(const std::set<std::string>& newCatagories) { m_catagories = newCatagories; }
58  const std::set<std::string>& catagories() const { return m_catagories; }
59  void setDefaultCatagory(const std::string& catagory) { m_defaultCategory = catagory; }
60  const std::string& defaultCatagory() const { return m_defaultCategory; }
61 
62  void print(const std::string& pre);
63 
64 protected:
65  std::string m_filename;
66  std::string m_defaultCategory;
67  std::vector<std::string> m_includes;
68  std::set<std::string> m_catagories;
69 };
70 
71 typedef std::vector<FileInfo> DirectoryInfo;
72 }; // namespace attribute
73 }; // namespace smtk
74 
75 #endif
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
smtk::attribute::FileInfo
Definition: DirectoryInfo.h:47